Skip to content

Commit 1939165

Browse files
committed
rustbuild: don't require network for vendoring libtest
Sadly, we need to copy the [patch] section from the toplevel Cargo.toml for the --offline mode to properly work Fixes #79218 Signed-off-by: Marc-Antoine Perennou <[email protected]>
1 parent fe98231 commit 1939165

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

library/test/Cargo.toml

+7
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,10 @@ panic_immediate_abort = ["std/panic_immediate_abort"]
3535
profiler = ["std/profiler"]
3636
std_detect_file_io = ["std/std_detect_file_io"]
3737
std_detect_dlsym_getauxval = ["std/std_detect_dlsym_getauxval"]
38+
39+
# We duplicate these from the toplevel to be able to properly use cargo vendor
40+
[patch.crates-io]
41+
rustc-std-workspace-core = { path = '../rustc-std-workspace-core' }
42+
rustc-std-workspace-alloc = { path = '../rustc-std-workspace-alloc' }
43+
rustc-std-workspace-std = { path = '../rustc-std-workspace-std' }
44+
backtrace = { path = "../backtrace" }

src/bootstrap/dist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ impl Step for Src {
10571057
builder.really_copy(&root_lock, &temp_lock);
10581058

10591059
let mut cmd = Command::new(&builder.initial_cargo);
1060-
cmd.arg("vendor").arg(dst_vendor).current_dir(&dst_libtest);
1060+
cmd.args(&["vendor", "--offline"]).arg(dst_vendor).current_dir(&dst_libtest);
10611061
builder.info("Dist src");
10621062
let _time = timeit(builder);
10631063
builder.run(&mut cmd);

0 commit comments

Comments
 (0)