]>
Commit | Line | Data |
---|---|---|
2eb30149 | 1 | (rebased to 1.44.1) |
91aaab50 JB |
2 | From 416b010f4087d055febe2d55919f74e261ca8cd6 Mon Sep 17 00:00:00 2001 |
3 | From: Ralf Jung <post@ralfj.de> | |
4 | Date: Thu, 11 Jun 2020 09:25:06 +0200 | |
5 | Subject: [PATCH] x.py: do not build Miri by default | |
6 | ||
7 | --- | |
8 | src/bootstrap/builder.rs | 2 ++ | |
9 | src/bootstrap/tool.rs | 30 ++++++++++++++++++------------ | |
10 | 2 files changed, 20 insertions(+), 12 deletions(-) | |
11 | ||
12 | diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs | |
13 | index ffdd8485181f4..c4f29927cf4a8 100644 | |
14 | --- a/src/bootstrap/builder.rs | |
15 | +++ b/src/bootstrap/builder.rs | |
16 | @@ -52,6 +52,8 @@ pub trait Step: 'static + Clone + Debug + PartialEq + Eq + Hash { | |
17 | /// it's been assembled. | |
18 | type Output: Clone; | |
19 | ||
20 | + /// Whether this step is run by default as part of its respective phase. | |
21 | + /// `true` here can still be overwritten by `should_run` calling `default_condition`. | |
22 | const DEFAULT: bool = false; | |
23 | ||
24 | /// If true, then this rule should be skipped if --target was specified, but --host was not | |
25 | diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs | |
26 | index 6cd9f9029c948..9c95de0a81eae 100644 | |
27 | --- a/src/bootstrap/tool.rs | |
28 | +++ b/src/bootstrap/tool.rs | |
2eb30149 | 29 | @@ -591,6 +591,7 @@ macro_rules! tool_extended { |
91aaab50 JB |
30 | $toolstate:ident, |
31 | $path:expr, | |
32 | $tool_name:expr, | |
33 | + stable = $stable:expr, | |
34 | $extra_deps:block;)+) => { | |
35 | $( | |
36 | #[derive(Debug, Clone, Hash, PartialEq, Eq)] | |
2eb30149 | 37 | @@ -602,17 +603,22 @@ macro_rules! tool_extended { |
91aaab50 JB |
38 | |
39 | impl Step for $name { | |
40 | type Output = Option<PathBuf>; | |
41 | - const DEFAULT: bool = true; | |
42 | + const DEFAULT: bool = true; // Overwritten below | |
43 | const ONLY_HOSTS: bool = true; | |
44 | ||
45 | fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { | |
46 | let builder = run.builder; | |
47 | run.path($path).default_condition( | |
48 | builder.config.extended | |
49 | - && builder.config.tools.as_ref().map_or(true, |tools| { | |
50 | - tools.iter().any(|tool| match tool.as_ref() { | |
51 | - "clippy" => $tool_name == "clippy-driver", | |
52 | - x => $tool_name == x, | |
53 | + && builder.config.tools.as_ref().map_or( | |
54 | + // By default, on nightly/dev enable all tools, else only | |
55 | + // build stable tools. | |
56 | + $stable || builder.build.unstable_features(), | |
57 | + // If `tools` is set, search list for this tool. | |
58 | + |tools| { | |
59 | + tools.iter().any(|tool| match tool.as_ref() { | |
60 | + "clippy" => $tool_name == "clippy-driver", | |
61 | + x => $tool_name == x, | |
62 | }) | |
63 | }), | |
64 | ) | |
2eb30149 JB |
65 | @@ -646,12 +652,12 @@ macro_rules! tool_extended { |
66 | } | |
67 | ||
91aaab50 JB |
68 | tool_extended!((self, builder), |
69 | - Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", {}; | |
70 | - CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", {}; | |
71 | - Clippy, clippy, "src/tools/clippy", "clippy-driver", {}; | |
72 | - Miri, miri, "src/tools/miri", "miri", {}; | |
2eb30149 | 73 | - CargoMiri, miri, "src/tools/miri", "cargo-miri", {}; |
91aaab50 JB |
74 | - Rls, rls, "src/tools/rls", "rls", { |
75 | + Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", stable=true, {}; | |
76 | + CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", stable=true, {}; | |
77 | + Clippy, clippy, "src/tools/clippy", "clippy-driver", stable=true, {}; | |
78 | + Miri, miri, "src/tools/miri", "miri", stable=false, {}; | |
2eb30149 | 79 | + CargoMiri, miri, "src/tools/miri", "cargo-miri", stable=false, {}; |
91aaab50 | 80 | + Rls, rls, "src/tools/rls", "rls", stable=true, { |
2eb30149 | 81 | let clippy = builder.ensure(Clippy { |
91aaab50 JB |
82 | compiler: self.compiler, |
83 | target: self.target, | |
2eb30149 JB |
84 | @@ -661,7 +667,7 @@ tool_extended!((self, builder), |
85 | self.extra_features.push("clippy".to_owned()); | |
86 | } | |
91aaab50 JB |
87 | }; |
88 | - Rustfmt, rustfmt, "src/tools/rustfmt", "rustfmt", {}; | |
89 | + Rustfmt, rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, {}; | |
90 | ); | |
91 | ||
92 | impl<'a> Builder<'a> { |