Skip to content

Commit ef5e42a

Browse files
Rollup merge of #124378 - dpaoliello:keeplib, r=jieyouxu
Keep the LIB env var in the compiler-builtins test The `tests/run-make/compiler-builtins` test was failing for me with Visual Studio 2022, complaining that it couldn't find `kernel32.lib`. For whatever reason, with VS 2022 we need to keep the `LIB` environment variable when invoking Cargo so that the linker can find the Windows SDK libs.
2 parents 6f5c69e + 29f2e27 commit ef5e42a

File tree

1 file changed

+4
-1
lines changed
  • tests/run-make/compiler-builtins

1 file changed

+4
-1
lines changed

tests/run-make/compiler-builtins/rmake.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ fn main() {
6363
.env("RUSTC", rustc)
6464
.env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes")
6565
.env("CARGO_TARGET_DIR", &target_dir)
66-
.env("RUSTC_BOOTSTRAP", "1");
66+
.env("RUSTC_BOOTSTRAP", "1")
67+
// Visual Studio 2022 requires that the LIB env var be set so it can
68+
// find the Windows SDK.
69+
.env("LIB", std::env::var("LIB").unwrap_or_default());
6770
set_host_rpath(&mut cmd);
6871

6972
let status = cmd.status().unwrap();

0 commit comments

Comments
 (0)