From b665316530342625ebc57d4c7137770c2625da84 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Wed, 27 May 2026 12:08:59 +0200 Subject: [PATCH] Allow building the source tarballs while offline Previously locally vendored dependencies wouldn't be reused when building the source tarball, instead everything would be downloaded from the internet again (if not in the cargo cache). --- src/bootstrap/src/core/build_steps/vendor.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/vendor.rs b/src/bootstrap/src/core/build_steps/vendor.rs index 246598550553a..17bee20a525b6 100644 --- src/bootstrap/src/core/build_steps/vendor.rs +++ src/bootstrap/src/core/build_steps/vendor.rs @@ -114,6 +114,13 @@ impl Step for Vendor { cmd.arg("--sync").arg(sync_arg); } + // Reuse vendored dependencies when building source tarball for offline support. + if builder.config.vendor { + cmd.arg("--respect-source-config") + .arg("--config") + .arg(builder.src.join(".cargo").join("config.toml")); + } + // Will read the libstd Cargo.toml // which uses the unstable `public-dependency` feature. cmd.env("RUSTC_BOOTSTRAP", "1"); @@ -135,6 +142,13 @@ impl Step for Vendor { cmd.arg("--versioned-dirs"); } + // Reuse vendored dependencies when building source tarball for offline support. + if builder.config.vendor { + cmd.arg("--respect-source-config") + .arg("--config") + .arg(builder.src.join("library").join(".cargo").join("config.toml")); + } + // Will read the libstd Cargo.toml // which uses the unstable `public-dependency` feature. cmd.env("RUSTC_BOOTSTRAP", "1");