Update to 1.15.1.

Require rust-rpm-macros for new crate packaging.
Keep shared libraries under rustlib/, only debug-stripped.
Merge and clean up conditionals for epel7.
This commit is contained in:
Josh Stone 2017-02-09 15:26:24 -08:00
parent 5295a12324
commit 7cfff5ad76
4 changed files with 95 additions and 64 deletions

8
.gitignore vendored
View File

@ -25,3 +25,11 @@
/rustc-1.13.0-s390x-unknown-linux-gnu.tar.gz
/rustc-1.13.0-x86_64-unknown-linux-gnu.tar.gz
/rustc-1.14.0-src.tar.gz
/rustc-1.15.1-src.tar.gz
/rustc-1.14.0-aarch64-unknown-linux-gnu.tar.gz
/rustc-1.14.0-armv7-unknown-linux-gnueabihf.tar.gz
/rustc-1.14.0-i686-unknown-linux-gnu.tar.gz
/rustc-1.14.0-powerpc64le-unknown-linux-gnu.tar.gz
/rustc-1.14.0-powerpc64-unknown-linux-gnu.tar.gz
/rustc-1.14.0-s390x-unknown-linux-gnu.tar.gz
/rustc-1.14.0-x86_64-unknown-linux-gnu.tar.gz

133
rust.spec
View File

