Repository navigation
Preserve native case policy for symlink names - #1144
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preserve filesystem-native name matching when the first case-sensitive comparison reaches a dangling symlink or a link into another volume. Resolve the link name using its containing directory only after verifying that both belong to the same device.
AG;DR
Behavior and boundaries
#1143 made filesystem-native case detection lazy. On Darwin,
pathconf(..., _PC_CASE_SENSITIVE)follows its final symlink (XNU implementation). A dangling link can fail that query, and a link into another volume can answer using the target's policy while the cache key comes from the link's non-followed device metadata. That can suppress a valid folded name match and cache the wrong answer for later entries.On a reached device-cache miss for a symlink, the resolver obtains its containing directory's metadata through the VFS. It uses that directory's case query only after verifying directory type and the same device as the link. A bare relative link uses
.. An unavailable or different-device parent retains the entry query; an unavailable case answer retains the conservative exact fallback. Optional parent observations do not introduce reported metadata errors. Regular entries, uniform-case backends, explicit case modes, and exact/folded comparisons that agree retain their existing paths.The optional parent stat is confined to a relevant symlink/device cache miss, not every entry. No speedup is claimed, and no filesystem case rule is inferred across unverified device boundaries. Followed entries retain their existing metadata/type path and device-cache policy.
Regression tests
The identical deterministic dangling-link fixture passes on actual pre-#1143 main
c997dc338e1adea1ccb5d4fab83f5c85a44dee40and fails on merged #1143 main52c153549739546e02af7480d6d338096548528fwithout production changes. The committed in-memory tests cover dangling, folding-target and sensitive-target links, ordinary/deferred fuzzy evaluation, bare relative roots, different-device parents, denied/nondirectory parent observations, and unavailable case answers. They assert complete output, diagnostics and query paths. No host symlink is created.Update CHANGELOG and the native-case expression design contract. No public API, flag, generated-help, archive policy, benchmark sampling, or suppression changes.
Current-head validation
Signed head
6b165cc8849cea6d9e281245912d87101e07aaa6contains actual main3e546dbef0993486217eb58f3f9276dd0003651c. Its own Test run 42426240775 is fully successful: all three platform test jobs, ASan/MSan/TSan, coverage, both actual CI lint translation units, GCC/minimal/reference/site/policy checks, all six initial Linux/macOS benchmark candidates, agreement, final fastest-seven-of-nine comparison anddone. Optional fourth/fifth candidates skipped normally. Digest-verified CI coverage reports 12/12 changed lines and 10/10 branches, both 100%. No earlier PR or commit checks substitute for this context.Development feedback also includes four executed optimized focused targets on macOS, plus the final expanded uniform-case tests. Normal changed-file/manual/commit/push policies and Trunk pass; local clang-tidy is intentionally excluded under the user's instruction. A local Darwin coverage invocation emitted only empty baseline counters and is not counted as coverage evidence; the successful current-head Linux CI is authoritative. The test-only follow-up resolved the real 7/10 branch gap and one initializer-comma finding without changing production bytes or lowering policy.
Ordering
This isolated correctness recovery precedes the remaining #1140 → #1141 → #1142 sequence. #1139 already merged after its fresh post-#1143 run succeeded. Exact predecessor main Test 42424228394 is successful. Verify this repair's post-merge main automation, then synchronize downstream work normally and collect its required fresh benchmark/check contexts. Existing reports and measurements retain their original source identities; no data is relabeled. Broader optimization work remains paused.