Skip to content
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

Make Scarb smarter when searching for Cargo binary #1338

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

mkaput
Copy link
Member

@mkaput mkaput commented Jun 4, 2024

This commit borrows the logic for looking for Cargo from Rust Analyzer, via its published ra_ap_toolchain crate.
This change makes Scarb aware of:

  1. The CARGO environment variable
  2. The relatively well-known $CARGO_HOME directory

This should make Scarb succeed to run cargo fetch/build when being run outside the interactive shell
(i.e. without environment set by rustup).
This includes running Scarb from CairoLS that is being run from a desktop application (like VSCode launched from macOS Dock).

This commit borrows the logic for looking for Cargo from Rust Analyzer,
via its published `ra_ap_toolchain` crate.
This change makes Scarb aware of:
1. The `CARGO` environment variable
2. The relatively well-known `$CARGO_HOME` directory

This should make Scarb succeed to run `cargo fetch`/`build`
when being run outside the interactive shell
(i.e. without environment set by `rustup`).
This includes running Scarb from CairoLS that is being run from a
desktop application (like VSCode launched from macOS Dock).

Signed-off-by: Marek Kaput <marek.kaput@swmansion.com>
@mkaput mkaput added this pull request to the merge queue Jun 4, 2024
Merged via the queue into main with commit 43f76f4 Jun 4, 2024
22 checks passed
@mkaput mkaput deleted the mkaput/cargo-sysroot branch June 4, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants