Skip to content

Commit 0578fb7

Browse files
authored
Rollup merge of #157014 - bjorn3:source_tarball_offline, r=jieyouxu
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). Fixes #156982
2 parents c67006e + b665316 commit 0578fb7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/bootstrap/src/core/build_steps/vendor.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ impl Step for Vendor {
114114
cmd.arg("--sync").arg(sync_arg);
115115
}
116116

117+
// Reuse vendored dependencies when building source tarball for offline support.
118+
if builder.config.vendor {
119+
cmd.arg("--respect-source-config")
120+
.arg("--config")
121+
.arg(builder.src.join(".cargo").join("config.toml"));
122+
}
123+
117124
// Will read the libstd Cargo.toml
118125
// which uses the unstable `public-dependency` feature.
119126
cmd.env("RUSTC_BOOTSTRAP", "1");
@@ -135,6 +142,13 @@ impl Step for Vendor {
135142
cmd.arg("--versioned-dirs");
136143
}
137144

145+
// Reuse vendored dependencies when building source tarball for offline support.
146+
if builder.config.vendor {
147+
cmd.arg("--respect-source-config")
148+
.arg("--config")
149+
.arg(builder.src.join("library").join(".cargo").join("config.toml"));
150+
}
151+
138152
// Will read the libstd Cargo.toml
139153
// which uses the unstable `public-dependency` feature.
140154
cmd.env("RUSTC_BOOTSTRAP", "1");

0 commit comments

Comments
 (0)