Skip to content

Commit 3fe1097

Browse files
committed
Auto merge of #3318 - RalfJung:compiletest-rebuilds, r=oli-obk
compiletest: call cargo-miri directly rather than via 'cargo run' Fixes #3297. Thanks to `@bjorn3` for figuring out the cause of this. r? `@oli-obk`
2 parents 40a97ae + fc3bd52 commit 3fe1097

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

tests/compiletest.rs

+7-10
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,15 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
9999
};
100100

101101
if with_dependencies {
102+
// Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary.
103+
// (It's a separate crate, so we don't get an env var from cargo.)
104+
let mut prog = miri_path();
105+
prog.set_file_name("cargo-miri");
106+
config.dependency_builder.program = prog;
107+
let builder_args = ["miri", "run"]; // There is no `cargo miri build` so we just use `cargo miri run`.
108+
config.dependency_builder.args = builder_args.into_iter().map(Into::into).collect();
102109
config.dependencies_crate_manifest_path =
103110
Some(Path::new("test_dependencies").join("Cargo.toml"));
104-
let mut builder_args = vec!["run".into()];
105-
builder_args.extend(flagsplit(&env::var("CARGO_EXTRA_FLAGS").unwrap_or_default()));
106-
builder_args.extend([
107-
"--manifest-path".into(),
108-
"cargo-miri/Cargo.toml".into(),
109-
"--".into(),
110-
"miri".into(),
111-
"run".into(), // There is no `cargo miri build` so we just use `cargo miri run`.
112-
]);
113-
config.dependency_builder.args = builder_args.into_iter().map(Into::into).collect();
114111
// Reset `RUSTFLAGS` to work around <https://github.com/rust-lang/rust/pull/119574#issuecomment-1876878344>.
115112
config.dependency_builder.envs.push(("RUSTFLAGS".into(), None));
116113
}

0 commit comments

Comments
 (0)