Skip to content

Commit

Permalink
rustbuild: don't require network for vendoring libtest
Browse files Browse the repository at this point in the history
Sadly, we need to copy the [patch] section from the toplevel Cargo.toml
for the --offline mode to properly work

Fixes rust-lang#79218

Signed-off-by: Marc-Antoine Perennou <[email protected]>
  • Loading branch information
Keruspe committed Nov 22, 2020
1 parent fe98231 commit 1939165
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions library/test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ panic_immediate_abort = ["std/panic_immediate_abort"]
profiler = ["std/profiler"]
std_detect_file_io = ["std/std_detect_file_io"]
std_detect_dlsym_getauxval = ["std/std_detect_dlsym_getauxval"]

# We duplicate these from the toplevel to be able to properly use cargo vendor
[patch.crates-io]
rustc-std-workspace-core = { path = '../rustc-std-workspace-core' }
rustc-std-workspace-alloc = { path = '../rustc-std-workspace-alloc' }
rustc-std-workspace-std = { path = '../rustc-std-workspace-std' }
backtrace = { path = "../backtrace" }
2 changes: 1 addition & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ impl Step for Src {
builder.really_copy(&root_lock, &temp_lock);

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

0 comments on commit 1939165

Please sign in to comment.