Skip to content

Commit 3ba9b13

Browse files
committed
Don't download abi-cafe and simple-raytracer in ./y.rs prepare
Instead download them on the fly
1 parent e24fa2f commit 3ba9b13

File tree

6 files changed

+32
-25
lines changed

6 files changed

+32
-25
lines changed

build_system/abi_cafe.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ use super::prepare::GitRepo;
66
use super::utils::{spawn_and_wait, CargoProject, Compiler};
77
use super::SysrootKind;
88

9-
pub(crate) static ABI_CAFE_REPO: GitRepo =
9+
static ABI_CAFE_REPO: GitRepo =
1010
GitRepo::github("Gankra", "abi-cafe", "4c6dc8c9c687e2b3a760ff2176ce236872b37212", "abi-cafe");
1111

12-
pub(crate) static ABI_CAFE: CargoProject =
13-
CargoProject::new(&ABI_CAFE_REPO.source_dir(), "abi_cafe");
12+
static ABI_CAFE: CargoProject = CargoProject::new(&ABI_CAFE_REPO.source_dir(), "abi_cafe");
1413

1514
pub(crate) fn run(
1615
channel: &str,
@@ -19,6 +18,9 @@ pub(crate) fn run(
1918
cg_clif_dylib: &Path,
2019
bootstrap_host_compiler: &Compiler,
2120
) {
21+
ABI_CAFE_REPO.fetch(dirs);
22+
spawn_and_wait(ABI_CAFE.fetch("cargo", &bootstrap_host_compiler.rustc, dirs));
23+
2224
eprintln!("Building sysroot for abi-cafe");
2325
build_sysroot::build_sysroot(
2426
dirs,

build_system/bench.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ use super::prepare::GitRepo;
77
use super::rustc_info::get_file_name;
88
use super::utils::{hyperfine_command, is_ci, spawn_and_wait, CargoProject, Compiler};
99

10-
pub(crate) static SIMPLE_RAYTRACER_REPO: GitRepo = GitRepo::github(
10+
static SIMPLE_RAYTRACER_REPO: GitRepo = GitRepo::github(
1111
"ebobby",
1212
"simple-raytracer",
1313
"804a7a21b9e673a482797aa289a18ed480e4d813",
1414
"<none>",
1515
);
1616

1717
// Use a separate target dir for the initial LLVM build to reduce unnecessary recompiles
18-
pub(crate) static SIMPLE_RAYTRACER_LLVM: CargoProject =
18+
static SIMPLE_RAYTRACER_LLVM: CargoProject =
1919
CargoProject::new(&SIMPLE_RAYTRACER_REPO.source_dir(), "simple_raytracer_llvm");
2020

21-
pub(crate) static SIMPLE_RAYTRACER: CargoProject =
21+
static SIMPLE_RAYTRACER: CargoProject =
2222
CargoProject::new(&SIMPLE_RAYTRACER_REPO.source_dir(), "simple_raytracer");
2323

2424
pub(crate) fn benchmark(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
@@ -32,6 +32,13 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
3232
std::process::exit(1);
3333
}
3434

35+
SIMPLE_RAYTRACER_REPO.fetch(dirs);
36+
spawn_and_wait(SIMPLE_RAYTRACER.fetch(
37+
&bootstrap_host_compiler.cargo,
38+
&bootstrap_host_compiler.rustc,
39+
dirs,
40+
));
41+
3542
eprintln!("[LLVM BUILD] simple-raytracer");
3643
let build_cmd = SIMPLE_RAYTRACER_LLVM.build(bootstrap_host_compiler, dirs);
3744
spawn_and_wait(build_cmd);

build_system/prepare.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,18 @@ use super::utils::{copy_dir_recursively, git_command, retry_spawn_and_wait, spaw
1111
pub(crate) fn prepare(dirs: &Dirs) {
1212
RelPath::DOWNLOAD.ensure_fresh(dirs);
1313

14-
spawn_and_wait(super::build_backend::CG_CLIF.fetch("cargo", dirs));
14+
spawn_and_wait(super::build_backend::CG_CLIF.fetch("cargo", "rustc", dirs));
1515

1616
prepare_sysroot(dirs);
17-
spawn_and_wait(super::build_sysroot::STANDARD_LIBRARY.fetch("cargo", dirs));
18-
spawn_and_wait(super::tests::LIBCORE_TESTS.fetch("cargo", dirs));
17+
spawn_and_wait(super::build_sysroot::STANDARD_LIBRARY.fetch("cargo", "rustc", dirs));
18+
spawn_and_wait(super::tests::LIBCORE_TESTS.fetch("cargo", "rustc", dirs));
1919

20-
super::abi_cafe::ABI_CAFE_REPO.fetch(dirs);
21-
spawn_and_wait(super::abi_cafe::ABI_CAFE.fetch("cargo", dirs));
2220
super::tests::RAND_REPO.fetch(dirs);
23-
spawn_and_wait(super::tests::RAND.fetch("cargo", dirs));
21+
spawn_and_wait(super::tests::RAND.fetch("cargo", "rustc", dirs));
2422
super::tests::REGEX_REPO.fetch(dirs);
25-
spawn_and_wait(super::tests::REGEX.fetch("cargo", dirs));
23+
spawn_and_wait(super::tests::REGEX.fetch("cargo", "rustc", dirs));
2624
super::tests::PORTABLE_SIMD_REPO.fetch(dirs);
27-
spawn_and_wait(super::tests::PORTABLE_SIMD.fetch("cargo", dirs));
28-
super::bench::SIMPLE_RAYTRACER_REPO.fetch(dirs);
29-
spawn_and_wait(super::bench::SIMPLE_RAYTRACER.fetch("cargo", dirs));
25+
spawn_and_wait(super::tests::PORTABLE_SIMD.fetch("cargo", "rustc", dirs));
3026
}
3127

3228
fn prepare_sysroot(dirs: &Dirs) {
@@ -80,7 +76,7 @@ impl GitRepo {
8076
}
8177
}
8278

83-
fn fetch(&self, dirs: &Dirs) {
79+
pub(crate) fn fetch(&self, dirs: &Dirs) {
8480
match self.url {
8581
GitRepoUrl::Github { user, repo } => {
8682
clone_repo_shallow_github(

build_system/tests.rs

-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use super::bench::SIMPLE_RAYTRACER;
21
use super::build_sysroot::{self, SYSROOT_SRC};
32
use super::config;
43
use super::path::{Dirs, RelPath};
@@ -134,10 +133,6 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
134133
spawn_and_wait(build_cmd);
135134
}
136135
}),
137-
TestCase::custom("test.simple-raytracer", &|runner| {
138-
SIMPLE_RAYTRACER.clean(&runner.dirs);
139-
spawn_and_wait(SIMPLE_RAYTRACER.build(&runner.target_compiler, &runner.dirs));
140-
}),
141136
TestCase::custom("test.libcore", &|runner| {
142137
LIBCORE_TESTS.clean(&runner.dirs);
143138

build_system/utils.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,18 @@ impl CargoProject {
121121
}
122122

123123
#[must_use]
124-
pub(crate) fn fetch(&self, cargo: impl AsRef<Path>, dirs: &Dirs) -> Command {
124+
pub(crate) fn fetch(
125+
&self,
126+
cargo: impl AsRef<Path>,
127+
rustc: impl AsRef<Path>,
128+
dirs: &Dirs,
129+
) -> Command {
125130
let mut cmd = Command::new(cargo.as_ref());
126131

127-
cmd.arg("fetch").arg("--manifest-path").arg(self.manifest_path(dirs));
132+
cmd.env("RUSTC", rustc.as_ref())
133+
.arg("fetch")
134+
.arg("--manifest-path")
135+
.arg(self.manifest_path(dirs));
128136

129137
cmd
130138
}

config.txt

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ aot.issue-72793
4444

4545
testsuite.extended_sysroot
4646
test.rust-random/rand
47-
test.simple-raytracer
4847
test.libcore
4948
test.regex-shootout-regex-dna
5049
test.regex

0 commit comments

Comments
 (0)