fix(tools): report symbolize_samples symbolic link loops as usage errors #13197
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13197"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-30T06:08:11Z.
What
symbolize_samples.pycompares the sample captures and--sincewith--out(and later each--libsfile with--out) throughPath.resolve(). On Python 3.9–3.12 (documented floor 3.9, docs/dev/BUILD.md), a symbolic link loop used as the samples,--sinceor--outraisesRuntimeError: Symlink loopfromresolve(), which the tool does not catch, so the user gets a traceback and exit status 1. On 3.13+ the same input already ends in the usage error (rc 2). Both comparisons now useos.path.realpath, which never raises on a loop, so the loop reaches the existing alias check /open()and is reported as the usual usage error (rc 2) with no output written.Tested
test_symbolic_link_loops_are_usage_errors(looping--out, samples,--since): withmain'ssymbolize_samples.pyswapped in it is RED on Python 3.12 (3 subtests, traceback); OK on the branch.test_symbolize_samplesmodule: 32/32 OK on Python 3.12 and 3.13 (macOS arm64).python3 tools/check_conventions.py --base upstream/main— PASS.python3 tools/pr_overlap.py --branch fix/symbolize-samples-symlink-loop— 1472 probed, 3 file-sharers; after merging all three into the base only #12499 remains:tools/symbolize_samples.pyL3 import-line merge-order only (this PR addsimport os, #12499 addsimport json, both afterimport collections; no behavioural overlap — landing order is #13197 → #12498 → #12499, this PR first).ctest --test-dir build-relinker -j 8: 513/513.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-30T10:28:57Z.
Review: CHANGES_REQUESTED
Reviewed exact head
93244d6c0e. I found no functional blocker in the symlink-loop fix itself: tools/tests/test_symbolize_samples.py passes 32 tests on Windows Python 3.12 with 4 expected platform skips and 32/32 on WSL Python 3.12; the loop-safe os.path.realpath comparisons also preserve Windows case-insensitive alias detection in a direct probe. The remaining blocker is landing-order bookkeeping, not code. Current #12498 explicitly declares Depends on #13197 and contains this exact head as an ancestor; current #12499 contains #12498 as an ancestor and declares #13197 -> #12498 -> #12499. I verified both ancestry links locally (merge-base --is-ancestor returns 0) and both pairwise merge previews are clean. This PR's description still says #12499 should land first / this PR second and its checklist says Depends on none, which now contradicts the tested stack. Please confirm the revised order #13197 -> #12498 -> #12499 and update this PR's overlap/order text accordingly (Depends on can remain none because this is the first PR). Once that bookkeeping is aligned, I have no code change to request and can approve the exact head without rerunning the already-green suite.Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-31T01:00:22Z.
Review: APPROVED
Re-reviewed exact current head
4bc5ab46eeafter the rebase and landing-order correction. The PR-only delta is still the same narrow symlink-loop fix: replace the two Path.resolve() alias checks with os.path.realpath() and add the focused loop regression. The description now states the intended order #13197 -> #12498 -> #12499, resolving my previous bookkeeping-only request. On this exact head, tools/tests/test_symbolize_samples.py passes 37 tests on Windows Python 3.12 with 4 expected platform skips; git diff --check passes; merge-tree against current mainbff0289787is clean; hosted conventions, Ubuntu relinker, ASan, labels and eligibility are green, with Windows/macOS generic relinker lanes still queued. Non-blocking stack note: live #12498 does not yet contain this rebased #13197 head (merge-base --is-ancestor returns 1), so #12498 should restack after #13197 lands. No remaining blocker in #13197 itself.