feat(tools): point import_audit at a missing library's module directory #8572
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8572"
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 xXPBSXx on 2026-10-20T16:55:27Z.
What
When a needed library has no file in
--libsor--modules,import_auditnow looks for a file of that name (case-insensitive) up to four directory levels below each registry's folder and adds one line per hit:<library> is in <directory>: pass that directory with --modules. The exit code, the JSON report and theNeeded librarieslist are unchanged. Nothing is searched when no library is missing.Fixes #8571
Overlap: #7454 and #6171 (both open) also change
main()and the module handling ofimport_audit.py;git merge-treeof the heads has two conflicts with each, so whichever lands second rebases.pr_overlapwas not run.Tested
Windows 10 (19045), Python 3.12, on current upstream/main + this commit:
tools/tests/test_import_audit.py: the new test fails without the change toimport_audit.pyand passes with it; the whole file passes (121 tests, 3 skipped). The new test puts the file in a folder with a space in its name and checks that a library with no file anywhere is not listed and that the hint disappears once the directory is passed.in\Media\Modulesorin\prospero.python tools/check_conventions.py --base upstream/main: passes.Checklist
main; no other open PR implements the same functions (#7454 and #6171 also changeimport_audit.py, see Overlap).mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T17:04:19Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)tools/tests/test_import_audit.pyL684Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
tools/import_audit.pytools/tests/test_import_audit.pyImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T20:36:26Z.
I inspected the three failing CTest logs:
test_missing_library_is_located_next_to_the_registryfails on Windows because the temp path is emitted with its long username while the test expects the 8.3RUNNER~1path, and on macOS because the output resolves/var/folders/...to/private/var/folders/.... The production hint is correct; the assertion compares a non-canonical test path. I changed the expected path toelsewhere.resolve()in a local MarcZX10 commit and ranpython3 tools/tests/test_import_audit.py(121 passed, 1 skipped),git diff --check, andpython3 tools/check_conventions.py --base upstream/main; all passed. GitHub denied pushing to your fork (403), so I could not add the commit directly. Please apply the one-lineelsewhere.resolve()adjustment and rerun the three platform jobs.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T20:36:47Z.
I published the one-line portability fix as MarcZX10 commit
4092dc16b8, on branchcodex/review-8572-pathfixin my fork. You can cherry-pick it onto your PR branch; it is not a separate PR. The local validation results are in my previous comment.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T20:57:42Z.
Thanks @MarcZX10, picked your fix (the
resolve()of the expected path; you stay the author) as6736aa663d. The test compared a non-canonical temp path (8.3 name on Windows,/var->/private/varon macOS) with the resolved one the tool prints.test_import_auditpasses (122, 3 skipped) andcheck_conventionsis clean.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:54:45Z.
Review: APPROVED
Reviewed the current head
6736aa663d3234cf024af69162f40db455586375. I reranpython3 -m unittest tools.tests.test_import_audit(122 passed, 1 skipped),python3 tools/check_conventions.py --base upstream/main --head HEAD, andgit diff upstream/main...HEAD --check; all pass. The hosted relinker matrix, ASan, conventions, eligibility and labels pass on this head; full Linux/Windows/register-context/write-watch jobs were skipped. The change is focused on locating missing module files, and its overlap note names the open PRs touchingimport_audit.py; merge state is currently CLEAN.