Skip to content

Commit e040ab9

Browse files
committed
compile_codegen: SpirvBuilder: remove RUSTC env var before calling cargo
1 parent dcbdc52 commit e040ab9

File tree

1 file changed

+6
-0
lines changed
  • crates/spirv-builder/src

1 file changed

+6
-0
lines changed

crates/spirv-builder/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,12 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result<PathBuf, SpirvBuilderError> {
999999
// so we turn off that caching with an env var, just to avoid any issues.
10001000
cargo.env("CARGO_CACHE_RUSTC_INFO", "0");
10011001

1002+
// NOTE(firestar99) If you call SpirvBuilder in a build script, it will
1003+
// set `RUSTC` before calling it. And if we were to propagate it to our
1004+
// cargo invocation, it will take precedence over the `+toolchain` we
1005+
// previously set.
1006+
cargo.env_remove("RUSTC");
1007+
10021008
// NOTE(eddyb) this used to be just `RUSTFLAGS` but at some point Cargo
10031009
// added a separate environment variable using `\x1f` instead of spaces,
10041010
// which allows us to have spaces within individual `rustc` flags.

0 commit comments

Comments
 (0)