Skip to content

config: canonicalize existing ancestor for import-path validation on macOS#2884

Open
domenkozar wants to merge 1 commit into
mainfrom
fix/macos-import-path-validation
Open

config: canonicalize existing ancestor for import-path validation on macOS#2884
domenkozar wants to merge 1 commit into
mainfrom
fix/macos-import-path-validation

Conversation

@domenkozar
Copy link
Copy Markdown
Member

Split out of #2849 (the actionable-error PR bundled this unrelated fix).

Problem

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

Fix

Resolve the longest existing ancestor of the path with canonicalize and 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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

🔍 Suggested Reviewers

Based on git blame analysis of the changed lines, the following contributors have significant experience with the modified code:

  • @sandydoo - 100.0% of changed lines (1 lines)

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 29, 2026

Deploying devenv with  Cloudflare Pages  Cloudflare Pages

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

View logs

`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>
@domenkozar domenkozar force-pushed the fix/macos-import-path-validation branch from b421a7a to 371a3e6 Compare June 3, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant