Repository navigation
Conversation
macOS 14 and 15 drop a trailing slash after a followed symlink (xnu clears NAMEI_TRAILINGSLASH), so link-to-file/ resolves to the file, while Linux and macOS 26 answer ENOTDIR. wayTo always applied the Linux rule, so the realPathOf property failed intermittently on macOS 14/15 and could time out while fast-check shrank the failure. A stat probe of <link>/ now decides. When it succeeds the trailing slash is dropped; when it fails the walk keeps its own error and partial result, so ELOOP, EILSEQ and wayTo's partial return stay as they were. The property now puts its error in the report, and a run still going at 90 s counts as a failure, before the 120 s timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: a68131fc-e1c6-45c2-9cf6-4d99438fbf1d
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.
Problem
On macOS 14 and 15,
link/opens the file whenlinkpoints to a file. Linux and macOS 26 refuse the same path with ENOTDIR.wayToalways applied the Linux rule, so on macOS 14 and 15realPathOfdisagreed with the kernel. That made theproperty: realPathOftest fail now and then in CI, sometimes as a 120 s timeout while fast-check was shrinking the case.The difference is in the kernel source. In macOS 14 and 15, xnu's
vfs_cache.cclears the trailing-slash flag after it follows a link. The macOS 26 source no longer does.Fix
When a followed link has only slashes after it,
wayTonow asks the kernel withstat("<link>/"):The property test now includes the error in its report. A run still going at 90 s counts as a failure, so the test no longer runs into its 120 s timeout.
Tests
New cases in
test/utils/real-path.test.ts:Checked
Overlap
#693 and #737 change the same lines in
wayTo, so whichever lands second needs a small rebase. If #737 lands first, the probe should go through itsasked()helper.🤖 Generated with Claude Code, reviewed by Elias.