fix: preserve strong references when grouping duplicate imports #6432
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6432"
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 MrMha on 2026-10-15T15:00:55Z.
What
Duplicate references to the same NID/library currently inherit the last reference's weak flag. A strong reference followed by a weak one is therefore reported as weak, including in the current-stop record. Mark a grouped import weak only when every reference is weak. The regression verifies both mixed-reference orders, all-strong/all-weak cases, reference conservation, and stop consistency.
Tested
macOS 27.0.1 arm64, Python 3.12.14; tooling fixtures only, no title.
The new regression failed on main
ff23657before the fix. This branch was tested independently from that base.The combined local validation checkout containing all ten independent tooling fixes also built with
ANYPS5_RELINKER_ONLY=ON,BUILD_TESTING=ONand passed all 172 CTest tests. Full Windows/Linux runtime and GPU tests were not run.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-15T15:39:47Z.
I ran the test this PR adds, on Linux.
Setup: head
8f8949676merged into main at92e50418f(no conflicts; the PR's base is 53 commits behind), Linux, Python 3.14.8, clean environment (env -i, only HOME and PATH set).python3 -m unittest -v test_import_auditfrom tools/tests, 3 runs each.test_duplicate_import_strength_is_order_independent.With the change, a strong import is kept whichever order the duplicates come in. This PR and #6113 both edit tools/import_audit.py; I checked that they merge together without conflicts.
I did not check Windows or macOS.
AI-assisted: yes