Propagate parallel_compiler
feature through rustc crates. Turned off feature gives change of builded crates: 238 -> 224.
This commit is contained in:
parent
78fbcca3e1
commit
008fc79dcd
9 changed files with 36 additions and 14 deletions
|
@ -19,3 +19,4 @@ features = ['unprefixed_malloc_on_supported_platforms']
|
||||||
jemalloc = ['tikv-jemalloc-sys']
|
jemalloc = ['tikv-jemalloc-sys']
|
||||||
llvm = ['rustc_driver/llvm']
|
llvm = ['rustc_driver/llvm']
|
||||||
max_level_info = ['rustc_driver/max_level_info']
|
max_level_info = ['rustc_driver/max_level_info']
|
||||||
|
rustc_use_parallel_compiler = ['rustc_driver/rustc_use_parallel_compiler']
|
||||||
|
|
|
@ -9,7 +9,7 @@ doctest = false
|
||||||
[dependencies]
|
[dependencies]
|
||||||
arrayvec = { version = "0.7", default-features = false }
|
arrayvec = { version = "0.7", default-features = false }
|
||||||
ena = "0.14"
|
ena = "0.14"
|
||||||
indexmap = { version = "1.8.0", features = ["rustc-rayon"] }
|
indexmap = { version = "1.8.0" }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
jobserver_crate = { version = "0.1.13", package = "jobserver" }
|
jobserver_crate = { version = "0.1.13", package = "jobserver" }
|
||||||
rustc_serialize = { path = "../rustc_serialize" }
|
rustc_serialize = { path = "../rustc_serialize" }
|
||||||
|
@ -17,8 +17,8 @@ rustc_macros = { path = "../rustc_macros" }
|
||||||
rustc_graphviz = { path = "../rustc_graphviz" }
|
rustc_graphviz = { path = "../rustc_graphviz" }
|
||||||
cfg-if = "0.1.2"
|
cfg-if = "0.1.2"
|
||||||
stable_deref_trait = "1.0.0"
|
stable_deref_trait = "1.0.0"
|
||||||
rayon = { version = "0.3.2", package = "rustc-rayon" }
|
rayon = { version = "0.3.2", package = "rustc-rayon", optional = true }
|
||||||
rayon-core = { version = "0.3.2", package = "rustc-rayon-core" }
|
rayon-core = { version = "0.3.2", package = "rustc-rayon-core", optional = true }
|
||||||
rustc-hash = "1.1.0"
|
rustc-hash = "1.1.0"
|
||||||
smallvec = { version = "1.6.1", features = ["const_generics", "union", "may_dangle"] }
|
smallvec = { version = "1.6.1", features = ["const_generics", "union", "may_dangle"] }
|
||||||
rustc_index = { path = "../rustc_index", package = "rustc_index" }
|
rustc_index = { path = "../rustc_index", package = "rustc_index" }
|
||||||
|
@ -36,3 +36,6 @@ winapi = { version = "0.3", features = ["fileapi", "psapi", "winerror"] }
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
memmap2 = "0.2.1"
|
memmap2 = "0.2.1"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
rustc_use_parallel_compiler = ["indexmap/rustc-rayon", "rayon", "rayon-core"]
|
||||||
|
|
|
@ -39,3 +39,5 @@ winapi = { version = "0.3", features = ["consoleapi", "debugapi", "processenv"]
|
||||||
[features]
|
[features]
|
||||||
llvm = ['rustc_interface/llvm']
|
llvm = ['rustc_interface/llvm']
|
||||||
max_level_info = ['rustc_log/max_level_info']
|
max_level_info = ['rustc_log/max_level_info']
|
||||||
|
rustc_use_parallel_compiler = ['rustc_data_structures/rustc_use_parallel_compiler', 'rustc_interface/rustc_use_parallel_compiler',
|
||||||
|
'rustc_middle/rustc_use_parallel_compiler']
|
||||||
|
|
|
@ -10,8 +10,8 @@ doctest = false
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
libloading = "0.7.1"
|
libloading = "0.7.1"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
rustc-rayon-core = "0.3.2"
|
rustc-rayon-core = { version = "0.3.2", optional = true }
|
||||||
rayon = { version = "0.3.2", package = "rustc-rayon" }
|
rayon = { version = "0.3.2", package = "rustc-rayon", optional = true }
|
||||||
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
|
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
|
||||||
rustc_ast = { path = "../rustc_ast" }
|
rustc_ast = { path = "../rustc_ast" }
|
||||||
rustc_attr = { path = "../rustc_attr" }
|
rustc_attr = { path = "../rustc_attr" }
|
||||||
|
@ -57,3 +57,4 @@ rustc_target = { path = "../rustc_target" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
llvm = ['rustc_codegen_llvm']
|
llvm = ['rustc_codegen_llvm']
|
||||||
|
rustc_use_parallel_compiler = ['rayon', 'rustc-rayon-core', 'rustc_query_impl/rustc_use_parallel_compiler']
|
||||||
|
|
|
@ -12,8 +12,8 @@ bitflags = "1.2.1"
|
||||||
either = "1.5.0"
|
either = "1.5.0"
|
||||||
gsgdt = "0.1.2"
|
gsgdt = "0.1.2"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
rustc-rayon = "0.3.2"
|
rustc-rayon = { version = "0.3.2", optional = true }
|
||||||
rustc-rayon-core = "0.3.2"
|
rustc-rayon-core = { version = "0.3.2", optional = true }
|
||||||
polonius-engine = "0.13.0"
|
polonius-engine = "0.13.0"
|
||||||
rustc_apfloat = { path = "../rustc_apfloat" }
|
rustc_apfloat = { path = "../rustc_apfloat" }
|
||||||
rustc_attr = { path = "../rustc_attr" }
|
rustc_attr = { path = "../rustc_attr" }
|
||||||
|
@ -35,3 +35,6 @@ rustc_session = { path = "../rustc_session" }
|
||||||
rustc_type_ir = { path = "../rustc_type_ir" }
|
rustc_type_ir = { path = "../rustc_type_ir" }
|
||||||
rand = "0.8.4"
|
rand = "0.8.4"
|
||||||
rand_xoshiro = "0.6.0"
|
rand_xoshiro = "0.6.0"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
rustc_use_parallel_compiler = ["rustc-rayon", "rustc-rayon-core"]
|
||||||
|
|
|
@ -8,7 +8,7 @@ doctest = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
measureme = "10.0.0"
|
measureme = "10.0.0"
|
||||||
rustc-rayon-core = "0.3.2"
|
rustc-rayon-core = { version = "0.3.2", optional = true }
|
||||||
rustc_ast = { path = "../rustc_ast" }
|
rustc_ast = { path = "../rustc_ast" }
|
||||||
rustc_data_structures = { path = "../rustc_data_structures" }
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
||||||
rustc_errors = { path = "../rustc_errors" }
|
rustc_errors = { path = "../rustc_errors" }
|
||||||
|
@ -20,3 +20,6 @@ rustc_query_system = { path = "../rustc_query_system" }
|
||||||
rustc_serialize = { path = "../rustc_serialize" }
|
rustc_serialize = { path = "../rustc_serialize" }
|
||||||
rustc_session = { path = "../rustc_session" }
|
rustc_session = { path = "../rustc_session" }
|
||||||
rustc_span = { path = "../rustc_span" }
|
rustc_span = { path = "../rustc_span" }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
rustc_use_parallel_compiler = ["rustc-rayon-core", "rustc_query_system/rustc_use_parallel_compiler"]
|
||||||
|
|
|
@ -9,7 +9,7 @@ doctest = false
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rustc_arena = { path = "../rustc_arena" }
|
rustc_arena = { path = "../rustc_arena" }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
rustc-rayon-core = "0.3.2"
|
rustc-rayon-core = { version = "0.3.2", optional = true }
|
||||||
rustc_ast = { path = "../rustc_ast" }
|
rustc_ast = { path = "../rustc_ast" }
|
||||||
rustc_data_structures = { path = "../rustc_data_structures" }
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
||||||
rustc_errors = { path = "../rustc_errors" }
|
rustc_errors = { path = "../rustc_errors" }
|
||||||
|
@ -23,3 +23,6 @@ rustc_span = { path = "../rustc_span" }
|
||||||
rustc_target = { path = "../rustc_target" }
|
rustc_target = { path = "../rustc_target" }
|
||||||
parking_lot = "0.11"
|
parking_lot = "0.11"
|
||||||
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
|
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
rustc_use_parallel_compiler = ["rustc-rayon-core"]
|
||||||
|
|
|
@ -689,6 +689,8 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetS
|
||||||
}
|
}
|
||||||
|
|
||||||
if builder.config.rustc_parallel {
|
if builder.config.rustc_parallel {
|
||||||
|
// keep in sync with `bootstrap/lib.rs:Build::rustc_features`
|
||||||
|
// `cfg` option for rustc, `features` option for cargo, for conditional compilation
|
||||||
cargo.rustflag("--cfg=parallel_compiler");
|
cargo.rustflag("--cfg=parallel_compiler");
|
||||||
cargo.rustdocflag("--cfg=parallel_compiler");
|
cargo.rustdocflag("--cfg=parallel_compiler");
|
||||||
}
|
}
|
||||||
|
|
|
@ -729,12 +729,16 @@ impl Build {
|
||||||
|
|
||||||
/// Gets the space-separated set of activated features for the compiler.
|
/// Gets the space-separated set of activated features for the compiler.
|
||||||
fn rustc_features(&self, kind: Kind) -> String {
|
fn rustc_features(&self, kind: Kind) -> String {
|
||||||
let mut features = String::new();
|
let mut features = vec![];
|
||||||
if self.config.jemalloc {
|
if self.config.jemalloc {
|
||||||
features.push_str("jemalloc");
|
features.push("jemalloc");
|
||||||
}
|
}
|
||||||
if self.config.llvm_enabled() || kind == Kind::Check {
|
if self.config.llvm_enabled() || kind == Kind::Check {
|
||||||
features.push_str(" llvm");
|
features.push("llvm");
|
||||||
|
}
|
||||||
|
// keep in sync with `bootstrap/compile.rs:rustc_cargo_env`
|
||||||
|
if self.config.rustc_parallel {
|
||||||
|
features.push("rustc_use_parallel_compiler");
|
||||||
}
|
}
|
||||||
|
|
||||||
// If debug logging is on, then we want the default for tracing:
|
// If debug logging is on, then we want the default for tracing:
|
||||||
|
@ -743,10 +747,10 @@ impl Build {
|
||||||
// if its unset, if debug_assertions is on, then debug_logging will also be on
|
// if its unset, if debug_assertions is on, then debug_logging will also be on
|
||||||
// as well as tracing *ignoring* this feature when debug_assertions is on
|
// as well as tracing *ignoring* this feature when debug_assertions is on
|
||||||
if !self.config.rust_debug_logging {
|
if !self.config.rust_debug_logging {
|
||||||
features.push_str(" max_level_info");
|
features.push("max_level_info");
|
||||||
}
|
}
|
||||||
|
|
||||||
features
|
features.join(" ")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Component directory that Cargo will produce output into (e.g.
|
/// Component directory that Cargo will produce output into (e.g.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue