Skip to content

Commit 9ca3e12

Browse files
committed
Ensure everything has a lockfile
1 parent 70ab5be commit 9ca3e12

9 files changed

+1136
-10
lines changed

build_system/build_sysroot.rs

-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ impl SysrootTarget {
155155
}
156156
}
157157

158-
pub(crate) static ORIG_BUILD_SYSROOT: RelPath = RelPath::SOURCE.join("build_sysroot");
159158
pub(crate) static STDLIB_SRC: RelPath = RelPath::BUILD.join("stdlib");
160159
pub(crate) static SYSROOT_RUSTC_VERSION: RelPath = STDLIB_SRC.join("rustc_version");
161160
pub(crate) static STANDARD_LIBRARY: CargoProject =
@@ -277,7 +276,6 @@ fn build_clif_sysroot_for_triple(
277276
build_cmd.arg("--release");
278277
}
279278
build_cmd.arg("--features").arg("compiler-builtins-no-asm backtrace panic-unwind");
280-
build_cmd.arg("--locked");
281279
build_cmd.env("__CARGO_DEFAULT_LIB_METADATA", "cg_clif");
282280
if compiler.triple.contains("apple") {
283281
build_cmd.env("CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO", "packed");

build_system/prepare.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::fs;
33
use std::path::{Path, PathBuf};
44
use std::process::Command;
55

6-
use super::build_sysroot::{ORIG_BUILD_SYSROOT, STDLIB_SRC, SYSROOT_RUSTC_VERSION};
6+
use super::build_sysroot::{STDLIB_SRC, SYSROOT_RUSTC_VERSION};
77
use super::path::{Dirs, RelPath};
88
use super::rustc_info::{get_default_sysroot, get_rustc_version};
99
use super::utils::{
@@ -26,9 +26,6 @@ fn prepare_stdlib(dirs: &Dirs, rustc: &Path) {
2626

2727
apply_patches(dirs, "stdlib", &sysroot_src_orig, &STDLIB_SRC.to_path(dirs));
2828

29-
// FIXME ensure builds error out or update the copy if any of the files copied here change
30-
copy_dir_recursively(&ORIG_BUILD_SYSROOT.to_path(dirs), &STDLIB_SRC.to_path(dirs));
31-
3229
let rustc_version = get_rustc_version(rustc);
3330
fs::write(SYSROOT_RUSTC_VERSION.to_path(dirs), &rustc_version).unwrap();
3431
}
@@ -264,4 +261,12 @@ pub(crate) fn apply_patches(dirs: &Dirs, crate_name: &str, source_dir: &Path, ta
264261
apply_patch_cmd.arg(patch).arg("-q");
265262
spawn_and_wait(apply_patch_cmd);
266263
}
264+
265+
let source_lockfile = RelPath::PATCHES.to_path(dirs).join(format!("{crate_name}-lock.toml"));
266+
let target_lockfile = target_dir.join("Cargo.lock");
267+
if source_lockfile.exists() {
268+
fs::copy(source_lockfile, target_lockfile).unwrap();
269+
} else {
270+
assert!(target_lockfile.exists());
271+
}
267272
}

build_system/utils.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ impl CargoProject {
8181
.arg("--manifest-path")
8282
.arg(self.manifest_path(dirs))
8383
.arg("--target-dir")
84-
.arg(self.target_dir(dirs));
84+
.arg(self.target_dir(dirs))
85+
.arg("--locked");
8586

8687
if dirs.frozen {
8788
cmd.arg("--frozen");

patches/coretests-lock.toml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This file is automatically @generated by Cargo.
2+
# It is not intended for manual editing.
3+
version = 3
4+
5+
[[package]]
6+
name = "coretests"
7+
version = "0.0.0"
8+
dependencies = [
9+
"rand",
10+
"rand_xorshift",
11+
]
12+
13+
[[package]]
14+
name = "rand"
15+
version = "0.8.5"
16+
source = "registry+https://github.com/rust-lang/crates.io-index"
17+
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
18+
dependencies = [
19+
"rand_core",
20+
]
21+
22+
[[package]]
23+
name = "rand_core"
24+
version = "0.6.4"
25+
source = "registry+https://github.com/rust-lang/crates.io-index"
26+
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
27+
28+
[[package]]
29+
name = "rand_xorshift"
30+
version = "0.3.0"
31+
source = "registry+https://github.com/rust-lang/crates.io-index"
32+
checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f"
33+
dependencies = [
34+
"rand_core",
35+
]

patches/portable-simd-lock.toml

+304
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,304 @@
1+
# This file is automatically @generated by Cargo.
2+
# It is not intended for manual editing.
3+
version = 3
4+
5+
[[package]]
6+
name = "autocfg"
7+
version = "1.1.0"
8+
source = "registry+https://github.com/rust-lang/crates.io-index"
9+
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
10+
11+
[[package]]
12+
name = "bitflags"
13+
version = "1.3.2"
14+
source = "registry+https://github.com/rust-lang/crates.io-index"
15+
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
16+
17+
[[package]]
18+
name = "bumpalo"
19+
version = "3.13.0"
20+
source = "registry+https://github.com/rust-lang/crates.io-index"
21+
checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"
22+
23+
[[package]]
24+
name = "byteorder"
25+
version = "1.4.3"
26+
source = "registry+https://github.com/rust-lang/crates.io-index"
27+
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
28+
29+
[[package]]
30+
name = "cfg-if"
31+
version = "1.0.0"
32+
source = "registry+https://github.com/rust-lang/crates.io-index"
33+
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
34+
35+
[[package]]
36+
name = "console_error_panic_hook"
37+
version = "0.1.7"
38+
source = "registry+https://github.com/rust-lang/crates.io-index"
39+
checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"
40+
dependencies = [
41+
"cfg-if",
42+
"wasm-bindgen",
43+
]
44+
45+
[[package]]
46+
name = "core_simd"
47+
version = "0.1.0"
48+
dependencies = [
49+
"proptest",
50+
"std_float",
51+
"test_helpers",
52+
"wasm-bindgen",
53+
"wasm-bindgen-test",
54+
]
55+
56+
[[package]]
57+
name = "js-sys"
58+
version = "0.3.63"
59+
source = "registry+https://github.com/rust-lang/crates.io-index"
60+
checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790"
61+
dependencies = [
62+
"wasm-bindgen",
63+
]
64+
65+
[[package]]
66+
name = "log"
67+
version = "0.4.18"
68+
source = "registry+https://github.com/rust-lang/crates.io-index"
69+
checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de"
70+
71+
[[package]]
72+
name = "num-traits"
73+
version = "0.2.15"
74+
source = "registry+https://github.com/rust-lang/crates.io-index"
75+
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
76+
dependencies = [
77+
"autocfg",
78+
]
79+
80+
[[package]]
81+
name = "once_cell"
82+
version = "1.17.2"
83+
source = "registry+https://github.com/rust-lang/crates.io-index"
84+
checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b"
85+
86+
[[package]]
87+
name = "ppv-lite86"
88+
version = "0.2.17"
89+
source = "registry+https://github.com/rust-lang/crates.io-index"
90+
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
91+
92+
[[package]]
93+
name = "proc-macro2"
94+
version = "1.0.59"
95+
source = "registry+https://github.com/rust-lang/crates.io-index"
96+
checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b"
97+
dependencies = [
98+
"unicode-ident",
99+
]
100+
101+
[[package]]
102+
name = "proptest"
103+
version = "0.10.1"
104+
source = "registry+https://github.com/rust-lang/crates.io-index"
105+
checksum = "12e6c80c1139113c28ee4670dc50cc42915228b51f56a9e407f0ec60f966646f"
106+
dependencies = [
107+
"bitflags",
108+
"byteorder",
109+
"num-traits",
110+
"rand",
111+
"rand_chacha",
112+
"rand_xorshift",
113+
]
114+
115+
[[package]]
116+
name = "quote"
117+
version = "1.0.28"
118+
source = "registry+https://github.com/rust-lang/crates.io-index"
119+
checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488"
120+
dependencies = [
121+
"proc-macro2",
122+
]
123+
124+
[[package]]
125+
name = "rand"
126+
version = "0.7.3"
127+
source = "registry+https://github.com/rust-lang/crates.io-index"
128+
checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
129+
dependencies = [
130+
"rand_chacha",
131+
"rand_core",
132+
"rand_hc",
133+
]
134+
135+
[[package]]
136+
name = "rand_chacha"
137+
version = "0.2.2"
138+
source = "registry+https://github.com/rust-lang/crates.io-index"
139+
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
140+
dependencies = [
141+
"ppv-lite86",
142+
"rand_core",
143+
]
144+
145+
[[package]]
146+
name = "rand_core"
147+
version = "0.5.1"
148+
source = "registry+https://github.com/rust-lang/crates.io-index"
149+
checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
150+
151+
[[package]]
152+
name = "rand_hc"
153+
version = "0.2.0"
154+
source = "registry+https://github.com/rust-lang/crates.io-index"
155+
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
156+
dependencies = [
157+
"rand_core",
158+
]
159+
160+
[[package]]
161+
name = "rand_xorshift"
162+
version = "0.2.0"
163+
source = "registry+https://github.com/rust-lang/crates.io-index"
164+
checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8"
165+
dependencies = [
166+
"rand_core",
167+
]
168+
169+
[[package]]
170+
name = "scoped-tls"
171+
version = "1.0.1"
172+
source = "registry+https://github.com/rust-lang/crates.io-index"
173+
checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
174+
175+
[[package]]
176+
name = "std_float"
177+
version = "0.1.0"
178+
dependencies = [
179+
"core_simd",
180+
]
181+
182+
[[package]]
183+
name = "syn"
184+
version = "2.0.18"
185+
source = "registry+https://github.com/rust-lang/crates.io-index"
186+
checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e"
187+
dependencies = [
188+
"proc-macro2",
189+
"quote",
190+
"unicode-ident",
191+
]
192+
193+
[[package]]
194+
name = "test_helpers"
195+
version = "0.1.0"
196+
dependencies = [
197+
"proptest",
198+
]
199+
200+
[[package]]
201+
name = "unicode-ident"
202+
version = "1.0.9"
203+
source = "registry+https://github.com/rust-lang/crates.io-index"
204+
checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0"
205+
206+
[[package]]
207+
name = "wasm-bindgen"
208+
version = "0.2.86"
209+
source = "registry+https://github.com/rust-lang/crates.io-index"
210+
checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73"
211+
dependencies = [
212+
"cfg-if",
213+
"wasm-bindgen-macro",
214+
]
215+
216+
[[package]]
217+
name = "wasm-bindgen-backend"
218+
version = "0.2.86"
219+
source = "registry+https://github.com/rust-lang/crates.io-index"
220+
checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb"
221+
dependencies = [
222+
"bumpalo",
223+
"log",
224+
"once_cell",
225+
"proc-macro2",
226+
"quote",
227+
"syn",
228+
"wasm-bindgen-shared",
229+
]
230+
231+
[[package]]
232+
name = "wasm-bindgen-futures"
233+
version = "0.4.36"
234+
source = "registry+https://github.com/rust-lang/crates.io-index"
235+
checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e"
236+
dependencies = [
237+
"cfg-if",
238+
"js-sys",
239+
"wasm-bindgen",
240+
"web-sys",
241+
]
242+
243+
[[package]]
244+
name = "wasm-bindgen-macro"
245+
version = "0.2.86"
246+
source = "registry+https://github.com/rust-lang/crates.io-index"
247+
checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258"
248+
dependencies = [
249+
"quote",
250+
"wasm-bindgen-macro-support",
251+
]
252+
253+
[[package]]
254+
name = "wasm-bindgen-macro-support"
255+
version = "0.2.86"
256+
source = "registry+https://github.com/rust-lang/crates.io-index"
257+
checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8"
258+
dependencies = [
259+
"proc-macro2",
260+
"quote",
261+
"syn",
262+
"wasm-bindgen-backend",
263+
"wasm-bindgen-shared",
264+
]
265+
266+
[[package]]
267+
name = "wasm-bindgen-shared"
268+
version = "0.2.86"
269+
source = "registry+https://github.com/rust-lang/crates.io-index"
270+
checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93"
271+
272+
[[package]]
273+
name = "wasm-bindgen-test"
274+
version = "0.3.36"
275+
source = "registry+https://github.com/rust-lang/crates.io-index"
276+
checksum = "c9e636f3a428ff62b3742ebc3c70e254dfe12b8c2b469d688ea59cdd4abcf502"
277+
dependencies = [
278+
"console_error_panic_hook",
279+
"js-sys",
280+
"scoped-tls",
281+
"wasm-bindgen",
282+
"wasm-bindgen-futures",
283+
"wasm-bindgen-test-macro",
284+
]
285+
286+
[[package]]
287+
name = "wasm-bindgen-test-macro"
288+
version = "0.3.36"
289+
source = "registry+https://github.com/rust-lang/crates.io-index"
290+
checksum = "f18c1fad2f7c4958e7bcce014fa212f59a65d5e3721d0f77e6c0b27ede936ba3"
291+
dependencies = [
292+
"proc-macro2",
293+
"quote",
294+
]
295+
296+
[[package]]
297+
name = "web-sys"
298+
version = "0.3.63"
299+
source = "registry+https://github.com/rust-lang/crates.io-index"
300+
checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2"
301+
dependencies = [
302+
"js-sys",
303+
"wasm-bindgen",
304+
]

0 commit comments

Comments
 (0)