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.
This commit is contained in:
Michael Goulet 2024-04-25 20:07:41 -04:00 committed by GitHub
commit ef5e42af59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -63,7 +63,10 @@ fn main() {
.env("RUSTC", rustc) .env("RUSTC", rustc)
.env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes") .env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes")
.env("CARGO_TARGET_DIR", &target_dir) .env("CARGO_TARGET_DIR", &target_dir)
.env("RUSTC_BOOTSTRAP", "1"); .env("RUSTC_BOOTSTRAP", "1")
// Visual Studio 2022 requires that the LIB env var be set so it can
// find the Windows SDK.
.env("LIB", std::env::var("LIB").unwrap_or_default());
set_host_rpath(&mut cmd); set_host_rpath(&mut cmd);
let status = cmd.status().unwrap(); let status = cmd.status().unwrap();