|
| 1 | +From 741b3164d874ef95ab40d4aca7536265f84e1155 Mon Sep 17 00:00:00 2001 |
| 2 | +From: onur-ozkan < [email protected]> |
| 3 | +Date: Sun, 8 Sep 2024 20:14:50 +0300 |
| 4 | +Subject: [PATCH 1/3] make dist vendoring configurable |
| 5 | + |
| 6 | +Signed-off-by: onur-ozkan < [email protected]> |
| 7 | +--- |
| 8 | + src/bootstrap/src/core/build_steps/dist.rs | 6 +----- |
| 9 | + src/bootstrap/src/core/config/config.rs | 10 +++++++++- |
| 10 | + 2 files changed, 10 insertions(+), 6 deletions(-) |
| 11 | + |
| 12 | +diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs |
| 13 | +index b0bd18792beb2..294a56b3e976a 100644 |
| 14 | +--- a/src/bootstrap/src/core/build_steps/dist.rs |
| 15 | ++++ b/src/bootstrap/src/core/build_steps/dist.rs |
| 16 | +@@ -1011,11 +1011,7 @@ impl Step for PlainSourceTarball { |
| 17 | + write_git_info(builder.rust_info().info(), plain_dst_src); |
| 18 | + write_git_info(builder.cargo_info.info(), &plain_dst_src.join("./src/tools/cargo")); |
| 19 | + |
| 20 | +- // If we're building from git or tarball sources, we need to vendor |
| 21 | +- // a complete distribution. |
| 22 | +- if builder.rust_info().is_managed_git_subrepository() |
| 23 | +- || builder.rust_info().is_from_tarball() |
| 24 | +- { |
| 25 | ++ if builder.config.dist_vendor { |
| 26 | + // FIXME: This code looks _very_ similar to what we have in `src/core/build_steps/vendor.rs` |
| 27 | + // perhaps it should be removed in favor of making `dist` perform the `vendor` step? |
| 28 | + |
| 29 | +diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs |
| 30 | +index 79c2f73161e48..555a6a7f8bdeb 100644 |
| 31 | +--- a/src/bootstrap/src/core/config/config.rs |
| 32 | ++++ b/src/bootstrap/src/core/config/config.rs |
| 33 | +@@ -308,6 +308,7 @@ pub struct Config { |
| 34 | + pub dist_compression_formats: Option<Vec<String>>, |
| 35 | + pub dist_compression_profile: String, |
| 36 | + pub dist_include_mingw_linker: bool, |
| 37 | ++ pub dist_vendor: bool, |
| 38 | + |
| 39 | + // libstd features |
| 40 | + pub backtrace: bool, // support for RUST_BACKTRACE |
| 41 | +@@ -933,6 +934,7 @@ define_config! { |
| 42 | + compression_formats: Option<Vec<String>> = "compression-formats", |
| 43 | + compression_profile: Option<String> = "compression-profile", |
| 44 | + include_mingw_linker: Option<bool> = "include-mingw-linker", |
| 45 | ++ vendor: Option<bool> = "vendor", |
| 46 | + } |
| 47 | + } |
| 48 | + |
| 49 | +@@ -2028,13 +2030,19 @@ impl Config { |
| 50 | + compression_formats, |
| 51 | + compression_profile, |
| 52 | + include_mingw_linker, |
| 53 | ++ vendor, |
| 54 | + } = dist; |
| 55 | + config.dist_sign_folder = sign_folder.map(PathBuf::from); |
| 56 | + config.dist_upload_addr = upload_addr; |
| 57 | + config.dist_compression_formats = compression_formats; |
| 58 | + set(&mut config.dist_compression_profile, compression_profile); |
| 59 | + set(&mut config.rust_dist_src, src_tarball); |
| 60 | +- set(&mut config.dist_include_mingw_linker, include_mingw_linker) |
| 61 | ++ set(&mut config.dist_include_mingw_linker, include_mingw_linker); |
| 62 | ++ config.dist_vendor = vendor.unwrap_or_else(|| { |
| 63 | ++ // If we're building from git or tarball sources, enable it by default. |
| 64 | ++ config.rust_info.is_managed_git_subrepository() |
| 65 | ++ || config.rust_info.is_from_tarball() |
| 66 | ++ }); |
| 67 | + } |
| 68 | + |
| 69 | + if let Some(r) = rustfmt { |
| 70 | + |
0 commit comments