Repository navigation
manifest: take the --out/input guard from report_paths (EGEN-MANIFEST-SHARED-PATH) - #6677
Conversation
|
Tested
|
|
Dedup verified: manifest now defers to report_paths.same_report_path, whose realpath+samefile+folding logic strictly contains the deleted private helper, so the macOS case/NFD hole closes with Linux behavior unchanged. 37/37 at the head; the new folding test errors on main. Out of scope but worth a follow-up: vertex_types, ttpf_mips, tex_headers and text_tables still carry private same_output_path copies — same EGEN-MANIFEST-SHARED-PATH pattern. Watch: #4152 also touches report_paths.py (no textual conflict, semantic watch only). Checks pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
shayderrr
left a comment
There was a problem hiding this comment.
Summary
tools/manifest.py drops its private same_output_path() and imports report_paths.same_report_path() for the --out overwrite guard, including the explicit sys.path insert needed under -I. A test simulates a case-insensitive APFS volume with canonically equivalent composed/decomposed filenames.
Why merge
The local realpath/normcase check failed to detect aliases on folding, Unicode-normalizing filesystems, allowing a manifest to replace a hashed input. Delegating to the shared helper applies the same volume-aware rules used by other tools.
Verdict: Approve
Summary
Why mergeThe local realpath/normcase check failed to detect aliases on folding, Unicode-normalizing filesystems, allowing a manifest to replace a hashed input. Delegating to the shared helper applies the same volume-aware rules used by other tools. Verdict: Approve |
tools/manifest.pykept its ownsame_output_path(realpath + normcase +samefile) for the guard that refuses an--outnaming one of the files it hashes. That copy is the ruletools/report_paths.pyalready implements for the other tools, and it misses the case the shared helper covers: on a case-insensitive (or accent-folding) volume a differently spelled--outis the same file, somanifest.py create <folder> --out <one of the hashed files>would replace an input after the run. This usesreport_paths.same_report_pathand drops the copy.Test
python -I tests/test_manifest.pymain's tool):FAILED (errors=1, skipped=1),AttributeError: module 'manifest' has no attribute 'same_report_path'. Did you mean: 'same_output_path'?Ran 37 tests ... OK (skipped=1)The new case,
ManifestOutGuardTest.test_out_guard_follows_the_folding_volume, mocksreport_pathsas a darwin case-insensitive volume (NFC vs NFDcafé.json) and asserts the guard calls them one file, then with the volume not folding says two; the private copy answered "two files" in both.End to end on this Windows box (NTFS, case-insensitive) with a synthetic folder:
python -I tools/manifest.py create <tmp> --out <tmp>\A.BIN(the folder holdsa.bin):ERROR: --out would overwrite the input ...\A.BIN, exit 1.python -I tools/manifest.py create <tmp> --out <tmp>\m.json: 1 files, exit 0;verify:OK, exit 0.No GPU needed (standard library, CPU only).
Notes
sys.path.insertof the script's folder before importing the sibling module, as the other tools do underpython -I.AI-assisted.