sdk
sdk copied to clipboard
[CP] [ CLI ] Fix issue where 'dart build' would fail to find the 'dart' when run from PATH
Commit(s) to merge
https://dart-review.googlesource.com/c/sdk/+/376860 https://dart-review.googlesource.com/c/sdk/+/377542
Target
stable
Prepared changelist for beta/stable
https://dart-review.googlesource.com/c/sdk/+/381041
Issue Description
dart build was exiting with an error stating that the dart executable could not be found and dart devtools was throwing an exception when run from PATH.
What is the fix
Use the resolved SDK path determined by DartDev for locating snapshots to locate the path of the dart executable rather than relying solely on Platform.executable.
Why cherry-pick
This is impacting users of dart devtools as it is completely unusable when running dart from PATH, which is a common workflow.
Risk
Low
Issue link(s)
https://github.com/dart-lang/sdk/issues/56080, https://github.com/dart-lang/sdk/issues/56306, https://github.com/dart-lang/sdk/issues/56499
Extra Info
No response
Summary: The dart build command and dart devtools were failing when run from the PATH environment variable because they couldn't locate the dart executable. The fix involves using the resolved SDK path determined by DartDev to find the dart executable instead of relying solely on Platform.executable.
lgtm
Landed, but not released yet.