Repository navigation
fix(tools): report symlink-looping suggest_patches directories as usage errors - #12340
Conversation
|
I fetched the current PR head ( |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the path normalization change and the symlink-loop regression. The exact-head focused suite passed 36 tests locally; the loop case is checked for both --catalog and --sce-module-path and confirms the relinker is not invoked. Hosted Ubuntu and Windows relinker checks pass. macOS relinker jobs are still pending, so no macOS run is claimed.
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 800599a8465b207ba175203f9ab24f8143436d6a — approve. Patch-advisor catalog/module directory loops are converted into usage errors rather than escaping through Path.resolve. The resolved catalog path is reused for validation.
Windows/Python 3.11: head test_suggest_patches.py: 33 passed, 3 skipped (36 total); base test_suggest_patches.py: 33 passed, 2 skipped (35 total). The independent real-junction fixture returns exit 2 without a traceback on head and exit 1 with a traceback on base. Neither the metadata nor the existing independent output is modified. No title conversion or patch applicability is claimed.
800599a to
601c0dc
Compare
|
windows-latest |
7e3c2a5 to
42ea885
Compare
4c11f31 to
e8bb5b4
Compare
malekaifa
left a comment
There was a problem hiding this comment.
Reviewed exact current head e8bb5b4. tools/tests/test_suggest_patches.py passes 38 tests on Windows Python 3.12 with 4 expected filesystem/symlink skips and 38/38 on WSL Python 3.12. Current-main merge-tree is clean and git diff --check is clean; the hosted Build is fully green across Ubuntu/Windows/macOS relinker, ASan and eligibility. I also verified that this head's two touched blobs are byte-identical to the #12340 snapshot already integrated and tested in #12769's proposed prerequisite stack, so approving this live head does not introduce a divergence from that integration. No blocking issue found.
a8e4680 to
55868bc
Compare
malekaifa
left a comment
There was a problem hiding this comment.
Re-checked exact current head 55868bc. The two touched blobs are byte-identical to the exact head I previously tested and approved (suggest_patches.py dc4f9cf41b631d897b27e5dafaf2bbd36ba2290c; test_suggest_patches.py 20bdd49e9c0b477ec4f4f6a29887824c305766be). Current-main merge-tree is clean and git diff --check passes. The refreshed hosted run has eligibility green and the platform relinker jobs queued; no implementation/test change was introduced by this rebase. My prior Windows/WSL exact-behavior validation still applies. No blocking issue found.
166229d to
bb66f41
Compare
bb66f41 to
d8081ef
Compare
What
suggest_patchesprinted a traceback when--catalogor--sce-module-path(or the input's parent directory) was a symbolic link loop (ln -s loop loop). It does not give its usage error in that case.Both directories go through
Path.resolve()inmain. On Python 3.11–3.12 (the tool needstomllib, so 3.11 is the minimum), that raisesRuntimeError("Symlink loop ..."). The handler isexcept (OSError, ValueError, ...), so the error goes uncaught and the exit code is 1. On 3.13+resolve()doesn't raise, and the run ends with the existingPatch advisor:error, exit 2.Both directories now use
os.path.realpath, which doesn't raise for a loop on any version. The catalog directory is resolved once and reused byload_catalogandvalidate_entry, so behaviour is unchanged for normal paths. A looping catalog now reachesconfined(), which already turns the loop intoinvalid relative path: 'index.json': Symlink loop .... A looping module parent hits the existingmodule parent must be a directorycheck. Both exit 2 before the relinker runs, the same as on 3.13+.Tested
macOS arm64. New
test_directory_symlink_loop_is_a_usage_errorputs the loop at--catalogand at--sce-module-path. For each it checks exit 2, aPatch advisor:message and that the relinker was never run.RuntimeError: Symlink loop)resolve()doesn't raise there)test_suggest_patches36 OK on 3.12, 3.13, 3.14 and 3.15no catalog entry, exit 1ctest378/378 on main 3a40945check_conventions --base upstream/mainandpr_overlapcleanChecklist
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)