Skip to content

Commit 11d0471

Browse files
committed
make dist vendoring configurable
Signed-off-by: onur-ozkan <[email protected]>
1 parent 7b18b3e commit 11d0471

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/bootstrap/src/core/build_steps/dist.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1011,11 +1011,7 @@ impl Step for PlainSourceTarball {
10111011
write_git_info(builder.rust_info().info(), plain_dst_src);
10121012
write_git_info(builder.cargo_info.info(), &plain_dst_src.join("./src/tools/cargo"));
10131013

1014-
// If we're building from git or tarball sources, we need to vendor
1015-
// a complete distribution.
1016-
if builder.rust_info().is_managed_git_subrepository()
1017-
|| builder.rust_info().is_from_tarball()
1018-
{
1014+
if builder.config.dist_vendor {
10191015
builder.require_and_update_all_submodules();
10201016

10211017
// Vendor all Cargo dependencies

src/bootstrap/src/core/config/config.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ pub struct Config {
308308
pub dist_compression_formats: Option<Vec<String>>,
309309
pub dist_compression_profile: String,
310310
pub dist_include_mingw_linker: bool,
311+
pub dist_vendor: bool,
311312

312313
// libstd features
313314
pub backtrace: bool, // support for RUST_BACKTRACE
@@ -933,6 +934,7 @@ define_config! {
933934
compression_formats: Option<Vec<String>> = "compression-formats",
934935
compression_profile: Option<String> = "compression-profile",
935936
include_mingw_linker: Option<bool> = "include-mingw-linker",
937+
vendor: Option<bool> = "vendor",
936938
}
937939
}
938940

@@ -2040,13 +2042,19 @@ impl Config {
20402042
compression_formats,
20412043
compression_profile,
20422044
include_mingw_linker,
2045+
vendor,
20432046
} = dist;
20442047
config.dist_sign_folder = sign_folder.map(PathBuf::from);
20452048
config.dist_upload_addr = upload_addr;
20462049
config.dist_compression_formats = compression_formats;
20472050
set(&mut config.dist_compression_profile, compression_profile);
20482051
set(&mut config.rust_dist_src, src_tarball);
2049-
set(&mut config.dist_include_mingw_linker, include_mingw_linker)
2052+
set(&mut config.dist_include_mingw_linker, include_mingw_linker);
2053+
config.vendor = vendor.unwrap_or_else(|| {
2054+
// If we're building from git or tarball sources, enable it by default.
2055+
config.rust_info.is_managed_git_subrepository()
2056+
|| config.rust_info.is_from_tarball()
2057+
});
20502058
}
20512059

20522060
if let Some(r) = rustfmt {

0 commit comments

Comments
 (0)