Skip to content

Commit

Permalink
Inform build scripts of rustc compiler context
Browse files Browse the repository at this point in the history
Fixes #9600.
  • Loading branch information
Jon Gjengset committed Jun 18, 2021
1 parent af6d540 commit 6ee606b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cargo/core/compiler/custom_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ fn build_work(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Job> {
}
}

// Also inform the build script of the rustc compiler context.
cmd.env(
"CARGO_RUSTC_WRAPPER",
bcx.rustc().wrapper.as_deref().unwrap_or(Path::new("")),
);
cmd.env("CARGO_RUSTFLAGS", bcx.rustflags_args(unit).join(" "));

// Gather the set of native dependencies that this package has along with
// some other variables to close over.
//
Expand Down

0 comments on commit 6ee606b

Please sign in to comment.