Avoid building C++ for rustc_llvm with --compile-time-deps

This saves about 30s.
This commit is contained in:
bjorn3
2025-07-11 13:32:03 +00:00
parent 3fe3edbcde
commit 87958ad683
7 changed files with 17 additions and 0 deletions
+1
View File
@@ -27,6 +27,7 @@ features = ['unprefixed_malloc_on_supported_platforms']
[features]
# tidy-alphabetical-start
check_only = ['rustc_driver_impl/check_only']
jemalloc = ['dep:tikv-jemalloc-sys']
llvm = ['rustc_driver_impl/llvm']
max_level_info = ['rustc_driver_impl/max_level_info']
+3
View File
@@ -43,3 +43,6 @@ serde_json = "1"
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing = "0.1"
# tidy-alphabetical-end
[features]
check_only = ["rustc_llvm/check_only"]
+1
View File
@@ -72,6 +72,7 @@ ctrlc = "3.4.4"
[features]
# tidy-alphabetical-start
check_only = ['rustc_interface/check_only']
llvm = ['rustc_interface/llvm']
max_level_info = ['rustc_log/max_level_info']
rustc_randomized_layouts = [
+1
View File
@@ -56,5 +56,6 @@ rustc_abi = { path = "../rustc_abi" }
[features]
# tidy-alphabetical-start
check_only = ['rustc_codegen_llvm?/check_only']
llvm = ['dep:rustc_codegen_llvm']
# tidy-alphabetical-end
+4
View File
@@ -14,3 +14,7 @@ libc = "0.2.73"
# pinned `cc` in `rustc_codegen_ssa` if you update `cc` here.
cc = "=1.2.16"
# tidy-alphabetical-end
[features]
# Used by ./x.py check --compile-time-deps to skip building C++ code
check_only = []
+4
View File
@@ -106,6 +106,10 @@ fn output(cmd: &mut Command) -> String {
}
fn main() {
if cfg!(feature = "check_only") {
return;
}
for component in REQUIRED_COMPONENTS.iter().chain(OPTIONAL_COMPONENTS.iter()) {
println!("cargo:rustc-check-cfg=cfg(llvm_component,values(\"{component}\"))");
}
+3
View File
@@ -775,6 +775,9 @@ fn rustc_features(&self, kind: Kind, target: TargetSelection, crates: &[String])
if self.config.rust_randomize_layout && check("rustc_randomized_layouts") {
features.push("rustc_randomized_layouts");
}
if self.config.compile_time_deps && kind == Kind::Check {
features.push("check_only");
}
// If debug logging is on, then we want the default for tracing:
// https://github.com/tokio-rs/tracing/blob/3dd5c03d907afdf2c39444a29931833335171554/tracing/src/level_filters.rs#L26