-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upstream fix for network access during build
- Loading branch information
Showing
2 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
From 741b3164d874ef95ab40d4aca7536265f84e1155 Mon Sep 17 00:00:00 2001 | ||
From: onur-ozkan <work@onurozkan.dev> | ||
Date: Sun, 8 Sep 2024 20:14:50 +0300 | ||
Subject: [PATCH 1/3] make dist vendoring configurable | ||
|
||
Signed-off-by: onur-ozkan <work@onurozkan.dev> | ||
--- | ||
src/bootstrap/src/core/build_steps/dist.rs | 6 +----- | ||
src/bootstrap/src/core/config/config.rs | 10 +++++++++- | ||
2 files changed, 10 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs | ||
index b0bd18792beb2..294a56b3e976a 100644 | ||
--- a/src/bootstrap/src/core/build_steps/dist.rs | ||
+++ b/src/bootstrap/src/core/build_steps/dist.rs | ||
@@ -1011,11 +1011,7 @@ impl Step for PlainSourceTarball { | ||
write_git_info(builder.rust_info().info(), plain_dst_src); | ||
write_git_info(builder.cargo_info.info(), &plain_dst_src.join("./src/tools/cargo")); | ||
|
||
- // If we're building from git or tarball sources, we need to vendor | ||
- // a complete distribution. | ||
- if builder.rust_info().is_managed_git_subrepository() | ||
- || builder.rust_info().is_from_tarball() | ||
- { | ||
+ if builder.config.dist_vendor { | ||
// FIXME: This code looks _very_ similar to what we have in `src/core/build_steps/vendor.rs` | ||
// perhaps it should be removed in favor of making `dist` perform the `vendor` step? | ||
|
||
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs | ||
index 79c2f73161e48..555a6a7f8bdeb 100644 | ||
--- a/src/bootstrap/src/core/config/config.rs | ||
+++ b/src/bootstrap/src/core/config/config.rs | ||
@@ -308,6 +308,7 @@ pub struct Config { | ||
pub dist_compression_formats: Option<Vec<String>>, | ||
pub dist_compression_profile: String, | ||
pub dist_include_mingw_linker: bool, | ||
+ pub dist_vendor: bool, | ||
|
||
// libstd features | ||
pub backtrace: bool, // support for RUST_BACKTRACE | ||
@@ -933,6 +934,7 @@ define_config! { | ||
compression_formats: Option<Vec<String>> = "compression-formats", | ||
compression_profile: Option<String> = "compression-profile", | ||
include_mingw_linker: Option<bool> = "include-mingw-linker", | ||
+ vendor: Option<bool> = "vendor", | ||
} | ||
} | ||
|
||
@@ -2028,13 +2030,19 @@ impl Config { | ||
compression_formats, | ||
compression_profile, | ||
include_mingw_linker, | ||
+ vendor, | ||
} = dist; | ||
config.dist_sign_folder = sign_folder.map(PathBuf::from); | ||
config.dist_upload_addr = upload_addr; | ||
config.dist_compression_formats = compression_formats; | ||
set(&mut config.dist_compression_profile, compression_profile); | ||
set(&mut config.rust_dist_src, src_tarball); | ||
- set(&mut config.dist_include_mingw_linker, include_mingw_linker) | ||
+ set(&mut config.dist_include_mingw_linker, include_mingw_linker); | ||
+ config.dist_vendor = vendor.unwrap_or_else(|| { | ||
+ // If we're building from git or tarball sources, enable it by default. | ||
+ config.rust_info.is_managed_git_subrepository() | ||
+ || config.rust_info.is_from_tarball() | ||
+ }); | ||
} | ||
|
||
if let Some(r) = rustfmt { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters