Accepting request 678447 from home:luke_nukem:branches:devel:languages:rust
- Fix bootstrap conditionals - Fix bundled_llvm conditionals - Don't build stage0 if compiler used to build package is the same version as package OBS-URL: https://build.opensuse.org/request/show/678447 OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=182
This commit is contained in:
parent
555d2841ad
commit
816482df4b
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Feb 24 01:52:06 UTC 2019 - Luke Jones <jones_ld@protonmail.com>
|
||||
|
||||
- Fix bootstrap conditionals
|
||||
- Fix bundled_llvm conditionals
|
||||
- Don't build stage0 if compiler used to build package is the
|
||||
same version as package
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Feb 23 01:58:47 UTC 2019 - Luke Jones <jones_ld@protonmail.com>
|
||||
|
||||
|
41
rust.spec
41
rust.spec
@ -52,22 +52,20 @@
|
||||
%global common_libdir %{_prefix}/lib
|
||||
%global rustlibdir %{common_libdir}/rustlib
|
||||
|
||||
# We occasionally need to bootstrap builds due to breakage etc. Rust only guarantees
|
||||
# v-1 will build v
|
||||
%bcond_with rust_bootstrap
|
||||
|
||||
# Distro LLVM should be sufficient, this also cuts compile times byu almost half
|
||||
%if 0%{?suse_version} <= 1315
|
||||
# Distro LLVM should be sufficient, this also cuts compile times by almost half
|
||||
%if 0%{?suse_version} <= 1315 && 0%{?is_opensuse}
|
||||
%bcond_without bundled_llvm
|
||||
%endif
|
||||
%if 0%{?sle_version} < 120400 && 0%{?is_backports}
|
||||
%bcond_without bundled_llvm
|
||||
%else
|
||||
%bcond_with bundled_llvm
|
||||
%endif
|
||||
|
||||
# Debuginfo can exhaust memory on these architecture workers
|
||||
%ifarch %{arm} %{ix86}
|
||||
%define codegen_units --set codegen-units=4
|
||||
%define debug_info --disable-debuginfo --enable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines
|
||||
%define codegen_units --set rust.codegen-units=2
|
||||
%define debug_info --disable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines
|
||||
%else
|
||||
%define codegen_units --set rust.codegen-units=0
|
||||
%define debug_info --enable-debuginfo --disable-debuginfo-only-std --enable-debuginfo-tools --disable-debuginfo-lines
|
||||
%endif
|
||||
# Use hardening ldflags.
|
||||
@ -128,11 +126,11 @@ ExclusiveArch: x86_64 %{arm} aarch64 ppc64 ppc64le s390x %{ix86}
|
||||
%ifarch %{ix86}
|
||||
ExclusiveArch: i686
|
||||
%endif
|
||||
%if %{without bundled_llvm}
|
||||
%if !%with bundled_llvm
|
||||
# LLVM gives incorrect C++ flags for GCC
|
||||
BuildRequires: llvm-devel >= 5.0
|
||||
BuildRequires: llvm-devel >= 6.0
|
||||
%endif
|
||||
%if %{without rust_bootstrap}
|
||||
%if !%with rust_bootstrap
|
||||
# We will now package cargo using the version number of rustc since
|
||||
# it is being built from rust sources. Old cargo packages have a 0.x number
|
||||
BuildRequires: cargo <= %{version}
|
||||
@ -345,7 +343,7 @@ rm -rf src/tools/clang
|
||||
rm -rf src/tools/lld
|
||||
rm -rf src/tools/lldb
|
||||
|
||||
%if %without bundled_llvm
|
||||
%if !%with bundled_llvm
|
||||
rm -rf src/llvm/
|
||||
%endif
|
||||
|
||||
@ -379,7 +377,7 @@ sed -i '1s|^|#!/bin/bash\n|' src/stdsimd/ci/run-docker.sh
|
||||
--local-rust-root=%{rust_root} \
|
||||
--libdir=%{common_libdir} \
|
||||
--docdir=%{_docdir}/%{name} \
|
||||
%{!?with_bundled_llvm: --llvm-root=%{_prefix} --enable-llvm-link-shared} \
|
||||
%{!?with_bundled_llvm: --llvm-root=%{_prefix} --enable-llvm-link-shared --set llvm.link-jobs=1} \
|
||||
--disable-codegen-tests \
|
||||
--enable-optimize \
|
||||
--enable-docs \
|
||||
@ -387,15 +385,16 @@ sed -i '1s|^|#!/bin/bash\n|' src/stdsimd/ci/run-docker.sh
|
||||
--disable-jemalloc \
|
||||
--disable-rpath \
|
||||
%{debug_info} \
|
||||
%{codegen_units} \
|
||||
--enable-extended \
|
||||
--enable-vendor \
|
||||
--release-channel="stable"
|
||||
|
||||
# We need less codegen units for these arches since the workers are running out of memory
|
||||
# This means we must apply a minimum of 2 CPUs to a worker in constraints.
|
||||
%ifarch %{arm} %{ix86}
|
||||
sed -i -e "s|#codegen-units = 1|codegen-units = 2|" config.toml
|
||||
%endif
|
||||
# Sometimes we may be rebuilding with the same compiler,
|
||||
# setting local-rebuild will skip stage0 build, reducing build time
|
||||
if [ $(%{rust_root}/bin/rustc --version | sed -En 's/rustc ([0-9].[0-9][0-9].[0-9]).*/\1/p') == '%{version}' ]; then
|
||||
sed -i -e "s|#local-rebuild = false|local-rebuild = true|" config.toml;
|
||||
fi
|
||||
|
||||
# Keep all the "export VARIABLE" together here, so they can be
|
||||
# cut&pasted to the %install section below. And please keep them
|
||||
@ -566,4 +565,4 @@ rm -rf %{buildroot}%{_sysconfdir}
|
||||
%dir %{_docdir}/cargo
|
||||
%{_docdir}/cargo/html
|
||||
|
||||
%changelog
|
||||
%changelog
|
Loading…
Reference in New Issue
Block a user