@ -8,8 +8,8 @@
# To bootstrap from scratch, set the channel and date from src/stage0.txt
# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
# or nightly wants some beta-YYYY-MM-DD
%global bootstrap_channel 1.13.0
%global bootstrap_date 2016-11-08
%global bootstrap_channel 1.14.0
%global bootstrap_date 2016-12-18
# Only the specified arches will use bootstrap binaries.
#global bootstrap_arches %%{rust_arches}
@ -19,12 +19,21 @@
# FIXME: LLVM 3.9 prefers shared linking now! Which is good, but next time we
# *want* static we'll have to force it with "llvm-config --link-static".
# See also https://github.com/rust-lang/rust/issues/36854
# The new rustbuild accepts `--enable-llvm-link-shared`, else links static.
%bcond_with llvm_static
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM
# is insufficient. Rust currently requires LLVM 3.7+.
%if 0%{?rhel}
%bcond_without bundled_llvm
%else
%bcond_with bundled_llvm
%endif
Name: rust
Version: 1.14.0
Release: 2%{?dist}
Version: 1.15.1
Release: 1%{?dist}
Summary: The Rust Programming Language
License: (ASL 2.0 or MIT) and (BSD and ISC and MIT)
# ^ written as: (rust itself) and (bundled libraries)
@ -32,11 +41,11 @@ URL: https://www.rust-lang.org
ExclusiveArch: %{rust_arches}
%if "%{channel}" == "stable"
%global rustc_package rustc-%{version}
%global rustc_package rustc-%{version}-src
%else
%global rustc_package rustc-%{channel}
%global rustc_package rustc-%{channel}-src
%endif
Source0: https://static.rust-lang.org/dist/%{rustc_package}-src.tar.gz
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.gz
# Get the Rust triple for any arch.
%{lua: function rust_triple(arch)
@ -80,21 +89,29 @@ end}
%global local_rust_root %{_builddir}/%{bootstrap_root}/rustc
Provides: bundled(%{name}-bootstrap) = %{bootstrap_channel}
%else
BuildRequires: %{name} <= %{version}
BuildRequires: %{name} >= %{bootstrap_channel}
BuildConflicts: %{name} > %{version}
%global local_rust_root %{_prefix}
%endif
BuildRequires: make
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: llvm-devel
BuildRequires: ncurses-devel
BuildRequires: zlib-devel
BuildRequires: python2
BuildRequires: curl
%if 0%{?epel}
BuildRequires: cmake3
%else
BuildRequires: cmake
%endif
%if %with bundled_llvm
Provides: bundled(llvm) = 3.9
%else
BuildRequires: llvm-devel >= 3.7
%if %with llvm_static
BuildRequires: llvm-static
BuildRequires: libffi-devel
@ -102,6 +119,7 @@ BuildRequires: libffi-devel
# Make sure llvm-config doesn't see it.
BuildConflicts: llvm-static
%endif
%endif
# make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs
BuildRequires: procps-ng
@ -124,20 +142,25 @@ Requires: %{name}-std-static%{?_isa} = %{version}-%{release}
# https://github.com/rust-lang/rust/issues/11937
Requires: gcc
%if 0%{?fedora} >= 26
# Only non-bootstrap builds should require rust-rpm-macros, because that
# requires cargo, which might not exist yet.
%ifnarch %{bootstrap_arches}
Requires: rust-rpm-macros
%endif
%endif
# ALL Rust libraries are private, because they don't keep an ABI.
%global _privatelibs lib.*-[[:xdigit:]]{8}[.]so.*
%global __provides_exclude ^(%{_privatelibs})$
%global __requires_exclude ^(%{_privatelibs})$
# Rust 1.12 metadata is now unallocated data (.rustc), and in theory it should
# be fine to strip this entirely, since we don't want to expose Rust's unstable
# ABI for linking. However, eu-strip was then clobbering .dynsym when it tried
# to remove the rust_metadata symbol referencing .rustc (rhbz1380961).
# So for unfixed elfutils, we'll leave .rustc alone and only strip debuginfo.
%if 0%{?fedora} < 25
# While we don't want to encourage dynamic linking to Rust shared libraries, as
# there's no stable ABI, we still need the unallocated metadata (.rustc) to
# support custom-derive plugins like #[proc_macro_derive(Foo)]. But eu-strip is
# very eager by default, so we have to limit it to -g, only debugging symbols.
%global _find_debuginfo_opts -g
%undefine _include_minidebuginfo
%endif
%description
Rust is a systems programming language that runs blazingly fast, prevents
@ -187,7 +210,9 @@ test -f '%{local_rust_root}/bin/rustc'
# unbundle
rm -rf src/jemalloc/
%if %without bundled_llvm
rm -rf src/llvm/
%endif
# extract bundled licenses for packaging
cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown
@ -201,7 +226,11 @@ sed -i.jemalloc -e '1i // ignore-test jemalloc is disabled' \
src/test/compile-fail/allocator-rust-dylib-is-jemalloc.rs \
src/test/run-pass/allocator-default.rs
%if %with llvm_static
%if 0%{?epel}
sed -i.cmake -e 's/CFG_CMAKE cmake/&3/' configure
%endif
%if %{without bundled_llvm} && %{with llvm_static}
# Static linking to distro LLVM needs to add -lffi
# https://github.com/rust-lang/rust/issues/34486
sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
@ -211,21 +240,11 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
%build
%ifarch aarch64 %{mips} %{power64}
%ifarch %{bootstrap_arches}
# Upstream binaries have a 4k-paged jemalloc, which breaks with Fedora 64k pages.
# See https://github.com/rust-lang/rust/issues/36994
# Fixed by https://github.com/rust-lang/rust/issues/37392
# So we can remove this when bootstrap reaches Rust 1.14.0.
export MALLOC_CONF=lg_dirty_mult:-1
%endif
%endif
# Use hardening ldflags.
export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now"
# We're going to override --libdir when configuring to get rustlib into a
# common path, but we'll properly relocate the shared libraries during install.
# common path, but we'll fix the shared libraries during install.
%global common_libdir %{_prefix}/lib
%global rustlibdir %{common_libdir}/rustlib
@ -233,10 +252,12 @@ export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now"
--libdir=%{common_libdir} \
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
--enable-local-rust --local-rust-root=%{local_rust_root} \
--llvm-root=%{_prefix} --disable-codegen-tests \
%{!?with_bundled_llvm: --llvm-root=%{_prefix} --disable-codegen-tests \
%{!?with_llvm_static: --enable-llvm-link-shared } } \
--disable-jemalloc \
--disable-rpath \
--enable-debuginfo \
--disable-rustbuild \
--release-channel=%{channel}
%make_build VERBOSE=1
@ -245,40 +266,32 @@ export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now"
%install
%make_install VERBOSE=1
%if "%{common_libdir}" != "%{_libdir}"
# Fix the installed location of shared libraries.
# (should perhaps use a subdir and ld.so.conf script?)
mkdir -p %{buildroot}/%{_libdir}
mv -v -t %{buildroot}/%{_libdir} %{buildroot}/%{common_libdir}/*.so
%endif
# The libdir libraries are identical to those under rustlib/, and we need
# the latter in place to support dynamic linking for compiler plugins, so we'll
# point ldconfig to rustlib/ and remove the former.
%global rust_ldconfig %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
mkdir -p %{buildroot}$(dirname %{rust_ldconfig})
echo "%{rustlibdir}/%{rust_triple}/lib" > %{buildroot}%{rust_ldconfig}
rm -v %{buildroot}%{common_libdir}/*.so
# Remove installer artifacts (manifests, uninstall scripts, etc.)
find %{buildroot}/%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
# We don't want to ship the target shared libraries for lack of any Rust ABI.
find %{buildroot}/%{rustlibdir} -type f -name '*.so' -exec rm -v '{}' '+'
# The remaining shared libraries should be executable for debuginfo extraction.
find %{buildroot}/%{_libdir}/ -type f -name '*.so' -exec chmod -v +x '{}' '+'
# They also don't need the .rustc metadata anymore, so they won't support linking.
# (but this needs the rhbz1380961 fix, or else eu-strip will clobber .dynsym)
%if 0%{?fedora} >= 25
find %{buildroot}/%{_libdir}/ -type f -name '*.so' -exec objcopy -R .rustc '{}' ';'
%endif
# The shared libraries should be executable for debuginfo extraction.
find %{buildroot}%{rustlibdir}/ -type f -name '*.so' -exec chmod -v +x '{}' '+'
# FIXME: __os_install_post will strip the rlibs
# -- should we find a way to preserve debuginfo?
# Remove unwanted documentation files (we already package them)
rm -f %{buildroot}/%{_docdir}/%{name}/README.md
rm -f %{buildroot}/%{_docdir}/%{name}/COPYRIGHT
rm -f %{buildroot}/%{_docdir}/%{name}/LICENSE-APACHE
rm -f %{buildroot}/%{_docdir}/%{name}/LICENSE-MIT
rm -f %{buildroot}%{_docdir}/%{name}/README.md
rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT
# Sanitize the HTML documentation
find %{buildroot}/%{_docdir}/%{name}/html -empty -delete
find %{buildroot}/%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'
find %{buildroot}%{_docdir}/%{name}/html -empty -delete
find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'
%check
@ -301,7 +314,11 @@ make check-lite VERBOSE=1 -k || python2 src/etc/check-summary.py tmp/*.log || :
%{_bindir}/rustdoc
%{_mandir}/man1/rustc.1*
%{_mandir}/man1/rustdoc.1*
%{_libdir}/lib*
%dir %{rustlibdir}
%dir %{rustlibdir}/%{rust_triple}
%dir %{rustlibdir}/%{rust_triple}/lib
%{rustlibdir}/%{rust_triple}/lib/*.so
%{rust_ldconfig}
%files std-static
@ -330,6 +347,12 @@ make check-lite VERBOSE=1 -k || python2 src/etc/check-summary.py tmp/*.log || :
%changelog
* Thu Feb 09 2017 Josh Stone <jistone@redhat.com> - 1.15.1-1
- Update to 1.15.1.
- Require rust-rpm-macros for new crate packaging.
- Keep shared libraries under rustlib/, only debug-stripped.
- Merge and clean up conditionals for epel7.
* Fri Dec 23 2016 Josh Stone <jistone@redhat.com> - 1.14.0-2
- Rebuild without bootstrap binaries.

View File

@ -1 +1 @@
SHA512 (rustc-1.14.0-src.tar.gz) = 3d7ea4ed29ade247a40e586b1966752af508f2d93fb6695027189f4fe012af910dc2ad554acf3a661134a4371c9699fc0e04fae1dcf8f2f49691797b5c9ed356
SHA512 (rustc-1.15.1-src.tar.gz) = 10d533b17cf7f92b9dff14b399b5dd0ac8b68284eea072c85ede78a4e4c2c4fce8c781777124c64798057aceb6444535e02e067fd67ba3633c3e828fb4d2d339

View File

@ -1,8 +1,8 @@
SHA512 (rustc-1.14.0-src.tar.gz) = 3d7ea4ed29ade247a40e586b1966752af508f2d93fb6695027189f4fe012af910dc2ad554acf3a661134a4371c9699fc0e04fae1dcf8f2f49691797b5c9ed356
SHA512 (rustc-1.13.0-aarch64-unknown-linux-gnu.tar.gz) = 3e62fb91b9dc532223fcc389a148a0af1c09f53bb2f8a1a55989b828b3e2c6de6c2b756c42db88392df3971057470449b3c0ad0c36589a57c71433b45f124498
SHA512 (rustc-1.13.0-armv7-unknown-linux-gnueabihf.tar.gz) = 4ca414a59091be4bafbe04c7a4857b07a833f9d4e9c76a6d41b3aad2234a4997326dc7df7ba4992c1399cae49b419bf4b5296e76a595e681a2ffbc8adbb8899c
SHA512 (rustc-1.13.0-i686-unknown-linux-gnu.tar.gz) = d9a85e114c174a8fb2ae3e55ed17fa882323875512bab380ac3d0f5b251702dd6d4aa90119fcc4b22cbfef1a221e2fcbedd4e33eb1ab31289a18562ab73da159
SHA512 (rustc-1.13.0-powerpc64le-unknown-linux-gnu.tar.gz) = 8f0da5280c15404153ad94fde5a56b3e5a46726901d808a4115d5b1cec1010c19b788df7ba3af991958cb75174cb2628ae4c5e2d0c17011e250c373445f22cf1
SHA512 (rustc-1.13.0-powerpc64-unknown-linux-gnu.tar.gz) = 7ce759eaf889478f441c84f78ccb00766ac1b202eb498dcb87fcedb71f7fda3c6605135ad271aa3f6edc86d9b9508fa597a2dbcd9d086288acb7bbc023c1fd62
SHA512 (rustc-1.13.0-s390x-unknown-linux-gnu.tar.gz) = 0d5b1523a51cae36f0da906505f3b930839006297b91edfb9b27d2bc85474cc68d0fcb92b99776e4ea3ad1f4445e331b46f4a2fc01b54dc72910dd6c2a77ba99
SHA512 (rustc-1.13.0-x86_64-unknown-linux-gnu.tar.gz) = c7d3177ed25ba80cdaaafa7c3d238bd24e548e2f0f6e00d1ef1dbaf7afa4809def6bd893cc4a607c0e1973fc68e82dc9342fc6a84f77bd8e47d1c547bd0adcfb
SHA512 (rustc-1.15.1-src.tar.gz) = 10d533b17cf7f92b9dff14b399b5dd0ac8b68284eea072c85ede78a4e4c2c4fce8c781777124c64798057aceb6444535e02e067fd67ba3633c3e828fb4d2d339
SHA512 (rustc-1.14.0-aarch64-unknown-linux-gnu.tar.gz) = d08f666a394d7024ceef4e37e224a496192ea87cde398c6e2f71fa045661c560587a7c960118756dda8b62e1a7c2925eab024d054e9b79879299d55546915c5d
SHA512 (rustc-1.14.0-armv7-unknown-linux-gnueabihf.tar.gz) = fb573088e2983350f29dbef909ca276e7ec98054c460ac8d910fdbcea9848f558952b122b38eb1b72fb52b659c0197c8ae105f422c5ce18b3a5cb69e6d1ebb40
SHA512 (rustc-1.14.0-i686-unknown-linux-gnu.tar.gz) = 4a951439d8c001b8ff2f6aa2f505e23130209494026fdacea019aef05bebb2f0d3404df047ccedbe9f4140cb5163404db22a5b0977752c495fc45f739d1252fb
SHA512 (rustc-1.14.0-powerpc64le-unknown-linux-gnu.tar.gz) = 174e18d2bd8fc9587ea93f437a7bb1e3c1ef172fb24b1f4473404f0012e7cbe80b38c226ac6fb6231987237021ecc5353e4a8acc6b2176b11b713a73aef6f43a
SHA512 (rustc-1.14.0-powerpc64-unknown-linux-gnu.tar.gz) = 192175f475d3c52004358d3afa7c6c9a50d7f21e62b5ad81b9a10ecca5f2abad8c731728065efa5ba6dfe1a903e756be772bf104575af30c4aecebf2808c3f82
SHA512 (rustc-1.14.0-s390x-unknown-linux-gnu.tar.gz) = 5514007bd2354fbbbf29786d8d6f55fccc564b872a2c32041c6a663535029816d6c485b9c237eb9d58a62a34e26ea504123025f7c189d98637ffb1e8d7b0cc64
SHA512 (rustc-1.14.0-x86_64-unknown-linux-gnu.tar.gz) = da33a8c509d3a554bed3173f8cdd6fc3639646e5b12eae80654d83290160227238c6f9ff9c0247d63a90f48eeafc8dc31a4a02575ba43fa6d5f75ae58a347c32