@@ -6,6 +6,7 @@ use std::path::{Path, PathBuf};
6
6
7
7
use duct:: cmd;
8
8
use path_macro:: path;
9
+ use shell_words;
9
10
use walkdir:: WalkDir ;
10
11
11
12
use crate :: arg:: Subcommands ;
@@ -229,6 +230,12 @@ impl<'a> MiriRunner<'a> {
229
230
impl MiriRunner < ' _ > {
230
231
fn bench ( & self , benches : & [ String ] ) -> Result < ( ) > {
231
232
// 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
+ } ;
232
239
let benches_dir = path ! ( self . miri_dir / "bench-cargo-miri" ) ;
233
240
let benches = if benches. is_empty ( ) {
234
241
std:: fs:: read_dir ( & benches_dir) ?
@@ -245,9 +252,9 @@ impl MiriRunner<'_> {
245
252
let current_bench_dir = path ! ( benches_dir / bench / "Cargo.toml" ) ;
246
253
let current_bench_dir = current_bench_dir. to_string_lossy ( ) . into_owned ( ) ;
247
254
let toolchain = self . get_toolchain_override ( ) ;
248
- let command =
255
+ let bench_command =
249
256
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 ( ) ?;
251
258
}
252
259
Ok ( ( ) )
253
260
}
@@ -450,7 +457,6 @@ impl MiriRunner<'_> {
450
457
"--path" ,
451
458
path,
452
459
"--force" ,
453
- "--locked" ,
454
460
"--root" ,
455
461
sysroot
456
462
] ,
0 commit comments