Remove dependecy to rust-toolset for bootstrap build

This commit is contained in:
eabdullin 2025-09-18 17:43:44 +03:00
parent 99cc26305e
commit a6d5d60d2f
3 changed files with 50 additions and 6 deletions

15
.gitignore vendored
View File

@ -1,2 +1,17 @@
SOURCES/rustc-1.88.0-src.tar.xz
SOURCES/wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz
SOURCES/cargo-1.87.0-aarch64-unknown-linux-gnu.tar.xz
SOURCES/cargo-1.87.0-i686-unknown-linux-gnu.tar.xz
SOURCES/cargo-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
SOURCES/cargo-1.87.0-s390x-unknown-linux-gnu.tar.xz
SOURCES/cargo-1.87.0-x86_64-unknown-linux-gnu.tar.xz
SOURCES/rust-std-1.87.0-aarch64-unknown-linux-gnu.tar.xz
SOURCES/rust-std-1.87.0-i686-unknown-linux-gnu.tar.xz
SOURCES/rust-std-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
SOURCES/rust-std-1.87.0-s390x-unknown-linux-gnu.tar.xz
SOURCES/rust-std-1.87.0-x86_64-unknown-linux-gnu.tar.xz
SOURCES/rustc-1.87.0-aarch64-unknown-linux-gnu.tar.xz
SOURCES/rustc-1.87.0-i686-unknown-linux-gnu.tar.xz
SOURCES/rustc-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
SOURCES/rustc-1.87.0-s390x-unknown-linux-gnu.tar.xz
SOURCES/rustc-1.87.0-x86_64-unknown-linux-gnu.tar.xz

View File

@ -1,2 +1,17 @@
a5772a6462f53ffc71fda030bece8442d1214198 SOURCES/rustc-1.88.0-src.tar.xz
d6330f7ed84d311d1338796af7fd60f011f3a707 SOURCES/wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz
9db2221e1661966bb075c661452db71f27b42c41 SOURCES/cargo-1.87.0-aarch64-unknown-linux-gnu.tar.xz
8a14006ae0e34336304190e8d9411b1061a66da4 SOURCES/cargo-1.87.0-i686-unknown-linux-gnu.tar.xz
be2b004db6f63991a61ef0c7cea9c8c5b97b10cd SOURCES/cargo-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
1ba5567a3aa425b2391682d93917e697076e2081 SOURCES/cargo-1.87.0-s390x-unknown-linux-gnu.tar.xz
eacf8a939ae7a59670e885e23b6e7fe051bf01b5 SOURCES/cargo-1.87.0-x86_64-unknown-linux-gnu.tar.xz
e6cb528be346a3b0ee89cb6dc9d1cf926fa3307e SOURCES/rust-std-1.87.0-aarch64-unknown-linux-gnu.tar.xz
9d34e6af2192af000a2c1c7ea8bb7fbb2cd6bff1 SOURCES/rust-std-1.87.0-i686-unknown-linux-gnu.tar.xz
3beab8917d485941349f3142cc0a539fd89ea81a SOURCES/rust-std-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
d9e6aecdc9ea4bd767b9b4e08b8dddb7188522ab SOURCES/rust-std-1.87.0-s390x-unknown-linux-gnu.tar.xz
30391afc6455cdba697c8d29926a0c83788134c5 SOURCES/rust-std-1.87.0-x86_64-unknown-linux-gnu.tar.xz
65b8fd98bf0881e066de71dfcf1da45ac5d20864 SOURCES/rustc-1.87.0-aarch64-unknown-linux-gnu.tar.xz
b73832be27ac612d0ffb334c4e30e3bba949a563 SOURCES/rustc-1.87.0-i686-unknown-linux-gnu.tar.xz
a64b055a86cf4f853dc589d9ace7ab001ab239e5 SOURCES/rustc-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
2246258130c9a6028fe88c73217b4be50f7236cd SOURCES/rustc-1.87.0-s390x-unknown-linux-gnu.tar.xz
7b35341d333ad5bd2f0b93ad9e8b68b1f137a347 SOURCES/rustc-1.87.0-x86_64-unknown-linux-gnu.tar.xz

View File

