Skip to content

Commit 52b6fd9

Browse files
committed
Apply changes from rust-lang#2908
1 parent 5064b70 commit 52b6fd9

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

miri-script/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

miri-script/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ which = "4.4"
1717
walkdir = "2.3"
1818
itertools = "0.10"
1919
path_macro = "1.0"
20+
shell-words = "1.1"

miri-script/src/commands.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::path::{Path, PathBuf};
66

77
use duct::cmd;
88
use path_macro::path;
9+
use shell_words;
910
use walkdir::WalkDir;
1011

1112
use crate::arg::Subcommands;
@@ -229,6 +230,12 @@ impl<'a> MiriRunner<'a> {
229230
impl MiriRunner<'_> {
230231
fn bench(&self, benches: &[String]) -> Result<()> {
231232
// Make sure we have an up-to-date Miri installed
233+
let hyperfine = std::env::var("HYPERFINE");
234+
let hyperfine = hyperfine.as_deref().unwrap_or("hyperfine -w 1 -m 5 --shell=none");
235+
let hyperfine = shell_words::split(hyperfine).unwrap();
236+
let Some((command, args)) = hyperfine.split_first() else {
237+
todo!();
238+
};
232239
let benches_dir = path!(self.miri_dir / "bench-cargo-miri");
233240
let benches = if benches.is_empty() {
234241
std::fs::read_dir(&benches_dir)?
@@ -245,9 +252,9 @@ impl MiriRunner<'_> {
245252
let current_bench_dir = path!(benches_dir / bench / "Cargo.toml");
246253
let current_bench_dir = current_bench_dir.to_string_lossy().into_owned();
247254
let toolchain = self.get_toolchain_override();
248-
let command =
255+
let bench_command =
249256
format!("cargo {} miri run --manifest-path {current_bench_dir}", toolchain);
250-
cmd("hyperfine", ["-w", "1", "-m", "5", "--shell=none", &command]).run()?;
257+
cmd(command, chain!(args, [&bench_command])).run()?;
251258
}
252259
Ok(())
253260
}
@@ -450,7 +457,6 @@ impl MiriRunner<'_> {
450457
"--path",
451458
path,
452459
"--force",
453-
"--locked",
454460
"--root",
455461
sysroot
456462
],

0 commit comments

Comments
 (0)