]> git.lizzy.rs Git - rust.git/commitdiff
Don't download abi-cafe and simple-raytracer in ./y.rs prepare
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>
Fri, 27 Jan 2023 18:44:19 +0000 (18:44 +0000)
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>
Fri, 27 Jan 2023 18:44:19 +0000 (18:44 +0000)
Instead download them on the fly

build_system/abi_cafe.rs
build_system/bench.rs
build_system/prepare.rs
build_system/tests.rs
build_system/utils.rs
config.txt

index dbee9be04eea6356920bbcde1c97583abb0c9cb7..0da27f529b3ecd730a2f7a0cdfe16c55b04909b1 100644 (file)
@@ -6,11 +6,10 @@
 use super::utils::{spawn_and_wait, CargoProject, Compiler};
 use super::SysrootKind;
 
-pub(crate) static ABI_CAFE_REPO: GitRepo =
+static ABI_CAFE_REPO: GitRepo =
     GitRepo::github("Gankra", "abi-cafe", "4c6dc8c9c687e2b3a760ff2176ce236872b37212", "abi-cafe");
 
-pub(crate) static ABI_CAFE: CargoProject =
-    CargoProject::new(&ABI_CAFE_REPO.source_dir(), "abi_cafe");
+static ABI_CAFE: CargoProject = CargoProject::new(&ABI_CAFE_REPO.source_dir(), "abi_cafe");
 
 pub(crate) fn run(
     channel: &str,
@@ -19,6 +18,9 @@ pub(crate) fn run(
     cg_clif_dylib: &Path,
     bootstrap_host_compiler: &Compiler,
 ) {
+    ABI_CAFE_REPO.fetch(dirs);
+    spawn_and_wait(ABI_CAFE.fetch("cargo", &bootstrap_host_compiler.rustc, dirs));
+
     eprintln!("Building sysroot for abi-cafe");
     build_sysroot::build_sysroot(
         dirs,
index 01d44dafbdd17ac4e2c8b4412ecc695e318c1277..f48f7bece028244d47c1c43098427125805fe2e7 100644 (file)
@@ -7,7 +7,7 @@
 use super::rustc_info::get_file_name;
 use super::utils::{hyperfine_command, is_ci, spawn_and_wait, CargoProject, Compiler};
 
-pub(crate) static SIMPLE_RAYTRACER_REPO: GitRepo = GitRepo::github(
+static SIMPLE_RAYTRACER_REPO: GitRepo = GitRepo::github(
     "ebobby",
     "simple-raytracer",
     "804a7a21b9e673a482797aa289a18ed480e4d813",
 );
 
 // Use a separate target dir for the initial LLVM build to reduce unnecessary recompiles
-pub(crate) static SIMPLE_RAYTRACER_LLVM: CargoProject =
+static SIMPLE_RAYTRACER_LLVM: CargoProject =
     CargoProject::new(&SIMPLE_RAYTRACER_REPO.source_dir(), "simple_raytracer_llvm");
 
-pub(crate) static SIMPLE_RAYTRACER: CargoProject =
+static SIMPLE_RAYTRACER: CargoProject =
     CargoProject::new(&SIMPLE_RAYTRACER_REPO.source_dir(), "simple_raytracer");
 
 pub(crate) fn benchmark(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
@@ -32,6 +32,13 @@ 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,
+    ));
+
     eprintln!("[LLVM BUILD] simple-raytracer");
     let build_cmd = SIMPLE_RAYTRACER_LLVM.build(bootstrap_host_compiler, dirs);
     spawn_and_wait(build_cmd);
index f25a81dc23459f8e93e4204eb32efb2c80df12e8..50b1b7836dee1427e0b2476428032e776b65bf00 100644 (file)
 pub(crate) fn prepare(dirs: &Dirs) {
     RelPath::DOWNLOAD.ensure_fresh(dirs);
 
-    spawn_and_wait(super::build_backend::CG_CLIF.fetch("cargo", dirs));
+    spawn_and_wait(super::build_backend::CG_CLIF.fetch("cargo", "rustc", dirs));
 
     prepare_sysroot(dirs);
-    spawn_and_wait(super::build_sysroot::STANDARD_LIBRARY.fetch("cargo", dirs));
-    spawn_and_wait(super::tests::LIBCORE_TESTS.fetch("cargo", dirs));
+    spawn_and_wait(super::build_sysroot::STANDARD_LIBRARY.fetch("cargo", "rustc", dirs));
+    spawn_and_wait(super::tests::LIBCORE_TESTS.fetch("cargo", "rustc", dirs));
 
-    super::abi_cafe::ABI_CAFE_REPO.fetch(dirs);
-    spawn_and_wait(super::abi_cafe::ABI_CAFE.fetch("cargo", dirs));
     super::tests::RAND_REPO.fetch(dirs);
-    spawn_and_wait(super::tests::RAND.fetch("cargo", dirs));
+    spawn_and_wait(super::tests::RAND.fetch("cargo", "rustc", dirs));
     super::tests::REGEX_REPO.fetch(dirs);
-    spawn_and_wait(super::tests::REGEX.fetch("cargo", dirs));
+    spawn_and_wait(super::tests::REGEX.fetch("cargo", "rustc", dirs));
     super::tests::PORTABLE_SIMD_REPO.fetch(dirs);
-    spawn_and_wait(super::tests::PORTABLE_SIMD.fetch("cargo", dirs));
-    super::bench::SIMPLE_RAYTRACER_REPO.fetch(dirs);
-    spawn_and_wait(super::bench::SIMPLE_RAYTRACER.fetch("cargo", dirs));
+    spawn_and_wait(super::tests::PORTABLE_SIMD.fetch("cargo", "rustc", dirs));
 }
 
 fn prepare_sysroot(dirs: &Dirs) {
@@ -80,7 +76,7 @@ pub(crate) const fn source_dir(&self) -> RelPath {
         }
     }
 
-    fn fetch(&self, dirs: &Dirs) {
+    pub(crate) fn fetch(&self, dirs: &Dirs) {
         match self.url {
             GitRepoUrl::Github { user, repo } => {
                 clone_repo_shallow_github(
index dcfadd737566e20d8a76f0fb8bf393e9b27eb654..e9486888f86a4093bd98bd3d71a79b4c45788a9c 100644 (file)
@@ -1,4 +1,3 @@
-use super::bench::SIMPLE_RAYTRACER;
 use super::build_sysroot::{self, SYSROOT_SRC};
 use super::config;
 use super::path::{Dirs, RelPath};
@@ -134,10 +133,6 @@ const fn jit_bin(config: &'static str, source: &'static str, args: &'static str)
             spawn_and_wait(build_cmd);
         }
     }),
-    TestCase::custom("test.simple-raytracer", &|runner| {
-        SIMPLE_RAYTRACER.clean(&runner.dirs);
-        spawn_and_wait(SIMPLE_RAYTRACER.build(&runner.target_compiler, &runner.dirs));
-    }),
     TestCase::custom("test.libcore", &|runner| {
         LIBCORE_TESTS.clean(&runner.dirs);
 
index da2a94a0a4ff84a3b307c22213e1813fd03ca55f..bdff1abeb279aa763ff710a97c77c26dff651fab 100644 (file)
@@ -121,10 +121,18 @@ fn build_cmd(&self, command: &str, compiler: &Compiler, dirs: &Dirs) -> Command
     }
 
     #[must_use]
-    pub(crate) fn fetch(&self, cargo: impl AsRef<Path>, dirs: &Dirs) -> Command {
+    pub(crate) fn fetch(
+        &self,
+        cargo: impl AsRef<Path>,
+        rustc: impl AsRef<Path>,
+        dirs: &Dirs,
+    ) -> Command {
         let mut cmd = Command::new(cargo.as_ref());
 
-        cmd.arg("fetch").arg("--manifest-path").arg(self.manifest_path(dirs));
+        cmd.env("RUSTC", rustc.as_ref())
+            .arg("fetch")
+            .arg("--manifest-path")
+            .arg(self.manifest_path(dirs));
 
         cmd
     }
index d49cc90791a5d5fb01a81bbf7aeb905405681d55..d6e3924a24d643f7550553874b7eb4d47495f577 100644 (file)
@@ -44,7 +44,6 @@ aot.issue-72793
 
 testsuite.extended_sysroot
 test.rust-random/rand
-test.simple-raytracer
 test.libcore
 test.regex-shootout-regex-dna
 test.regex