Repository navigation
[flutter_tools] Fix flutter doctor path validation for symlinked SDKs - #193006
Conversation
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
There was a problem hiding this comment.
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.
|
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 Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
When Flutter is installed via a symlink or directory junction (such as via Scoop on Windows), binaries found on
PATHresolve to their target destination whileflutterRootwas compared using its unresolved path. This causedFlutterValidatorto issue bogus warnings thatflutteranddartbinaries were outside the Flutter SDK checkout.Resolve
flutterRootsymbolically 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
///).