Merge pull request #20159 from Veykril/push-kyssnlrxlwsl

Always couple `--compile-time-deps` with
This commit is contained in:
Lukas Wirth 2025-07-03 11:03:36 +00:00 committed by GitHub
commit 292ab7cf95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -409,13 +409,6 @@ impl WorkspaceBuildScripts {
cmd.arg("--target-dir").arg(target_dir); cmd.arg("--target-dir").arg(target_dir);
} }
// --all-targets includes tests, benches and examples in addition to the
// default lib and bins. This is an independent concept from the --target
// flag below.
if config.all_targets {
cmd.arg("--all-targets");
}
if let Some(target) = &config.target { if let Some(target) = &config.target {
cmd.args(["--target", target]); cmd.args(["--target", target]);
} }
@ -463,7 +456,18 @@ impl WorkspaceBuildScripts {
cmd.env("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS", "nightly"); cmd.env("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS", "nightly");
cmd.arg("-Zunstable-options"); cmd.arg("-Zunstable-options");
cmd.arg("--compile-time-deps"); cmd.arg("--compile-time-deps");
} else if config.wrap_rustc_in_build_scripts { // we can pass this unconditionally, because we won't actually build the
// binaries, and as such, this will succeed even on targets without libtest
cmd.arg("--all-targets");
} else {
// --all-targets includes tests, benches and examples in addition to the
// default lib and bins. This is an independent concept from the --target
// flag below.
if config.all_targets {
cmd.arg("--all-targets");
}
if config.wrap_rustc_in_build_scripts {
// Setup RUSTC_WRAPPER to point to `rust-analyzer` binary itself. We use // Setup RUSTC_WRAPPER to point to `rust-analyzer` binary itself. We use
// that to compile only proc macros and build scripts during the initial // that to compile only proc macros and build scripts during the initial
// `cargo check`. // `cargo check`.
@ -472,6 +476,7 @@ impl WorkspaceBuildScripts {
cmd.env("RUSTC_WRAPPER", myself); cmd.env("RUSTC_WRAPPER", myself);
cmd.env("RA_RUSTC_WRAPPER", "1"); cmd.env("RA_RUSTC_WRAPPER", "1");
} }
}
Ok(cmd) Ok(cmd)
} }
} }