Skip to content

fix(tree-walker): LocalDependencyTreeLoader fails resolving symlink l…#746

Merged
ErwanRaulo merged 2 commits into
masterfrom
fix/treewalker-tests
Jul 23, 2026
Merged

fix(tree-walker): LocalDependencyTreeLoader fails resolving symlink l…#746
ErwanRaulo merged 2 commits into
masterfrom
fix/treewalker-tests

Conversation

@ErwanRaulo

@ErwanRaulo ErwanRaulo commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

bug

LocalDependencyTreeLoader.load() was failing on macOS by returning an empty dependency tree.

cause:

On macOS, os.tmpdir() returns /var/folders/..., which is a symlink to /private/var/folders/...

consequence:

two root nodes in the Arborist inventory, the incorrect one of which was referenced by arb.actualTree.

why this fix?

The only place where realpath should be used is in LocalDependencyTreeLoader, which communicates with Arborist. it is responsible for ensuring path consistency.

@ErwanRaulo
ErwanRaulo requested a review from a team as a code owner July 21, 2026 21:10
@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e07ba86

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nodesecure/tree-walker Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ErwanRaulo
ErwanRaulo force-pushed the fix/treewalker-tests branch from c371b70 to 3d98954 Compare July 21, 2026 21:14
@fraxken

fraxken commented Jul 22, 2026

Copy link
Copy Markdown
Member

CI doesn't look happy ^^

@ErwanRaulo
ErwanRaulo force-pushed the fix/treewalker-tests branch from 3d98954 to 52b28c7 Compare July 22, 2026 18:34
should be more reliable by not testing files coming from npm registry
@ErwanRaulo
ErwanRaulo merged commit f5b8df2 into master Jul 23, 2026
8 checks passed
@ErwanRaulo
ErwanRaulo deleted the fix/treewalker-tests branch July 23, 2026 12:30
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.

3 participants