Sitelet https://github.com/flutter/flutter/pull/193006
Skip to content

[flutter_tools] Fix flutter doctor path validation for symlinked SDKs - #193006

Merged
mattkae merged 1 commit into
flutter:masterfrom
bkonyi:issue-191936
Sep 22, 2026
Merged

mattkae merged 1 commit into
flutter:masterfrom
bkonyi:issue-191936

Conversation

@bkonyi

@bkonyi bkonyi commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

When Flutter is installed via a symlink or directory junction (such as via Scoop on Windows), binaries found on PATH resolve to their target destination while flutterRoot was compared using its unresolved path. This caused FlutterValidator to issue bogus warnings that flutter and dart binaries were outside the Flutter SDK checkout.

Resolve flutterRoot symbolically when verifying SDK binary containment, falling back to the unresolved path if resolution fails, while preserving the user-configured path for display and recommendations.

Fixes #191936

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

When Flutter is installed via a symlink or directory junction (such as
via Scoop on Windows), binaries found on PATH resolve to their target
destination while flutterRoot was compared using its unresolved path.
This caused FlutterValidator to issue bogus warnings that flutter and
dart binaries were outside the Flutter SDK checkout.

Resolve flutterRoot symbolically when verifying SDK binary containment,
falling back to the unresolved path if resolution fails, while
preserving the user-configured path for display and recommendations.

Fixes flutter#191936
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 18, 2026
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Sep 18, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request modifies FlutterValidator in doctor.dart to resolve symbolic links for the flutterRoot directory path, falling back to the unresolved path if a FileSystemException occurs. This resolved path is then used to verify if the resolved Flutter binary path is within the Flutter root. A corresponding unit test has been added to flutter_validator_test.dart to validate this behavior for a symlinked Flutter SDK on Windows. No review comments were provided, and there is no additional feedback.

@bkonyi
bkonyi requested a review from a team September 18, 2026 15:54
@flutter-dashboard

Copy link
Copy Markdown

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #193006 at sha d153010

@flutter-dashboard flutter-dashboard Bot added the will affect goldens Changes to golden files label Sep 18, 2026

@mattkae mattkae 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.

Sure 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flutter doctor incorrectly warns that Flutter/Dart are outside the SDK when installed via a Scoop junction on Windows

2 participants