fix(tools): flag qualified imports exported only under a NID #9241
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9241"
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 veosett on 2026-10-21T16:18:20Z.
What
A library-qualified literal import such as
strlenfromlibc.prxwas reported as implemented with exit code 0 even when the provider exported only its NID. The loader requires the literal name and cannot resolve this import.Preserve the implementation/stub class and report a separate
symbol_mismatchflag and count. Show the unresolved name and exported NID, include strong mismatches in the current-stop selection, and return exit code 1. Preserve literal exports, unqualified NID fallback, guest-module priority and the existing weak-import audit policy.Determine the mismatch during host-name fallback lookup, independently of the function's implementation class. This composes with #9372's
partialclass without taking that PR as a dependency. Add a regression for unresolved fallback and guest-module priority.Found while investigating #9180. This changes the diagnostic tool; SDK conversion and runtime startup are outside its scope.
Tested
Refreshed onto
main0db47b263d1019043f7d28fad4e7ee0a1ea5ec6a. Final head:b7a6e9d245e190a0fc2ba1d26f7fc9a84c482b98.Windows 11, Python 3.12.14, synthetic registries/providers; no compiler invocation.
test_import_audit.pysuite: 126 tests, 123 passed, 3 skipped (two POSIX permission cases and the Windows symlink privilege case).git merge-treewith #9372 conflicted intools/import_audit.py. The adapted head merges cleanly with #9372 at72664d1ef99aca45fc3b6f17ddbd0653e4eae2eb.aea75d89e1f9a59c68aabb3c2d2eb194c36d5ff1, extracted outside the checkout: 128 tests, 124 passed, 4 skipped (the same three cases plus the source-commit check requiring a Git checkout).partialprovider still reports the name mismatch.python tools/check_conventions.py --base origin/mainandgit diff --check: passed.No new WSL, title or native loader run, and no system-library build. Earlier validation below belongs to the preceding head.
Earlier validation on preceding heads
Base:
cecb540a63f614d2b06cbb557c6d1f6f02475fa3. Tested head:d3fdb88745.python -m unittest discover -s tools/tests -p test_import_audit.py -v.700be1869477a876cadc09bed94bac2239cfe209) and #8719 (037ad5dd967f0f2e8e1ada34482973e607de6efb) merges cleanly and runs 130 tests on Windows: 126 passed, 4 skipped (the same three platform/privilege cases and the source-commit stamp case outside a Git checkout).python tools/check_conventions.py --base origin/mainandgit diff --check origin/main...HEADpass.python tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch codex/audit-sdk-symbol-names --jobs 4completed with no confirmed overlap. Its legacy comparisons that conflict with main are qualified below.No commercial title or SDK payload was executed, and system libraries were not rebuilt. This is a Python diagnostic change; no runtime or performance improvement is claimed.
The legacy shared-file changes in #6171 (guest module identities) and #7454 (
$ORIGINdependencies) were inspected and implement different behavior. Both already conflict with main, so their combined merge is unverified. The other legacy documentation-only comparisons concern different sections of USAGE.Additional native loader validation on the same head, using fresh relinker-only builds on Windows x64 (WinLibs GCC 15.2.0) and Ubuntu 24.04 WSL (GCC 13.3): synthetic ELF inputs import
shared#A#Bfromavailable.prx. Both audit versions read the registry produced by the actual relinker and the same provider files.9E8ipSX3c9g, the NID ofsharedunresolved ELF import shared from available.prx, status0xC0000139undefined symbol: shared, exit 127shared,symbol_mismatch: 1sharedsymbol_mismatch: 0The synthetic processes actually ran on their native hosts. They validate the qualified-name diagnostic; they do not exercise the SDK CRT or title startup.
GitHub Build 39633560471 succeeded at
d3fdb88745017415aa6f542230436ffe9bd0411d: relinker build/CTest on Ubuntu, Windows, macOS ARM64 and macOS x86_64, plus the ASan TLS-function-coverage job. The CTest steps themselves completed successfully. Full Linux/Windows system-library jobs were policy-skipped.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 xXPBSXx on 2026-10-21T17:53:26Z.
Linux data point for
d3fdb88745(WSL2, Ubuntu 24.04, kernel 6.18 - a virtualised kernel, not bare-metal Linux; Python 3.12.3), this head merged ontomain950388bfd(clean merge),python3 -I tools/tests/test_import_audit.py:test_import_audit.pyon top ofmainwithout the PR's source change): FAILED (8 failures, 3 errors).Not tested: macOS, Windows.
AI-assisted (Claude Code).