Skip to content

Commit

Permalink
Auto merge of #3318 - RalfJung:compiletest-rebuilds, r=oli-obk
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
bors committed Feb 24, 2024
2 parents 40a97ae + fc3bd52 commit 3fe1097
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,15 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
};

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

0 comments on commit 3fe1097

Please sign in to comment.