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

Invoke the rust compiler for the appropriate tool chain #4

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

dtolnay
Copy link
Contributor

@dtolnay dtolnay commented Oct 14, 2024

Description

When a RUSTC_WRAPPER is set, Cargo passes in its first argument a path to the right rustc executable it wants the wrapper to delegate to. See Environment variables Cargo reads. "Instead of simply running rustc, Cargo will execute this specified wrapper, passing as its command-line arguments the rustc invocation, with the first argument being the path to the actual rustc."

For example, RUSTC_WRAPPER=/path/to/mirai cargo +nightly-2023-12-30 check would end up running /path/to/mirai $RUSTUP_HOME/toolchains/nightly-2023-12-30-x86_64-unknown-linux-gnu/bin/rustc --crate-name=whatever --edition=2021 src/lib.rs ...

$RUSTC is in general not set by Cargo when running a subcommand such as cargo-mirai.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • API change with a documentation update
  • Additional test coverage
  • Code cleanup or just keeping up with the latest Rustc nightly

How Has This Been Tested?

In MIRAI: cargo build --release
In another crate: PATH=$PATH:/path/to/mirai/target/release cargo +nightly-2023-12-30 mirai

@hermanventer
Copy link
Collaborator

hermanventer commented Oct 15, 2024 via email

@hermanventer hermanventer merged commit 197430e into endorlabs:main Oct 18, 2024
6 checks passed
@dtolnay dtolnay deleted the rustcwrapper branch October 18, 2024 17:40
@hermanventer hermanventer mentioned this pull request Oct 18, 2024
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.

2 participants