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

Propagate CARGO environment variable to nested cargo invocations #1766

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions collector/src/compile/execute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ impl<'a> CargoProcess<'a> {
// env vars set, but it doesn't hurt to have them.
.env("RUSTC", &*FAKE_RUSTC)
.env("RUSTC_REAL", &self.toolchain.components.rustc)
// If the collector is being run with e.g. `cargo run --bin collector`,
// then the CARGO environment variable will be incorrectly propagated to nested cargo
// invocations (e.g. in the `cargo llvm-lines` profiler). This environment variable
// makes sure that we override the path to Cargo with the specified cargo component.
.env("CARGO", &self.toolchain.components.cargo)
// We separately pass -Cincremental to the leaf crate --
// CARGO_INCREMENTAL is cached separately for both the leaf crate
// and any in-tree dependencies, and we don't want that; it wastes
Expand Down
Loading