manifest: resolve the stored entry on Linux casefold directories #3138
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3138"
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 ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T13:35:43Z.
Claimed in the coordination issue as: MANIFEST-LINUX-CASEFOLD-ALIAS
Depends on: #3087 (merged)
What and why
On a Linux directory with per-directory casefolding,
realpath()can preserve the requested spelling of an existing manifest. The directory scan then lists the manifest itself asNEW, andcreaterefuses to refresh it through that spelling.Compare directory identity for containment and resolve the manifest's actual entry in that directory. If multiple entries share an inode, the Linux descriptor path identifies the entry used by the lookup. A separate hard link stays visible to the existing overwrite guard.
Tested
python -I tests/test_manifest.py -vandpython -I tests/test_report_paths.py -von CachyOS (Linux 7.3.6, Python 3.14.10), using synthetic files on tmpfs. With per-directory casefold enabled, 70 passed and 2 skipped. On ordinary tmpfs, 66 passed and 6 skipped.NEWfor ASCII case, Unicode composition, and a default-ignorable character. The directory alias and separate hard-link cases also fail on the original code and pass with this change.tests/test_text_write_line_endings.py,scripts/check_no_game_data.py tools/manifest.py tests/test_manifest.py, andgit diff --checkpassed.GPUs tested: n/a (CPU only).
AI-assisted: OpenAI Codex with GPT-6.2, independently reviewed read-only by GPT-6.2 Sol.
Checklist
main(044339e4c).Imported from ubiquitarianism/leonida. Originally posted by aegish-zagi on 2026-12-02T14:36:29Z.
Verification — VERIFY-3138
ac2ea358ef; MERGEABLE against current main (69cd4106c)python -I scripts/red_green.py 3138 --remote upstream --no-cargo; plus the PR'stests/test_manifest.pyrun standalone against (a) plain main code and (b) the PR head, in a scratch worktree_insidenow resolves by inode walk (samestat up the ancestors) instead of case-folded path prefixes; new_manifest_entryfinds the stored entry by inode (with the /proc/self/fd O_PATH disambiguation for hard links) sowalkexcludes the manifest itself under any alias spelling. The logic reads sound and matches the stated follow-up on #3087; no game data, one topic, claim in placeAI-assisted: yes (Muse Wonder, Muse by Meta)
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T14:42:23Z.
Thanks for the independent check. I reran the PR’s exact
tests/test_manifest.pyon currentmain(acc350745) and on the clean merge ofac2ea358, using the same Linux casefold filesystem for both runs.On CachyOS 7.3.6 with Python 3.14.10, I used a private mount namespace (
unshare -Ur -m), mounted a freshtmpfswith-o casefold, setchattr +Fon its empty root, and used it asTMPDIR. A differently cased lookup of a probe file confirmed actual casefolding before the tests ran.mainreproduced five failures and one error across 46 tests. Plain case differences, decomposed Unicode and the default-ignorable character caused the manifest to appear asNEW. The fallback scan also included the manifest itself when it had another hard link. With the PR, 45 manifest tests and 25 path-reporting tests passed. Each suite had one expected skip, and both of the casefold tests that skipped in your run passed here. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T15:12:44Z.
Merging. Head
ac2ea358emerges cleanly withmain83046a713and does not force a rebase of #2566. Independent check on headac2ea358e: aegish-zagi's verification on this head (green on the merge plus a code audit; red not constructible on their case-sensitive filesystem), comment 7348833570; CI green incl. no-game-data; no open review or question. Merged by MoonEyes.AI-assisted (Claude Code).