@ -99,7 +99,7 @@ ExclusiveArch: %{rust_arches}
# Reduce rustc's own debuginfo and optimizations to conserve 32-bit memory.
# e.g. https://github.com/rust-lang/rust/issues/45854
%global reduced_debuginfo 0
%global reduced_debuginfo 1
%if 0%{?__isa_bits} == 32
%global reduced_debuginfo 1
%endif
@ -385,6 +385,7 @@ BuildRequires: compiler-rt%{?llvm_compat_version}
# https://github.com/rust-lang/rust/pull/101841
Obsoletes: %{name}-analysis < 1.69.0~
%ifnarch %{bootstrap_arches}
# Experimenting with a fine-grained version of %%cargo_vendor_manifest,
# so we can have different bundled provides for each tool subpackage.
%define cargo_tree_manifest(n:m:f:t:) ( \
@ -407,6 +408,7 @@ Obsoletes: %{name}-analysis < 1.69.0~
)
%{?fedora:BuildRequires: cargo-rpm-macros}
%{?rhel:BuildRequires: rust-toolset}
%endif
%description
Rust is a systems programming language that runs blazingly fast, prevents
@ -894,9 +896,7 @@ mkdir -p "%{profraw}"
# We normally use `x.py`, but in this case we invoke the stage 2 compiler and libs
# directly to ensure we use the instrumented compiler.
env LLVM_PROFILE_FILE="%{profraw}/default_%%m_%%p.profraw" \
LD_LIBRARY_PATH=$PWD/build/host/stage2/lib \
RUSTC=$PWD/build/host/stage2/bin/rustc \
cargo build --manifest-path=src/tools/cargo/Cargo.toml
%{__x} --keep-stage=0 --keep-stage=1 build cargo
# Finalize the profile data and clean up the raw files
llvm-profdata merge -o "%{profdata}" "%{profraw}"
rm -r "%{profraw}" build/%{rust_triple}/stage2*/
@ -915,6 +915,7 @@ for triple in %{?all_targets} ; do
%{__x} build --target=$triple std
done
%ifnarch %{bootstrap_arches}
# Collect cargo-vendor.txt for each tool and std
%{cargo_tree_manifest -n rustc -- -p rustc-main -p rustdoc}
%{cargo_tree_manifest -n cargo -m src/tools/cargo}
@ -930,6 +931,8 @@ for triple in %{?all_targets} ; do
esac
done
%endif
%install
%if 0%{?rhel} && 0%{?rhel} <= 9
%{?set_build_flags}
@ -1070,7 +1073,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
%{_libexecdir}/rust-analyzer-proc-macro-srv
%{_mandir}/man1/rustc.1*
%{_mandir}/man1/rustdoc.1*
%ifnarch %{bootstrap_arches}
%license build/manifests/rustc/cargo-vendor.txt
%endif
%license %{_pkgdocdir}/COPYRIGHT.html
%license %{_pkgdocdir}/licenses/
@ -1081,7 +1086,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
%dir %{rustlibdir}/%{rust_triple}/lib
%{rustlibdir}/%{rust_triple}/lib/*.rlib
%{rustlibdir}/%{rust_triple}/lib/*.so
%ifnarch %{bootstrap_arches}
%license build/manifests/std/cargo-vendor.txt
%endif
%license %{_pkgdocdir}/COPYRIGHT-library.html
%global target_files() \
@ -1089,8 +1096,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
%dir %{rustlibdir} \
%dir %{rustlibdir}/%1 \
%dir %{rustlibdir}/%1/lib \
%{rustlibdir}/%1/lib/*.rlib \
%license build/manifests/std-%1/cargo-vendor.txt
%{rustlibdir}/%1/lib/*.rlib
%if %target_enabled i686-pc-windows-gnu
%target_files i686-pc-windows-gnu
@ -1172,7 +1178,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
%{_datadir}/zsh/site-functions/_cargo
%dir %{_datadir}/cargo
%dir %{_datadir}/cargo/registry
%ifnarch %{bootstrap_arches}
%license build/manifests/cargo/cargo-vendor.txt
%endif
%files -n rustfmt
@ -1180,14 +1188,18 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
%{_bindir}/cargo-fmt
%doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md
%license src/tools/rustfmt/LICENSE-{APACHE,MIT}
%ifnarch %{bootstrap_arches}
%license build/manifests/rustfmt/cargo-vendor.txt
%endif
%files analyzer
%{_bindir}/rust-analyzer
%doc src/tools/rust-analyzer/README.md
%license src/tools/rust-analyzer/LICENSE-{APACHE,MIT}
%ifnarch %{bootstrap_arches}
%license build/manifests/rust-analyzer/cargo-vendor.txt
%endif
%files -n clippy
@ -1195,7 +1207,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
%{_bindir}/clippy-driver
%doc src/tools/clippy/{README.md,CHANGELOG.md}
%license src/tools/clippy/LICENSE-{APACHE,MIT}
%ifnarch %{bootstrap_arches}
%license build/manifests/clippy/cargo-vendor.txt
%endif
%files src