Skip to content

Commit 718b991

Browse files
committed
upstream fix for network access during build
see rust-lang/rust#130099 from rust-lang/rust#130110
1 parent b310222 commit 718b991

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

no-network.patch

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+

rust.spec

+4-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Source4: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_ru
5353
# Source4-md5: cef3379a5232e29c54ccc07dc9fb8f5d
5454
Source5: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-armv7-unknown-linux-gnueabihf.tar.xz
5555
# Source5-md5: 3b3e9945f3ffdf50226f14a818faf84d
56+
Patch0: no-network.patch
5657
URL: https://www.rust-lang.org/
5758
# for src/compiler-rt
5859
BuildRequires: cmake >= 3.4.3
@@ -332,6 +333,7 @@ Dopełnianie parametrów polecenia cargo w powłoce Zsh.
332333

333334
%prep
334335
%setup -q -n %{rustc_package}
336+
%patch0 -p1
335337

336338
%if %{with bootstrap}
337339
%ifarch %{x8664} x32
@@ -414,7 +416,8 @@ export AR="%{__ar}"
414416
--llvm-root=%{_prefix} \
415417
--release-channel=%{channel} \
416418
--set=llvm.static-libstdcpp=false \
417-
--set=build.optimized-compiler-builtins=false
419+
--set=build.optimized-compiler-builtins=false \
420+
--set dist.vendor=false
418421

419422
export RUST_BACKTRACE=full
420423
%x_py dist --verbose

0 commit comments

Comments
 (0)