@@ -4,7 +4,7 @@ use std::path::Path;
4
4
use super :: path:: { Dirs , RelPath } ;
5
5
use super :: prepare:: GitRepo ;
6
6
use super :: rustc_info:: get_file_name;
7
- use super :: utils:: { hyperfine_command, spawn_and_wait} ;
7
+ use super :: utils:: { hyperfine_command, spawn_and_wait, Compiler } ;
8
8
9
9
static SIMPLE_RAYTRACER_REPO : GitRepo = GitRepo :: github (
10
10
"ebobby" ,
@@ -13,11 +13,11 @@ static SIMPLE_RAYTRACER_REPO: GitRepo = GitRepo::github(
13
13
"<none>" ,
14
14
) ;
15
15
16
- pub ( crate ) fn benchmark ( dirs : & Dirs ) {
17
- benchmark_simple_raytracer ( dirs) ;
16
+ pub ( crate ) fn benchmark ( dirs : & Dirs , bootstrap_host_compiler : & Compiler ) {
17
+ benchmark_simple_raytracer ( dirs, bootstrap_host_compiler ) ;
18
18
}
19
19
20
- fn benchmark_simple_raytracer ( dirs : & Dirs ) {
20
+ fn benchmark_simple_raytracer ( dirs : & Dirs , bootstrap_host_compiler : & Compiler ) {
21
21
if std:: process:: Command :: new ( "hyperfine" ) . output ( ) . is_err ( ) {
22
22
eprintln ! ( "Hyperfine not installed" ) ;
23
23
eprintln ! ( "Hint: Try `cargo install hyperfine` to install hyperfine" ) ;
@@ -31,8 +31,9 @@ fn benchmark_simple_raytracer(dirs: &Dirs) {
31
31
let bench_runs = env:: var ( "BENCH_RUNS" ) . unwrap_or_else ( |_| "10" . to_string ( ) ) . parse ( ) . unwrap ( ) ;
32
32
33
33
eprintln ! ( "[BENCH COMPILE] ebobby/simple-raytracer" ) ;
34
- let cargo_clif =
35
- RelPath :: DIST . to_path ( dirs) . join ( get_file_name ( "cargo_clif" , "bin" ) . replace ( '_' , "-" ) ) ;
34
+ let cargo_clif = RelPath :: DIST
35
+ . to_path ( dirs)
36
+ . join ( get_file_name ( & bootstrap_host_compiler. rustc , "cargo_clif" , "bin" ) . replace ( '_' , "-" ) ) ;
36
37
let manifest_path = SIMPLE_RAYTRACER_REPO . source_dir ( ) . to_path ( dirs) . join ( "Cargo.toml" ) ;
37
38
let target_dir = RelPath :: BUILD . join ( "simple_raytracer" ) . to_path ( dirs) ;
38
39
@@ -75,9 +76,18 @@ fn benchmark_simple_raytracer(dirs: &Dirs) {
75
76
bench_runs,
76
77
None ,
77
78
& [
78
- Path :: new ( "." ) . join ( get_file_name ( "raytracer_cg_llvm" , "bin" ) ) . to_str ( ) . unwrap ( ) ,
79
- Path :: new ( "." ) . join ( get_file_name ( "raytracer_cg_clif" , "bin" ) ) . to_str ( ) . unwrap ( ) ,
80
- Path :: new ( "." ) . join ( get_file_name ( "raytracer_cg_clif_opt" , "bin" ) ) . to_str ( ) . unwrap ( ) ,
79
+ Path :: new ( "." )
80
+ . join ( get_file_name ( & bootstrap_host_compiler. rustc , "raytracer_cg_llvm" , "bin" ) )
81
+ . to_str ( )
82
+ . unwrap ( ) ,
83
+ Path :: new ( "." )
84
+ . join ( get_file_name ( & bootstrap_host_compiler. rustc , "raytracer_cg_clif" , "bin" ) )
85
+ . to_str ( )
86
+ . unwrap ( ) ,
87
+ Path :: new ( "." )
88
+ . join ( get_file_name ( & bootstrap_host_compiler. rustc , "raytracer_cg_clif_opt" , "bin" ) )
89
+ . to_str ( )
90
+ . unwrap ( ) ,
81
91
] ,
82
92
) ;
83
93
bench_run. current_dir ( RelPath :: BUILD . to_path ( dirs) ) ;
0 commit comments