Skip to content

Commit 77ff877

Browse files
committed
Copy Cargo.lock over in ./y.sh prepare
This makes it easier for ./x.py to vendor all dependencies
1 parent 6c29f8e commit 77ff877

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

build_system/prepare.rs

+13-8
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ codegen-units = 10000
4747
"#,
4848
)
4949
.unwrap();
50+
51+
let source_lockfile = RelPath::PATCHES.to_path(dirs).join("stdlib-lock.toml");
52+
let target_lockfile = STDLIB_SRC.to_path(dirs).join("Cargo.lock");
53+
fs::copy(source_lockfile, target_lockfile).unwrap();
5054
}
5155

5256
pub(crate) struct GitRepo {
@@ -134,6 +138,15 @@ impl GitRepo {
134138
}
135139
}
136140

141+
let source_lockfile =
142+
RelPath::PATCHES.to_path(dirs).join(format!("{}-lock.toml", self.patch_name));
143+
let target_lockfile = download_dir.join("Cargo.lock");
144+
if source_lockfile.exists() {
145+
fs::copy(source_lockfile, target_lockfile).unwrap();
146+
} else {
147+
assert!(target_lockfile.exists());
148+
}
149+
137150
let actual_hash = format!("{:016x}", hash_dir(&download_dir));
138151
if actual_hash != self.content_hash {
139152
println!(
@@ -285,12 +298,4 @@ pub(crate) fn apply_patches(dirs: &Dirs, crate_name: &str, source_dir: &Path, ta
285298
apply_patch_cmd.arg(patch).arg("-q");
286299
spawn_and_wait(apply_patch_cmd);
287300
}
288-
289-
let source_lockfile = RelPath::PATCHES.to_path(dirs).join(format!("{crate_name}-lock.toml"));
290-
let target_lockfile = target_dir.join("Cargo.lock");
291-
if source_lockfile.exists() {
292-
fs::copy(source_lockfile, target_lockfile).unwrap();
293-
} else {
294-
assert!(target_lockfile.exists());
295-
}
296301
}

build_system/tests.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub(crate) static RAND_REPO: GitRepo = GitRepo::github(
100100
"rust-random",
101101
"rand",
102102
"50b9a447410860af8d6db9a208c3576886955874",
103-
"98b2276210b30e43",
103+
"446203b96054891e",
104104
"rand",
105105
);
106106

@@ -110,7 +110,7 @@ pub(crate) static REGEX_REPO: GitRepo = GitRepo::github(
110110
"rust-lang",
111111
"regex",
112112
"32fed9429eafba0ae92a64b01796a0c5a75b88c8",
113-
"d6af6507d565aa66",
113+
"fcc4df7c5b902633",
114114
"regex",
115115
);
116116

@@ -120,7 +120,7 @@ pub(crate) static PORTABLE_SIMD_REPO: GitRepo = GitRepo::github(
120120
"rust-lang",
121121
"portable-simd",
122122
"ad8afa8c81273b3b49acbea38cd3bcf17a34cf2b",
123-
"1ba291009510070b",
123+
"800548f8000e31bd",
124124
"portable-simd",
125125
);
126126

@@ -156,6 +156,10 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
156156
&LIBCORE_TESTS_SRC.to_path(&runner.dirs),
157157
);
158158

159+
let source_lockfile = RelPath::PATCHES.to_path(&runner.dirs).join("coretests-lock.toml");
160+
let target_lockfile = LIBCORE_TESTS_SRC.to_path(&runner.dirs).join("Cargo.lock");
161+
fs::copy(source_lockfile, target_lockfile).unwrap();
162+
159163
LIBCORE_TESTS.clean(&runner.dirs);
160164

161165
if runner.is_native {

0 commit comments

Comments
 (0)