Skip to content

Don't follow symlinks in literal segments of workspace globs - #4951

Merged
sigurdm merged 2 commits into
dart-lang:mainfrom
spydon:workspace-glob-symlink-segments
Nov 3, 2026
Merged

sigurdm merged 2 commits into
dart-lang:mainfrom
spydon:workspace-glob-symlink-segments

Conversation

@spydon

@spydon spydon commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #4949.

Problem

package:glob steps straight into literal segments on case-sensitive platforms, so followLinks: false doesn't apply to them. With linked/*, where linked is a symlink, packages behind the link become workspace members. On Windows, globs are case-insensitive and every segment is listed, so the same pubspec doesn't pick them up.

Solution

Skip any glob match that is a symlink or is reached through one below the workspace root, so all platforms behave the same. A new test covers a symlink in a literal glob segment, and the symlink tests now share one expectOnlyPackage helper.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

Note: The Dart team is trialing Gemini Code Assist. Don't take its comments as final Dart team feedback. Use the suggestions if they're helpful; otherwise, wait for a human reviewer.

Comment thread lib/src/package.dart Resolved
Comment thread test/workspace_test.dart Resolved
@spydon

spydon commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@sigurdm fixed it up according to your comments

@sigurdm sigurdm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@sigurdm
sigurdm merged commit 4e77447 into dart-lang:main Nov 3, 2026
34 checks passed
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.

2 participants