diff options
| author | bors <bors@rust-lang.org> | 2025-06-20 06:33:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-06-20 06:33:35 +0000 |
| commit | 18491d5be00eb3ed2f1ccee2ac5b792694f2a7a0 (patch) | |
| tree | 9ca33384b8e5742ebff698018fc772d61f2a1e6d /src/bootstrap | |
| parent | 5b74275f89b6041bf2e9dc2abcf332e206d4cfca (diff) | |
| parent | 723dae84c18f512bfc4bbc65c51465d2dea14c03 (diff) | |
| download | rust-18491d5be00eb3ed2f1ccee2ac5b792694f2a7a0.tar.gz rust-18491d5be00eb3ed2f1ccee2ac5b792694f2a7a0.zip | |
Auto merge of #142286 - Kobzol:clippy-jemalloc, r=flip1995,blyxyas
Use jemalloc for Clippy The tool macros are annoying, we should IMO just get rid of them, create separate steps for each tool and (re)use some builders in them to share the build code. r? `@ghost`
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/tool.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index 0088e851d39..53a5c6b282f 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs @@ -1129,6 +1129,7 @@ macro_rules! tool_extended { tool_name: $tool_name:expr, stable: $stable:expr $( , add_bins_to_sysroot: $add_bins_to_sysroot:expr )? + $( , add_features: $add_features:expr )? $( , )? } ) => { @@ -1168,6 +1169,7 @@ macro_rules! tool_extended { $tool_name, $path, None $( .or(Some(&$add_bins_to_sysroot)) )?, + None $( .or(Some($add_features)) )?, ) } } @@ -1205,7 +1207,13 @@ fn run_tool_build_step( tool_name: &'static str, path: &'static str, add_bins_to_sysroot: Option<&[&str]>, + add_features: Option<fn(&Builder<'_>, TargetSelection, &mut Vec<String>)>, ) -> ToolBuildResult { + let mut extra_features = Vec::new(); + if let Some(func) = add_features { + func(builder, target, &mut extra_features); + } + let ToolBuildResult { tool_path, build_compiler, target_compiler } = builder.ensure(ToolBuild { compiler, @@ -1213,7 +1221,7 @@ fn run_tool_build_step( tool: tool_name, mode: Mode::ToolRustc, path, - extra_features: vec![], + extra_features, source_type: SourceType::InTree, allow_features: "", cargo_args: vec![], @@ -1256,7 +1264,12 @@ tool_extended!(Clippy { path: "src/tools/clippy", tool_name: "clippy-driver", stable: true, - add_bins_to_sysroot: ["clippy-driver"] + add_bins_to_sysroot: ["clippy-driver"], + add_features: |builder, target, features| { + if builder.config.jemalloc(target) { + features.push("jemalloc".to_string()); + } + } }); tool_extended!(Miri { path: "src/tools/miri", |
