Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bkonyi opened this issue Aug 16, 2024 · 3 comments
Assignees
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. cherry-pick-approved Label for approved cherrypick request cherry-pick-review Issue that need cherry pick triage to approve type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@bkonyi
Copy link
Contributor

bkonyi commented Aug 16, 2024

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)

#56080, #56306, #56499

Extra Info

No response

@bkonyi bkonyi added the cherry-pick-review Issue that need cherry pick triage to approve label Aug 16, 2024
@dart-github-bot
Copy link
Collaborator

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 dart-github-bot added area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Aug 16, 2024
@a-siva
Copy link
Contributor

a-siva commented Aug 16, 2024

lgtm

@lrhn lrhn removed the triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. label Aug 16, 2024
@itsjustkevin itsjustkevin added the cherry-pick-approved Label for approved cherrypick request label Aug 22, 2024
copybara-service bot pushed a commit that referenced this issue Aug 22, 2024
… return 'dart'

When running the VM from PATH using 'dart', Platform.executable could report
the process name as 'dart' instead of 'dart.exe'. This change updates dartdev
to handle this case so the checkArtifactExists call doesn't fail to find the
'dart' binary.

Fixes #56306

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

Fixes #56080

Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/377542, https://dart-review.googlesource.com/c/sdk/+/376860
Cherry-pick-request: #56500
Change-Id: Ic30145309a307204d83353759d7b6c5da07faaa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381041
Reviewed-by: Siva Annamalai <[email protected]>
Commit-Queue: Ben Konyi <[email protected]>
Reviewed-by: Derek Xu <[email protected]>
Reviewed-by: Ben Konyi <[email protected]>
@bkonyi bkonyi closed this as completed Aug 22, 2024
@athomas athomas reopened this Aug 26, 2024
@athomas
Copy link
Member

athomas commented Aug 26, 2024

Landed, but not released yet.

@athomas athomas closed this as completed Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. cherry-pick-approved Label for approved cherrypick request cherry-pick-review Issue that need cherry pick triage to approve type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

8 participants