sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[CP] [ CLI ] Fix issue where 'dart build' would fail to find the 'dart' when run from PATH

Open bkonyi opened this issue 1 year ago • 3 comments
trafficstars

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

bkonyi avatar Aug 16 '24 15:08 bkonyi

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.

dart-github-bot avatar Aug 16 '24 15:08 dart-github-bot

lgtm

a-siva avatar Aug 16 '24 16:08 a-siva

Landed, but not released yet.

athomas avatar Aug 26 '24 18:08 athomas