Skip to content

Commit a989f67

Browse files
committed
Only pass --frozen to cargo when it is passed to y.rs
1 parent 8b86a80 commit a989f67

File tree

6 files changed

+16
-32
lines changed

6 files changed

+16
-32
lines changed

build_system/abi_cafe.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ pub(crate) fn run(
1919
bootstrap_host_compiler: &Compiler,
2020
) {
2121
ABI_CAFE_REPO.fetch(dirs);
22-
spawn_and_wait(ABI_CAFE.fetch("cargo", &bootstrap_host_compiler.rustc, dirs));
2322

2423
eprintln!("Building sysroot for abi-cafe");
2524
build_sysroot::build_sysroot(

build_system/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ pub(crate) fn main() {
7878
let mut channel = "release";
7979
let mut sysroot_kind = SysrootKind::Clif;
8080
let mut use_unstable_features = true;
81+
let mut frozen = false;
8182
while let Some(arg) = args.next().as_deref() {
8283
match arg {
8384
"--out-dir" => {
@@ -96,6 +97,7 @@ pub(crate) fn main() {
9697
}
9798
}
9899
"--no-unstable-features" => use_unstable_features = false,
100+
"--frozen" => frozen = true,
99101
flag if flag.starts_with("-") => arg_error!("Unknown flag {}", flag),
100102
arg => arg_error!("Unexpected argument {}", arg),
101103
}
@@ -132,6 +134,7 @@ pub(crate) fn main() {
132134
download_dir: out_dir.join("download"),
133135
build_dir: out_dir.join("build"),
134136
dist_dir: out_dir.join("dist"),
137+
frozen,
135138
};
136139

137140
path::RelPath::BUILD.ensure_exists(&dirs);

build_system/path.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub(crate) struct Dirs {
99
pub(crate) download_dir: PathBuf,
1010
pub(crate) build_dir: PathBuf,
1111
pub(crate) dist_dir: PathBuf,
12+
pub(crate) frozen: bool,
1213
}
1314

1415
#[doc(hidden)]

build_system/prepare.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,12 @@ use super::utils::{copy_dir_recursively, git_command, retry_spawn_and_wait, spaw
1212
pub(crate) fn prepare(dirs: &Dirs) {
1313
RelPath::DOWNLOAD.ensure_fresh(dirs);
1414

15-
spawn_and_wait(super::build_backend::CG_CLIF.fetch("cargo", "rustc", dirs));
16-
1715
prepare_stdlib(dirs);
18-
spawn_and_wait(super::build_sysroot::STANDARD_LIBRARY.fetch("cargo", "rustc", dirs));
19-
2016
prepare_coretests(dirs);
21-
spawn_and_wait(super::tests::LIBCORE_TESTS.fetch("cargo", "rustc", dirs));
2217

2318
super::tests::RAND_REPO.fetch(dirs);
24-
spawn_and_wait(super::tests::RAND.fetch("cargo", "rustc", dirs));
2519
super::tests::REGEX_REPO.fetch(dirs);
26-
spawn_and_wait(super::tests::REGEX.fetch("cargo", "rustc", dirs));
2720
super::tests::PORTABLE_SIMD_REPO.fetch(dirs);
28-
spawn_and_wait(super::tests::PORTABLE_SIMD.fetch("cargo", "rustc", dirs));
2921
}
3022

3123
fn prepare_stdlib(dirs: &Dirs) {

build_system/usage.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ The build system of cg_clif.
22

33
USAGE:
44
./y.rs prepare [--out-dir DIR]
5-
./y.rs build [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features]
6-
./y.rs test [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features]
7-
./y.rs abi-cafe [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features]
8-
./y.rs bench [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features]
5+
./y.rs build [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features] [--frozen]
6+
./y.rs test [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features] [--frozen]
7+
./y.rs abi-cafe [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features] [--frozen]
8+
./y.rs bench [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features] [--frozen]
99

1010
OPTIONS:
1111
--debug
@@ -26,6 +26,9 @@ OPTIONS:
2626
Some features are not yet ready for production usage. This option will disable these
2727
features. This includes the JIT mode and inline assembly support.
2828

29+
--frozen
30+
Require Cargo.lock and cache are up to date
31+
2932
REQUIREMENTS:
3033
* Rustup: The build system has a hard coded dependency on rustup to install the right nightly
3134
version and make sure it is used where necessary.

build_system/utils.rs

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ impl CargoProject {
8181
.arg("--manifest-path")
8282
.arg(self.manifest_path(dirs))
8383
.arg("--target-dir")
84-
.arg(self.target_dir(dirs))
85-
.arg("--frozen");
84+
.arg(self.target_dir(dirs));
85+
86+
if dirs.frozen {
87+
cmd.arg("--frozen");
88+
}
8689

8790
cmd
8891
}
@@ -107,23 +110,6 @@ impl CargoProject {
107110
cmd
108111
}
109112

110-
#[must_use]
111-
pub(crate) fn fetch(
112-
&self,
113-
cargo: impl AsRef<Path>,
114-
rustc: impl AsRef<Path>,
115-
dirs: &Dirs,
116-
) -> Command {
117-
let mut cmd = Command::new(cargo.as_ref());
118-
119-
cmd.env("RUSTC", rustc.as_ref())
120-
.arg("fetch")
121-
.arg("--manifest-path")
122-
.arg(self.manifest_path(dirs));
123-
124-
cmd
125-
}
126-
127113
pub(crate) fn clean(&self, dirs: &Dirs) {
128114
let _ = fs::remove_dir_all(self.target_dir(dirs));
129115
}

0 commit comments

Comments
 (0)