Skip to content

Commit

Permalink
Auto merge of rust-lang#73232 - RalfJung:miri-no-default, r=Mark-Simu…
Browse files Browse the repository at this point in the history
…lacrum

x.py: do not build Miri by default on stable/beta

Fixes rust-lang#73117

Do I need to do anything to make sure Miri is still built by the tools CI builder? Are there other tools that should be off-by-default?

Also, unfortunately the `DEFAULT` associated const has no doc comment, so I have no idea what it does, or why there are semmingly two places where the default build of tools is controlled.
  • Loading branch information
bors committed Jun 14, 2020
2 parents d3d3a14 + 416b010 commit 10326d8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ pub trait Step: 'static + Clone + Debug + PartialEq + Eq + Hash {
/// it's been assembled.
type Output: Clone;

/// Whether this step is run by default as part of its respective phase.
/// `true` here can still be overwritten by `should_run` calling `default_condition`.
const DEFAULT: bool = false;

/// If true, then this rule should be skipped if --target was specified, but --host was not
Expand Down
30 changes: 18 additions & 12 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ macro_rules! tool_extended {
$toolstate:ident,
$path:expr,
$tool_name:expr,
stable = $stable:expr,
$extra_deps:block;)+) => {
$(
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
Expand All @@ -606,17 +607,22 @@ macro_rules! tool_extended {

impl Step for $name {
type Output = Option<PathBuf>;
const DEFAULT: bool = true;
const DEFAULT: bool = true; // Overwritten below
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
run.path($path).default_condition(
builder.config.extended
&& builder.config.tools.as_ref().map_or(true, |tools| {
tools.iter().any(|tool| match tool.as_ref() {
"clippy" => $tool_name == "clippy-driver",
x => $tool_name == x,
&& builder.config.tools.as_ref().map_or(
// By default, on nightly/dev enable all tools, else only
// build stable tools.
$stable || builder.build.unstable_features(),
// If `tools` is set, search list for this tool.
|tools| {
tools.iter().any(|tool| match tool.as_ref() {
"clippy" => $tool_name == "clippy-driver",
x => $tool_name == x,
})
}),
)
Expand Down Expand Up @@ -652,20 +658,20 @@ macro_rules! tool_extended {
// Note: tools need to be also added to `Builder::get_step_descriptions` in `build.rs`
// to make `./x.py build <tool>` work.
tool_extended!((self, builder),
Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", {};
CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", {};
Clippy, clippy, "src/tools/clippy", "clippy-driver", {};
Miri, miri, "src/tools/miri", "miri", {};
CargoMiri, miri, "src/tools/miri/cargo-miri", "cargo-miri", {};
Rls, rls, "src/tools/rls", "rls", {
Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", stable=true, {};
CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", stable=true, {};
Clippy, clippy, "src/tools/clippy", "clippy-driver", stable=true, {};
Miri, miri, "src/tools/miri", "miri", stable=false, {};
CargoMiri, miri, "src/tools/miri/cargo-miri", "cargo-miri", stable=false, {};
Rls, rls, "src/tools/rls", "rls", stable=true, {
builder.ensure(Clippy {
compiler: self.compiler,
target: self.target,
extra_features: Vec::new(),
});
self.extra_features.push("clippy".to_owned());
};
Rustfmt, rustfmt, "src/tools/rustfmt", "rustfmt", {};
Rustfmt, rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, {};
);

impl<'a> Builder<'a> {
Expand Down

0 comments on commit 10326d8

Please sign in to comment.