@@ -1217,10 +1217,10 @@ impl Xtasks {
1217
1217
fn bench ( app_settings : GlobalArgs ) -> Result < ( ) > {
1218
1218
// first of all figure out which branch we're on
1219
1219
// run // git rev-parse --abbrev-ref HEAD
1220
-
1220
+ let workspace_dir = Self :: workspace_dir ( & app_settings ) . unwrap ( ) ;
1221
1221
let command = Command :: new ( "git" )
1222
1222
. args ( [ "rev-parse" , "--abbrev-ref" , "HEAD" ] )
1223
- . current_dir ( Self :: workspace_dir ( & app_settings ) . unwrap ( ) )
1223
+ . current_dir ( workspace_dir. clone ( ) )
1224
1224
. output ( )
1225
1225
. with_context ( || "Trying to figure out which branch we're on in benchmarking" ) ?;
1226
1226
let branch = String :: from_utf8 ( command. stdout ) ?;
@@ -1251,7 +1251,6 @@ impl Xtasks {
1251
1251
bencher_cmd
1252
1252
. stdout ( std:: process:: Stdio :: inherit ( ) )
1253
1253
. stderr ( std:: process:: Stdio :: inherit ( ) )
1254
- . current_dir ( Self :: workspace_dir ( & app_settings) . unwrap ( ) )
1255
1254
. arg ( "run" )
1256
1255
. args ( [ "--project" , "bms" ] )
1257
1256
. args ( [ "--branch" , & format ! ( "\" {branch}\" " ) ] )
@@ -1277,7 +1276,11 @@ impl Xtasks {
1277
1276
. args ( [ "--adapter" , "rust_criterion" ] )
1278
1277
. arg ( "cargo bench --features=lua54" ) ;
1279
1278
1280
- let out = bencher_cmd. output ( ) ?;
1279
+ log:: info!( "Running bencher command: {:?}" , bencher_cmd) ;
1280
+
1281
+ let out = bencher_cmd
1282
+ . output ( )
1283
+ . with_context ( || "Could not trigger bencher command" ) ?;
1281
1284
if !out. status . success ( ) {
1282
1285
bail ! ( "Failed to run bencher: {:?}" , out) ;
1283
1286
}
@@ -1495,6 +1498,25 @@ impl Xtasks {
1495
1498
) ?;
1496
1499
}
1497
1500
1501
+ // install bencher
1502
+ // linux curl --proto '=https' --tlsv1.2 -sSfL https://bencher.dev/download/install-cli.sh | sh
1503
+ // windows irm https://bencher.dev/download/install-cli.ps1 | iex
1504
+ Self :: run_system_command (
1505
+ & app_settings,
1506
+ "cargo" ,
1507
+ "Failed to install bencher" ,
1508
+ vec ! [
1509
+ "install" ,
1510
+ "--git" ,
1511
+ "https://github.com/bencherdev/bencher" ,
1512
+ "--branch" ,
1513
+ "main" ,
1514
+ "--locked" ,
1515
+ "--force" ,
1516
+ "bencher_cli" ,
1517
+ ] ,
1518
+ None ,
1519
+ ) ?;
1498
1520
// install cargo mdbook
1499
1521
Self :: run_system_command (
1500
1522
& app_settings,
0 commit comments