config: canonicalize existing ancestor for import-path validation on macOS#2884
Open
domenkozar wants to merge 1 commit into
Open
config: canonicalize existing ancestor for import-path validation on macOS#2884domenkozar wants to merge 1 commit into
domenkozar wants to merge 1 commit into
Conversation
Contributor
🔍 Suggested ReviewersBased on git blame analysis of the changed lines, the following contributors have significant experience with the modified code:
Please consider reviewing this PR as you have authored significant portions of the code being modified. Your expertise would be valuable! 🙏 This comment was automatically generated by git-blame-auto-reviewer Last updated: 2026-06-03T17:27:20.151Z |
Deploying devenv with
|
| Latest commit: |
371a3e6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9fd389d1.devenv.pages.dev |
| Branch Preview URL: | https://fix-macos-import-path-valida.devenv.pages.dev |
`validate_within_root` rejected valid input-relative imports on macOS, where `TMPDIR` resolves via the `/var -> /private/var` symlink and the import path's leaf does not exist yet (`Import path '<name>/...' resolves outside the git repository`). Resolve the longest existing ancestor with `canonicalize` and append the remaining components lexically, so symlinks anywhere up the chain are followed even when the leaf is absent. Split out of #2849. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b421a7a to
371a3e6
Compare
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.
Split out of #2849 (the actionable-error PR bundled this unrelated fix).
Problem
validate_within_rootrejected valid input-relative imports on macOS, whereTMPDIRresolves via the/var -> /private/varsymlink and the import path's leaf does not exist yet:Fix
Resolve the longest existing ancestor of the path with
canonicalizeand append the remaining components lexically, so symlinks anywhere up the chain are followed even when the leaf is absent. Falls back to lexical normalization only when nothing along the path exists.🤖 Generated with Claude Code