about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-01-31 17:44:29 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-01-31 17:44:29 +0000
commitd1024b6560c0b75b1347841d7ccb0dc36e0dffdd (patch)
tree8b84661b5b3355f211580c071926ef83033c73ad
parent572e32b4cd64ddb946a1203652e1aa6d440aa2f5 (diff)
downloadrust-d1024b6560c0b75b1347841d7ccb0dc36e0dffdd.tar.gz
rust-d1024b6560c0b75b1347841d7ccb0dc36e0dffdd.zip
Fix y.rs bench
-rw-r--r--build_system/bench.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/build_system/bench.rs b/build_system/bench.rs
index f48f7bece02..196e2fd9a7d 100644
--- a/build_system/bench.rs
+++ b/build_system/bench.rs
@@ -32,12 +32,14 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
         std::process::exit(1);
     }
 
-    SIMPLE_RAYTRACER_REPO.fetch(dirs);
-    spawn_and_wait(SIMPLE_RAYTRACER.fetch(
-        &bootstrap_host_compiler.cargo,
-        &bootstrap_host_compiler.rustc,
-        dirs,
-    ));
+    if !SIMPLE_RAYTRACER_REPO.source_dir().to_path(dirs).exists() {
+        SIMPLE_RAYTRACER_REPO.fetch(dirs);
+        spawn_and_wait(SIMPLE_RAYTRACER.fetch(
+            &bootstrap_host_compiler.cargo,
+            &bootstrap_host_compiler.rustc,
+            dirs,
+        ));
+    }
 
     eprintln!("[LLVM BUILD] simple-raytracer");
     let build_cmd = SIMPLE_RAYTRACER_LLVM.build(bootstrap_host_compiler, dirs);
@@ -64,17 +66,17 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
     let target_dir = SIMPLE_RAYTRACER.target_dir(dirs);
 
     let clean_cmd = format!(
-        "cargo clean --manifest-path {manifest_path} --target-dir {target_dir}",
+        "RUSTC=rustc cargo clean --manifest-path {manifest_path} --target-dir {target_dir}",
         manifest_path = manifest_path.display(),
         target_dir = target_dir.display(),
     );
     let llvm_build_cmd = format!(
-        "cargo build --manifest-path {manifest_path} --target-dir {target_dir}",
+        "RUSTC=rustc cargo build --manifest-path {manifest_path} --target-dir {target_dir}",
         manifest_path = manifest_path.display(),
         target_dir = target_dir.display(),
     );
     let clif_build_cmd = format!(
-        "{cargo_clif} build --manifest-path {manifest_path} --target-dir {target_dir}",
+        "RUSTC=rustc {cargo_clif} build --manifest-path {manifest_path} --target-dir {target_dir}",
         cargo_clif = cargo_clif.display(),
         manifest_path = manifest_path.display(),
         target_dir = target_dir.display(),