Skip to content

Commit 6ee606b

Browse files
author
Jon Gjengset
committed
Inform build scripts of rustc compiler context
Fixes #9600.
1 parent af6d540 commit 6ee606b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/cargo/core/compiler/custom_build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,13 @@ fn build_work(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Job> {
249249
}
250250
}
251251

252+
// Also inform the build script of the rustc compiler context.
253+
cmd.env(
254+
"CARGO_RUSTC_WRAPPER",
255+
bcx.rustc().wrapper.as_deref().unwrap_or(Path::new("")),
256+
);
257+
cmd.env("CARGO_RUSTFLAGS", bcx.rustflags_args(unit).join(" "));
258+
252259
// Gather the set of native dependencies that this package has along with
253260
// some other variables to close over.
254261
//

0 commit comments

Comments
 (0)