From 1939165d587a404434d5c2bf239e4aa50d8b5974 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Perennou Date: Fri, 20 Nov 2020 09:40:59 +0100 Subject: [PATCH] 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 --- library/test/Cargo.toml | 7 +++++++ src/bootstrap/dist.rs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/library/test/Cargo.toml b/library/test/Cargo.toml index d5804cc3dd86..43b9e3656411 100644 --- a/library/test/Cargo.toml +++ b/library/test/Cargo.toml @@ -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" } diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 9b77e38a8474..c5d46dcba893 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -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);