Skip to content

Commit def9959

Browse files
authored
Rollup merge of rust-lang#102950 - oli-obk:check_miri, r=RalfJung
Enable `x.py check` for miri Now that the miri subtree is working properly, let's add it to x.py check. cc `@rust-lang/miri`
2 parents f732365 + c4b9b65 commit def9959

File tree

4 files changed

+22
-53
lines changed

4 files changed

+22
-53
lines changed

src/bootstrap/check.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -451,14 +451,12 @@ macro_rules! tool_check_step {
451451
}
452452

453453
tool_check_step!(Rustdoc, "src/tools/rustdoc", "src/librustdoc", SourceType::InTree);
454-
// Clippy and Rustfmt are hybrids. They are external tools, but use a git subtree instead
454+
// Clippy, miri and Rustfmt are hybrids. They are external tools, but use a git subtree instead
455455
// of a submodule. Since the SourceType only drives the deny-warnings
456456
// behavior, treat it as in-tree so that any new warnings in clippy will be
457457
// rejected.
458458
tool_check_step!(Clippy, "src/tools/clippy", SourceType::InTree);
459-
// Miri on the other hand is treated as out of tree, since InTree also causes it to
460-
// be run as part of `check`, which can fail on platforms which libffi-sys has no support for.
461-
tool_check_step!(Miri, "src/tools/miri", SourceType::Submodule);
459+
tool_check_step!(Miri, "src/tools/miri", SourceType::InTree);
462460
tool_check_step!(Rls, "src/tools/rls", SourceType::InTree);
463461
tool_check_step!(Rustfmt, "src/tools/rustfmt", SourceType::InTree);
464462

src/bootstrap/doc.rs

+6-29
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ impl Step for Rustc {
735735
}
736736

