Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
From fbd3fbdb24563a9d8fd3651f6bdc90bbbbd81d3e Mon Sep 17 00:00:00 2001
From e9491f4aa3b1c2c0f9b1fdc684e986ba035a5486 Mon Sep 17 00:00:00 2001
From: Josh Stone <[email protected]>
Date: Fri, 1 May 2020 16:50:10 -0700
Subject: [PATCH] Use a non-existent test path instead of clobbering /dev/null
Subject: [PATCH 1/3] Use a non-existent test path instead of clobbering
/dev/null

Signed-off-by: Raine Makelainen <[email protected]>
---
Expand Down
19 changes: 17 additions & 2 deletions llvm-targets.patch → 0002-Set-proper-llvm-targets.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
--- config.toml.example 2020-06-01 18:44:15.000000000 +0300
+++ config.toml.example.new 2020-06-17 12:42:44.752144283 +0300
From 60d68652869d79e75d30c45ae8a7575bc2da6019 Mon Sep 17 00:00:00 2001
From: Matti Kosola <[email protected]>
Date: Thu, 9 Jul 2020 11:22:10 +0000
Subject: [PATCH 2/3] Set proper llvm targets.

Signed-off-by: Matti Kosola <[email protected]>
---
config.toml.example | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config.toml.example b/config.toml.example
index 9121d1e1799..7990f01ab42 100644
--- a/config.toml.example
+++ b/config.toml.example
@@ -63,7 +63,7 @@
# support. You'll need to write a target specification at least, and most
# likely, teach rustc about the C ABI of the target. Get in touch with the
Expand All @@ -9,3 +21,6 @@

# LLVM experimental targets to build support for. These targets are specified in
# the same format as above, but since these targets are experimental, they are
--
2.26.2

Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
Disable statx for all builds.
From 191c6df3cfb0a3daae7ba40966ed22f8a63af453 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomi=20Lepp=C3=A4nen?= <[email protected]>
Date: Fri, 26 Jun 2020 11:58:19 +0300
Subject: [PATCH 3/3] Disable statx for all builds. JB#50106
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

libstd implements statx using syscall and thus it will not work on
scratchbox2. Moreover as it is supported only by Linux 4.11 and newer
it's little use for us at the moment. It can be disabled and which means
that optional extra information is set to None. Software should handle
that gracefully without issues thanks to rust's type system.

