Skip to content

Commit 211461e

Browse files
authored
Merge pull request #3 from sailfishos/test
Clean up packaging.
2 parents c831dad + 045b295 commit 211461e

5 files changed

+63
-22
lines changed

0001-Use-a-non-existent-test-path-instead-of-clobbering-d.patch

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
From fbd3fbdb24563a9d8fd3651f6bdc90bbbbd81d3e Mon Sep 17 00:00:00 2001
1+
From e9491f4aa3b1c2c0f9b1fdc684e986ba035a5486 Mon Sep 17 00:00:00 2001
22
From: Josh Stone <[email protected]>
33
Date: Fri, 1 May 2020 16:50:10 -0700
4-
Subject: [PATCH] Use a non-existent test path instead of clobbering /dev/null
4+
Subject: [PATCH 1/3] Use a non-existent test path instead of clobbering
5+
/dev/null
56

67
Signed-off-by: Raine Makelainen <[email protected]>
78
---
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
--- config.toml.example 2020-06-01 18:44:15.000000000 +0300
2-
+++ config.toml.example.new 2020-06-17 12:42:44.752144283 +0300
1+
From 60d68652869d79e75d30c45ae8a7575bc2da6019 Mon Sep 17 00:00:00 2001
2+
From: Matti Kosola <[email protected]>
3+
Date: Thu, 9 Jul 2020 11:22:10 +0000
4+
Subject: [PATCH 2/3] Set proper llvm targets.
5+
6+
Signed-off-by: Matti Kosola <[email protected]>
7+
---
8+
config.toml.example | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+
diff --git a/config.toml.example b/config.toml.example
12+
index 9121d1e1799..7990f01ab42 100644
13+
--- a/config.toml.example
14+
+++ b/config.toml.example
315
@@ -63,7 +63,7 @@
416
# support. You'll need to write a target specification at least, and most
517
# likely, teach rustc about the C ABI of the target. Get in touch with the
@@ -9,3 +21,6 @@
921

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

disable-statx.patch renamed to 0003-Disable-statx-for-all-builds.-JB-50106.patch

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

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

15+
Signed-off-by: Tomi Leppänen <[email protected]
16+
Signed-off-by: Matti Kosola <[email protected]>
917
---
10-
--- rustc-1.44.0-src/src/libstd/sys/unix/fs.rs.old 2020-06-01 18:44:16.000000000 +0300
11-
+++ rustc-1.44.0-src/src/libstd/sys/unix/fs.rs 2020-06-26 12:42:46.438070586 +0300
12-
@@ -58,20 +58,9 @@
18+
src/libstd/sys/unix/fs.rs | 15 ++-------------
19+
1 file changed, 2 insertions(+), 13 deletions(-)
20+
21+
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs
22+
index a233aa47dff..45fb192fc8c 100644
23+
--- a/src/libstd/sys/unix/fs.rs
24+
+++ b/src/libstd/sys/unix/fs.rs
25+
@@ -58,20 +58,9 @@ pub struct File(FileDesc);
1326
// https://github.com/rust-lang/rust/pull/67774
1427
macro_rules! cfg_has_statx {
1528
({ $($then_tt:tt)* } else { $($else_tt:tt)* }) => {
@@ -32,3 +45,6 @@ that gracefully without issues thanks to rust's type system.
3245
}
3346

3447
cfg_has_statx! {{
48+
--
49+
2.26.2
50+

rust.changes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
* Fri Jul 10 2020 Matti Kosola <[email protected]> - 1.44.0+git3
2+
- [rust] Clean up packaging. JB#50106
3+
- [rust] Use default codegen units. JB#50106
4+
- [rust] Disable tests for arm. JB#50106
5+
- [rust] Disable aarch64 build. JB#50106
6+
17
* Fri Jun 26 2020 Tomi Leppänen <[email protected]> - 1.44.0+git2
28
- [rust] Disable statx for all builds. JB#50106
39

rust.spec

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,22 @@
1515
%bcond_without lldb
1616

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

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

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

3435
%global bootstrap_root rust-%{rust_version}-%{rust_triple}
3536
%global local_rust_root %{_builddir}/%{bootstrap_root}/usr
@@ -40,7 +41,6 @@ BuildRequires: cmake
4041
BuildRequires: gcc
4142
BuildRequires: gcc-c++
4243
BuildRequires: ncurses-devel
43-
# BuildRequires: curl
4444
BuildRequires: pkgconfig(libcurl)
4545
# build.rs and boostrap/config.rs => cargo_native_static?
4646
BuildRequires: pkgconfig(liblzma)
@@ -56,6 +56,8 @@ BuildRequires: procps
5656
# debuginfo-gdb tests need gdb
5757
BuildRequires: gdb
5858

59+
# Disable aach64 build
60+
ExcludeArch: aarch64
5961

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

146148

147149
%prep
148-
149-
%setup -q -n %{bootstrap_root} -T -b 1
150+
%ifarch %ix86
151+
%setup -q -n %{bootstrap_root} -T -b 100
152+
%else
153+
%setup -q -n %{bootstrap_root} -T -b 101
154+
%endif
150155
./install.sh --components=cargo,rustc,rust-std-%{rust_triple} \
151156
--prefix=%{local_rust_root} --disable-ldconfig
152157
test -f '%{local_rust_root}/bin/cargo'
@@ -155,7 +160,7 @@ test -f '%{local_rust_root}/bin/rustc'
155160
%setup -q -n %{rustc_package}
156161

157162
%patch1 -p1
158-
%patch2 -p0
163+
%patch2 -p1
159164
%patch3 -p1
160165

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

215-
%define codegen_units_std --set rust.codegen-units-std=1
216-
217220
%configure --disable-option-checking \
218221
--libdir=%{common_libdir} \
219222
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
@@ -233,8 +236,6 @@ export RUSTFLAGS="%{rustflags}"
233236
--llvm-root=/usr/ \
234237
--enable-parallel-compiler
235238

236-
# --set="parallel-compiler=true"
237-
238239
%{python} ./x.py build
239240

240241

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

297298
%check
299+
%ifarch %ix86
298300
%{?cmake_path:export PATH=%{cmake_path}:$PATH}
299301
%{?rustflags:export RUSTFLAGS="%{rustflags}"}
300302

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

305308
%post -p /sbin/ldconfig
306309
%postun -p /sbin/ldconfig

0 commit comments

Comments
 (0)