737737
macro_rules! tool_doc {
738-
($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?], in_tree = $in_tree:expr $(,)?) => {
738+
($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?] $(,)?) => {
739739
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
740740
pub struct $tool {
741741
target: TargetSelection,
@@ -791,12 +791,6 @@ macro_rules! tool_doc {
791791
t!(fs::create_dir_all(&out_dir));
792792
t!(symlink_dir_force(&builder.config, &out, &out_dir));
793793

794-
let source_type = if $in_tree == true {
795-
SourceType::InTree
796-
} else {
797-
SourceType::Submodule
798-
};
799-
800794
// Build cargo command.
801795
let mut cargo = prepare_tool_cargo(
802796
builder,
@@ -805,7 +799,7 @@ macro_rules! tool_doc {
805799
target,
806800
"doc",
807801
$path,
808-
source_type,
802+
SourceType::InTree,
809803
&[],
810804
);
811805

@@ -821,38 +815,21 @@ macro_rules! tool_doc {
821815
cargo.rustdocflag("--show-type-layout");
822816
cargo.rustdocflag("--generate-link-to-definition");
823817
cargo.rustdocflag("-Zunstable-options");
824-
if $in_tree == true {
825-
builder.run(&mut cargo.into());
826-
} else {
827-
// Allow out-of-tree docs to fail (since the tool might be in a broken state).
828-
if !builder.try_run(&mut cargo.into()) {
829-
builder.info(&format!(
830-
"WARNING: tool {} failed to document; ignoring failure because it is an out-of-tree tool",
831-
stringify!($tool).to_lowercase(),
832-
));
833-
}
834-
}
818+
builder.run(&mut cargo.into());
835819
}
836820
}
837821
}
838822
}
839823

840-
tool_doc!(
841-
Rustdoc,
842-
"rustdoc-tool",
843-
"src/tools/rustdoc",
844-
["rustdoc", "rustdoc-json-types"],
845-
in_tree = true
846-
);
824+
tool_doc!(Rustdoc, "rustdoc-tool", "src/tools/rustdoc", ["rustdoc", "rustdoc-json-types"],);
847825
tool_doc!(
848826
Rustfmt,
849827
"rustfmt-nightly",
850828
"src/tools/rustfmt",
851829
["rustfmt-nightly", "rustfmt-config_proc_macro"],
852-
in_tree = true
853830
);
854-
tool_doc!(Clippy, "clippy", "src/tools/clippy", ["clippy_utils"], in_tree = true);
855-
tool_doc!(Miri, "miri", "src/tools/miri", ["miri"], in_tree = false);
831+
tool_doc!(Clippy, "clippy", "src/tools/clippy", ["clippy_utils"]);
832+
tool_doc!(Miri, "miri", "src/tools/miri", ["miri"]);
856833

857834
#[derive(Ord, PartialOrd, Debug, Copy, Clone, Hash, PartialEq, Eq)]
858835
pub struct ErrorIndex {

src/bootstrap/test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ impl Step for Miri {
503503
host,
504504
"run",
505505
"src/tools/miri/cargo-miri",
506-
SourceType::Submodule,
506+
SourceType::InTree,
507507
&[],
508508
);
509509
cargo.add_rustc_lib_path(builder, compiler);
@@ -550,7 +550,7 @@ impl Step for Miri {
550550
host,
551551
"test",
552552
"src/tools/miri",
553-
SourceType::Submodule,
553+
SourceType::InTree,
554554
&[],
555555
);
556556
cargo.add_rustc_lib_path(builder, compiler);

src/bootstrap/tool.rs

+12-18
Original file line numberDiff line numberDiff line change
@@ -794,10 +794,9 @@ macro_rules! tool_extended {
794794
$($name:ident,
795795
$path:expr,
796796
$tool_name:expr,
797-
stable = $stable:expr,
798-
$(in_tree = $in_tree:expr,)?
799-
$(tool_std = $tool_std:literal,)?
800-
$extra_deps:block;)+) => {
797+
stable = $stable:expr
798+
$(,tool_std = $tool_std:literal)?
799+
;)+) => {
801800
$(
802801
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
803802
pub struct $name {
@@ -839,7 +838,6 @@ macro_rules! tool_extended {
839838

840839
#[allow(unused_mut)]
841840
fn run(mut $sel, $builder: &Builder<'_>) -> Option<PathBuf> {
842-
$extra_deps
843841
$builder.ensure(ToolBuild {
844842
compiler: $sel.compiler,
845843
target: $sel.target,
@@ -848,11 +846,7 @@ macro_rules! tool_extended {
848846
path: $path,
849847
extra_features: $sel.extra_features,
850848
is_optional_tool: true,
851-
source_type: if false $(|| $in_tree)* {
852-
SourceType::InTree
853-
} else {
854-
SourceType::Submodule
855-
},
849+
source_type: SourceType::InTree,
856850
})
857851
}
858852
}
@@ -865,17 +859,17 @@ macro_rules! tool_extended {
865859
// Note: Most submodule updates for tools are handled by bootstrap.py, since they're needed just to
866860
// invoke Cargo to build bootstrap. See the comment there for more details.
867861
tool_extended!((self, builder),
868-
Cargofmt, "src/tools/rustfmt", "cargo-fmt", stable=true, in_tree=true, {};
869-
CargoClippy, "src/tools/clippy", "cargo-clippy", stable=true, in_tree=true, {};
870-
Clippy, "src/tools/clippy", "clippy-driver", stable=true, in_tree=true, {};
871-
Miri, "src/tools/miri", "miri", stable=false, in_tree=true, {};
872-
CargoMiri, "src/tools/miri/cargo-miri", "cargo-miri", stable=false, in_tree=true, {};
862+
Cargofmt, "src/tools/rustfmt", "cargo-fmt", stable=true;
863+
CargoClippy, "src/tools/clippy", "cargo-clippy", stable=true;
864+
Clippy, "src/tools/clippy", "clippy-driver", stable=true;
865+
Miri, "src/tools/miri", "miri", stable=false;
866+
CargoMiri, "src/tools/miri/cargo-miri", "cargo-miri", stable=true;
873867
// FIXME: tool_std is not quite right, we shouldn't allow nightly features.
874868
// But `builder.cargo` doesn't know how to handle ToolBootstrap in stages other than 0,
875869
// and this is close enough for now.
876-
Rls, "src/tools/rls", "rls", stable=true, in_tree=true, tool_std=true, {};
877-
RustDemangler, "src/tools/rust-demangler", "rust-demangler", stable=false, in_tree=true, tool_std=true, {};
878-
Rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, in_tree=true, {};
870+
Rls, "src/tools/rls", "rls", stable=true, tool_std=true;
871+
RustDemangler, "src/tools/rust-demangler", "rust-demangler", stable=false, tool_std=true;
872+
Rustfmt, "src/tools/rustfmt", "rustfmt", stable=true;
879873
);
880874

881875
impl<'a> Builder<'a> {

0 commit comments

Comments
 (0)