split up the bootstrap downloads

This commit is contained in:
Josh Stone 2022-03-17 17:36:25 -07:00
parent 96205271fc
commit 2732633a74
2 changed files with 29 additions and 27 deletions

View File

@ -6,15 +6,17 @@
%{!?channel: %global channel stable}
# To bootstrap from scratch, set the channel and date from src/stage0.json
# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
# e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
# or nightly wants some beta-YYYY-MM-DD
# Note that cargo matches the program version here, not its crate version.
%global bootstrap_rust 1.58.0
%global bootstrap_cargo 1.58.0
%global bootstrap_version 1.58.0
%global bootstrap_channel 1.58.0
%global bootstrap_date 2022-01-13
# Only the specified arches will use bootstrap binaries.
# NOTE: Those binaries used to be uploaded with every new release, but that was
# a waste of lookaside cache space when they're most often unused.
# Run "spectool -g rust.spec" after changing this and then "fedpkg upload" to
# add them to sources. Remember to remove them again after the bootstrap build!
#global bootstrap_arches %%{rust_arches}
# Define a space-separated list of targets to ship rust-std-static-$triple for
@ -144,31 +146,35 @@ end}
for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do
table.insert(bootstrap_arches, arch)
end
local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}"
.."/rust-%{bootstrap_channel}")
local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}")
local channel = rpm.expand("%{bootstrap_channel}")
local target_arch = rpm.expand("%{_target_cpu}")
for i, arch in ipairs(bootstrap_arches) do
i = 100 + i
print(string.format("Source%d: %s-%s.tar.xz\n",
i, base, rust_triple(arch)))
i = 100 + i * 3
local suffix = channel.."-"..rust_triple(arch)
print(string.format("Source%d: %s/cargo-%s.tar.xz\n", i, base, suffix))
print(string.format("Source%d: %s/rustc-%s.tar.xz\n", i+1, base, suffix))
print(string.format("Source%d: %s/rust-std-%s.tar.xz\n", i+2, base, suffix))
if arch == target_arch then
rpm.define("bootstrap_source "..i)
rpm.define("bootstrap_source_cargo "..i)
rpm.define("bootstrap_source_rustc "..i+1)
rpm.define("bootstrap_source_std "..i+2)
rpm.define("bootstrap_suffix "..suffix)
end
end
end}
%endif
%ifarch %{bootstrap_arches}
%global bootstrap_root rust-%{bootstrap_channel}-%{rust_triple}
%global local_rust_root %{_builddir}/%{bootstrap_root}/usr
Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust}
%global local_rust_root %{_builddir}/rust-%{bootstrap_suffix}
Provides: bundled(%{name}-bootstrap) = %{bootstrap_version}
%else
BuildRequires: cargo >= %{bootstrap_cargo}
BuildRequires: cargo >= %{bootstrap_version}
%if 0%{?rhel} && 0%{?rhel} < 8
BuildRequires: %{name} >= %{bootstrap_rust}
BuildRequires: %{name} >= %{bootstrap_version}
BuildConflicts: %{name} > %{version}
%else
BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version})
BuildRequires: (%{name} >= %{bootstrap_version} with %{name} <= %{version})
%endif
%global local_rust_root %{_prefix}
%endif
@ -529,9 +535,13 @@ data to provide information about the Rust standard library.
%prep
%ifarch %{bootstrap_arches}
%setup -q -n %{bootstrap_root} -T -b %{bootstrap_source}
./install.sh --components=cargo,rustc,rust-std-%{rust_triple} \
--prefix=%{local_rust_root} --disable-ldconfig
rm -rf %{local_rust_root}
%setup -q -n cargo-%{bootstrap_suffix} -T -b %{bootstrap_source_cargo}
./install.sh --prefix=%{local_rust_root} --disable-ldconfig
%setup -q -n rustc-%{bootstrap_suffix} -T -b %{bootstrap_source_rustc}
./install.sh --prefix=%{local_rust_root} --disable-ldconfig
%setup -q -n rust-std-%{bootstrap_suffix} -T -b %{bootstrap_source_std}
./install.sh --prefix=%{local_rust_root} --disable-ldconfig
test -f '%{local_rust_root}/bin/cargo'
test -f '%{local_rust_root}/bin/rustc'
%endif

View File

@ -1,8 +0,0 @@
SHA512 (rustc-1.59.0-src.tar.xz) = acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365
SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6
SHA512 (rust-1.58.0-aarch64-unknown-linux-gnu.tar.xz) = 6ab276db164b400953b540f2c0f5884e44a16cb847a157dec1103e09b22e379f77d8561bf360c05f0bf2d085d4b3670b51675ae80aac05732310621bb2d9b597
SHA512 (rust-1.58.0-armv7-unknown-linux-gnueabihf.tar.xz) = c676cc1518e38fc36e62519bb9d4d356be689f9fcdeb56d5722bd3437879dfe9a30340c053ec75bd5b709d83b98faa647c46720df36a00daef1fd7680f4c900f
SHA512 (rust-1.58.0-i686-unknown-linux-gnu.tar.xz) = 23dd0c0a7700acee233e93d779733bb94788edff4a64df62b8e4ac55b58bc640ed72b0cfd9e1b8cfa5190e429ced6b2a6b0a75676c51e72351edb96b44b00e59
SHA512 (rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz) = bd87ed72427102a1ce08e61d74ad8d34fcbde93e30b2597f9db29e49d53337c1d2e9794f2ce0209273b59c6c8be743870657a2da5eb1dc4d238adf2b548d0ce7
SHA512 (rust-1.58.0-s390x-unknown-linux-gnu.tar.xz) = 2bee2fed7d13d9fd5f10bb071ea8b91bff650d223b5e78fa8068fd841e3f757a4358befc26298c5477c2f9a4fe9e2e77c8f5911ed2630f8ff311491fb842fba3
SHA512 (rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz) = 382a1b3ac5874a9e3f162ba06196074df703b0422dac70c9c38dd0770e86b7fbfbf0380ee1b520a6ef92d3f52c865e901d106f5beaf966fa036fba88f7912da9