Signed-off-by: Tomi Leppänen <[email protected]
Signed-off-by: Matti Kosola <[email protected]>
---
--- rustc-1.44.0-src/src/libstd/sys/unix/fs.rs.old 2020-06-01 18:44:16.000000000 +0300
+++ rustc-1.44.0-src/src/libstd/sys/unix/fs.rs 2020-06-26 12:42:46.438070586 +0300
@@ -58,20 +58,9 @@
src/libstd/sys/unix/fs.rs | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs
index a233aa47dff..45fb192fc8c 100644
--- a/src/libstd/sys/unix/fs.rs
+++ b/src/libstd/sys/unix/fs.rs
@@ -58,20 +58,9 @@ pub struct File(FileDesc);
// https://github.com/rust-lang/rust/pull/67774
macro_rules! cfg_has_statx {
({ $($then_tt:tt)* } else { $($else_tt:tt)* }) => {
Expand All @@ -32,3 +45,6 @@ that gracefully without issues thanks to rust's type system.
}

cfg_has_statx! {{
--
2.26.2

6 changes: 6 additions & 0 deletions rust.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
* Fri Jul 10 2020 Matti Kosola <[email protected]> - 1.44.0+git3
- [rust] Clean up packaging. JB#50106
- [rust] Use default codegen units. JB#50106
- [rust] Disable tests for arm. JB#50106
- [rust] Disable aarch64 build. JB#50106

* Fri Jun 26 2020 Tomi Leppänen <[email protected]> - 1.44.0+git2
- [rust] Disable statx for all builds. JB#50106

Expand Down
31 changes: 17 additions & 14 deletions rust.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@
%bcond_without lldb

Name: rust
# TODO: Suffix version at the end with +git1
Version: %{rust_version}+git2
Version: %{rust_version}+git3
Release: 1
Summary: The Rust Programming Language
License: (ASL 2.0 or MIT) and (BSD and MIT)
# ^ written as: (rust itself) and (bundled libraries)
URL: https://www.rust-lang.org

%global rustc_package rustc-%{rust_version}-src
Source0: https://static.rust-lang.org/dist/rustc-%{rust_version}-src.tar.gz
Source1: https://static.rust-lang.org/dist/rust-%{rust_version}-%{rust_triple}.tar.gz
Source0: rustc-%{rust_version}-src.tar.gz
Source100: rust-%{rust_version}-i686-unknown-linux-gnu.tar.gz
Source101: rust-%{rust_version}-armv7-unknown-linux-gnueabihf.tar.gz
Source200: README.md

Patch1: 0001-Use-a-non-existent-test-path-instead-of-clobbering-d.patch
Patch2: llvm-targets.patch
Patch3: disable-statx.patch
Patch2: 0002-Set-proper-llvm-targets.patch
Patch3: 0003-Disable-statx-for-all-builds.-JB-50106.patch

%global bootstrap_root rust-%{rust_version}-%{rust_triple}
%global local_rust_root %{_builddir}/%{bootstrap_root}/usr
Expand All @@ -40,7 +41,6 @@ BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: ncurses-devel
# BuildRequires: curl
BuildRequires: pkgconfig(libcurl)
# build.rs and boostrap/config.rs => cargo_native_static?
BuildRequires: pkgconfig(liblzma)
Expand All @@ -56,6 +56,8 @@ BuildRequires: procps
# debuginfo-gdb tests need gdb
BuildRequires: gdb

# Disable aach64 build
ExcludeArch: aarch64

# Virtual provides for folks who attempt "dnf install rustc"
Provides: rustc = %{version}-%{release}
Expand Down Expand Up @@ -145,8 +147,11 @@ and ensure that you'll always get a repeatable build.


%prep

%setup -q -n %{bootstrap_root} -T -b 1
%ifarch %ix86
%setup -q -n %{bootstrap_root} -T -b 100
%else
%setup -q -n %{bootstrap_root} -T -b 101
%endif
./install.sh --components=cargo,rustc,rust-std-%{rust_triple} \
--prefix=%{local_rust_root} --disable-ldconfig
test -f '%{local_rust_root}/bin/cargo'
Expand All @@ -155,7 +160,7 @@ test -f '%{local_rust_root}/bin/rustc'
%setup -q -n %{rustc_package}

%patch1 -p1
%patch2 -p0
%patch2 -p1
%patch3 -p1

sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
Expand Down Expand Up @@ -212,8 +217,6 @@ export RUSTFLAGS="%{rustflags}"
# %define enable_debuginfo --disable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines
%define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2 --disable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines

%define codegen_units_std --set rust.codegen-units-std=1

%configure --disable-option-checking \
--libdir=%{common_libdir} \
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
Expand All @@ -233,8 +236,6 @@ export RUSTFLAGS="%{rustflags}"
--llvm-root=/usr/ \
--enable-parallel-compiler

# --set="parallel-compiler=true"

%{python} ./x.py build


Expand Down Expand Up @@ -295,12 +296,14 @@ rm -f %{buildroot}%{_bindir}/rustdoc
rm -fr %{buildroot}%{_mandir}/man1

%check
%ifarch %ix86
%{?cmake_path:export PATH=%{cmake_path}:$PATH}
%{?rustflags:export RUSTFLAGS="%{rustflags}"}

# The results are not stable on koji, so mask errors and just log it.
%{python} ./x.py test --no-fail-fast || :
%{python} ./x.py test --no-fail-fast cargo || :
%endif

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
Expand Down