Accepting request 687578 from devel:languages:rust

OBS-URL: https://build.opensuse.org/request/show/687578
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rust?expand=0&rev=35
This commit is contained in:
Dominique Leuenberger 2019-04-02 07:18:58 +00:00 committed by Git OBS Bridge
commit 6e5353f21d
7 changed files with 226 additions and 61 deletions

View File

@ -1,14 +1,15 @@
<?xml version="1.0"?>
<constraints>
<hardware>
<processors>4</processors>
<processors>8</processors>
<memory>
<size unit="G">8</size>
</memory>
<disk>
<size unit="G">20</size>
<size unit="G">60</size>
</disk>
</hardware>
<!-- i586, armv6 and armv7 tend to run out of memory during builds -->
<overwrite>
<conditions>
<arch>i586</arch>
@ -25,6 +26,7 @@
</disk>
</hardware>
</overwrite>
<!-- x86_64 to use physical memory to speed builds up -->
<overwrite>
<conditions>
<arch>x86_64</arch>
@ -33,8 +35,12 @@
<physicalmemory>
<size unit="G">8</size>
</physicalmemory>
<disk>
<size unit="G">25</size>
</disk>
</hardware>
</overwrite>
<!-- aarch64 is a time consuming build, try to use RAM -->
<overwrite>
<conditions>
<arch>aarch64</arch>
@ -48,4 +54,17 @@
</disk>
</hardware>
</overwrite>
<!-- 25GB of disk as 60GB is unavailable (and unrequired) on s390x and ppc64 -->
<overwrite>
<conditions>
<arch>s390x</arch>
<arch>ppc64</arch>
<arch>ppc64le</arch>
</conditions>
<hardware>
<disk>
<size unit="G">25</size>
</disk>
</hardware>
</overwrite>
</constraints>

View File

@ -0,0 +1,12 @@
diff -u ./src/tools/tidy/src/features.rs ../rustc-1.33.0-src/src/tools/tidy/src/features.rs
--- ../rustc-1.33.0-src/src/tools/tidy/src/features.rs 2019-02-28 21:53:35.000000000 +1300
+++ ./src/tools/tidy/src/features.rs 2019-03-04 21:10:20.854805497 +1300
@@ -188,7 +188,7 @@
}
let mut parts = line.split(',');
- let level = match parts.next().map(|l| l.trim().trim_left_matches('(')) {
+ let level = match parts.next().map(|l| l.trim().trim_start_matches('(')) {
Some("active") => Status::Unstable,
Some("removed") => Status::Removed,
Some("accepted") => Status::Stable,

View File

@ -6,3 +6,11 @@ addFilter("devel-file-in-non-devel-package.*/usr/lib/rustlib/src/.*")
addFilter("binaryinfo-readelf-failed*./usr/lib/rustlib/*.rlib")
# rust has no stable ABI as of yet, soname is of no use yet
addFilter("no-soname.*/usr/lib/rustlib/.*")
addFilter("no-soname.*/usr/lib/lib*")
# tool versions don't always change at same pace as rustc
addFilter("clippy.x86_64: W: no-version-in-last-changelog")
addFilter("rls.x86_64: W: no-version-in-last-changelog")
addFilter("rust-analysis.x86_64: W: no-version-in-last-changelog")
addFilter("rustfmt.x86_64: W: no-version-in-last-changelog")
# error when building with bootstrap. ignore for now
addFilter(".*shlib-policy-name-error.*libLLVM-8svn.*")

View File

@ -1,3 +1,136 @@
-------------------------------------------------------------------
Fri Mar 22 00:02:26 UTC 2019 - Luke Jones <jones_ld@protonmail.com>
- Explicitly build only a subset of tools
-------------------------------------------------------------------
Sat Mar 16 01:19:22 UTC 2019 - Luke Jones <jones_ld@protonmail.com>
- Remove miri complete instead of excluding. This is experimental
and so should not be included.
- BuildRequires ccache in attempt to reduce compile times.
- Remove more extraneous directories from src that will never be
used.
- Extra patterns in rpmlintrc to catch more false positives:
+ Rust has no stable API, ignore SONAME warnings
+ Tool versions don't update in step with rust, ignore warnings
-------------------------------------------------------------------
Wed Mar 6 09:07:43 UTC 2019 - Luke Jones <jones_ld@protonmail.com>
- Separate the bootstrap version from the minimum required system
version for package builds.
-------------------------------------------------------------------
Mon Mar 4 08:17:43 UTC 2019 - Luke Jones <jones_ld@protonmail.com>
- add depreciated-trim_left_matches.patch: replaces depreciated
function call in src/tools/tidy with trim_start_matches to fix
error when bootstrapping with system 1.33.0
-------------------------------------------------------------------
Sat Mar 2 05:17:36 UTC 2019 - Luke Jones <jones_ld@protonmail.com>
- Update to version 1.33.0
+ Language
- You can now use the `cfg(target_vendor)` attribute. E.g.
`#[cfg(target_vendor="linux")] fn main() { println!("Hello Linux!"); }`
- Integer patterns such as in a match expression can now be exhaustive.
E.g. You can have match statement on a `u8` that covers `0..=255` and
you would no longer be required to have a `_ => unreachable!()` case.
- You can now have multiple patterns in `if let` and `while let`
expressions. You can do this with the same syntax as a `match`
expression. E.g.
```
enum Creature {
Crab(String),
Lobster(String),
Person(String),
}
fn main() {
let state = Creature::Crab("Ferris");
if let Creature::Crab(name) | Creature::Person(name) = state {
println!("This creature's name is: {}", name);
}
}
```
- You can now have irrefutable `if let` and `while let` patterns. Using
this feature will by default produce a warning as this behaviour can be
unintuitive. E.g. `if let _ = 5 {}`
- You can now use `let` bindings, assignments, expression statements,
and irrefutable pattern destructuring in const functions.
- You can now call unsafe const functions. E.g.
```
const unsafe fn foo() -> i32 { 5 }
const fn bar() -> i32 {
unsafe { foo() }
}
```
- You can now specify multiple attributes in a `cfg_attr` attribute.
E.g. `#[cfg_attr(all(), must_use, optimize)]`
- You can now specify a specific alignment with the `#[repr(packed)]`
attribute. E.g. `#[repr(packed(2))] struct Foo(i16, i32);` is a struct
with an alignment of 2 bytes and a size of 6 bytes.
- You can now import an item from a module as an `_`. This allows you to
import a trait's impls, and not have the name in the namespace. E.g.
```
use std::io::Read as _;
// Allowed as there is only one `Read` in the module.
pub trait Read {}
```
- extern` functions will now abort by default when panicking.
This was previously undefined behaviour.
+ Compiler
- You can now set a linker flavor for `rustc` with the `-Clinker-flavor`
command line argument.
- The mininum required LLVM version has been bumped to 6.0.
- Added support for the PowerPC64 architecture on FreeBSD.
- The `x86_64-fortanix-unknown-sgx` target support has been upgraded to
tier 2 support. Visit the [platform support][platform-support] page for
information on Rust's platform support.
- Added support for the `thumbv7neon-linux-androideabi` and
`thumbv7neon-unknown-linux-gnueabihf` targets.
- Added support for the `x86_64-unknown-uefi` target.
+ Libraries
- The methods `overflowing_{add, sub, mul, shl, shr}` are now `const`
functions for all numeric types.
- The methods `rotate_left`, `rotate_right`, and `wrapping_{add, sub, mul, shl, shr}`
are now `const` functions for all numeric types.
- The methods `is_positive` and `is_negative` are now `const` functions for
all signed numeric types.
- The `get` method for all `NonZero` types is now `const`.
- The methods `count_ones`, `count_zeros`, `leading_zeros`, `trailing_zeros`,
`swap_bytes`, `from_be`, `from_le`, `to_be`, `to_le` are now `const` for all
numeric types.
- Ipv4Addr::new` is now a `const` function
+ Stabilized APIs
- unix::FileExt::read_exact_at
- unix::FileExt::write_all_at
- Option::transpose
- Result::transpose
- convert::identity
- pin::Pin
- marker::Unpin
- marker::PhantomPinned
- Vec::resize_with
- VecDeque::resize_with
- Duration::as_millis
- Duration::as_micros
- Duration::as_nanos
+ Cargo
- Cargo should now rebuild a crate if a file was modified during the initial
build.][cargo/6484]
+ Compatibility Notes
- The methods `str::{trim_left, trim_right, trim_left_matches, trim_right_matches}`
are now deprecated in the standard library, and their usage will now produce a warning.
Please use the `str::{trim_start, trim_end, trim_start_matches, trim_end_matches}`
methods instead.
-------------------------------------------------------------------
Fri Mar 1 06:57:58 UTC 2019 - Luke Jones <jones_ld@protonmail.com>

105
rust.spec
View File

@ -13,11 +13,13 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global prev_rust 1.32.0
%global version_current 1.33.0
%global version_previous 1.32.0
%global version_bootstrap 1.32.0
# some sub-packages are versioned independantly
%global rustfmt_version 1.0.0
%global rls_version 1.31.6
@ -79,7 +81,7 @@
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
Name: rust
Version: 1.32.0
Version: %{version_current}
Release: 0
Summary: A systems programming language
License: MIT OR Apache-2.0
@ -87,16 +89,19 @@ Group: Development/Languages/Rust
Url: https://www.rust-lang.org
Source0: %{dl_url}/rustc-%{version}-src.tar.xz
Source99: %{name}-rpmlintrc
Source100: %{dl_url}/rust-%{prev_rust}-x86_64-unknown-linux-gnu.tar.xz
Source101: %{dl_url}/rust-%{prev_rust}-i686-unknown-linux-gnu.tar.xz
Source102: %{dl_url}/rust-%{prev_rust}-aarch64-unknown-linux-gnu.tar.xz
Source103: %{dl_url}/rust-%{prev_rust}-armv7-unknown-linux-gnueabihf.tar.xz
Source104: %{dl_url}/rust-%{prev_rust}-arm-unknown-linux-gnueabihf.tar.xz
Source105: %{dl_url}/rust-%{prev_rust}-powerpc64-unknown-linux-gnu.tar.xz
Source106: %{dl_url}/rust-%{prev_rust}-powerpc64le-unknown-linux-gnu.tar.xz
Source107: %{dl_url}/rust-%{prev_rust}-s390x-unknown-linux-gnu.tar.xz
Source100: %{dl_url}/rust-%{version_bootstrap}-x86_64-unknown-linux-gnu.tar.xz
Source101: %{dl_url}/rust-%{version_bootstrap}-i686-unknown-linux-gnu.tar.xz
Source102: %{dl_url}/rust-%{version_bootstrap}-aarch64-unknown-linux-gnu.tar.xz
Source103: %{dl_url}/rust-%{version_bootstrap}-armv7-unknown-linux-gnueabihf.tar.xz
Source104: %{dl_url}/rust-%{version_bootstrap}-arm-unknown-linux-gnueabihf.tar.xz
Source105: %{dl_url}/rust-%{version_bootstrap}-powerpc64-unknown-linux-gnu.tar.xz
Source106: %{dl_url}/rust-%{version_bootstrap}-powerpc64le-unknown-linux-gnu.tar.xz
Source107: %{dl_url}/rust-%{version_bootstrap}-s390x-unknown-linux-gnu.tar.xz
# PATCH-FIX-OPENSUSE: edit src/librustc_llvm/build.rs to ignore GCC incompatible flag
Patch0: ignore-Wstring-conversion.patch
# PATCH-FIX-OPENSUSE: replace depreciated trim_left_matches with trim_start_matches
Patch1: depreciated-trim_left_matches.patch
BuildRequires: ccache
# Leap 42 to 42.3, SLE12 SP1, SP2
%if 0%{?sle_version} >= 120000 && 0%{?sle_version} <= 120200
# In these distros cmake is 2.x, so we need cmake3 for building llvm.
@ -137,18 +142,18 @@ ExclusiveArch: i686
%endif
# Real LLVM minimum version should be 7.x, but rust has a fallback mode
%if !%with bundled_llvm
BuildRequires: llvm-devel >= 7.0
BuildRequires: llvm-devel >= 6.0
%endif
%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}
BuildRequires: cargo >= %{prev_rust}
BuildRequires: rust <= %{version}
BuildRequires: rust >= %{prev_rust}
BuildRequires: cargo <= %{version_current}
BuildRequires: cargo >= %{version_previous}
BuildRequires: rust <= %{version_current}
BuildRequires: rust >= %{version_previous}
# This must be bumped to rust-std-static after 1.27.2 is in mainstream
BuildRequires: rust-std-static <= %{version}
BuildRequires: rust-std-static >= %{prev_rust}
BuildRequires: rust-std-static <= %{version_current}
BuildRequires: rust-std-static >= %{version_previous}
%endif
%description
@ -200,7 +205,6 @@ Supplements: packageand(%{name}:gdb)
# Standard form
Supplements: (%{name} and gdb)
%endif
Provides: rust-gdb = %{version}
%description -n rust-gdb
This subpackage provides pretty printers and a wrapper script for
@ -289,8 +293,6 @@ Provides: rustc:%{_bindir}/cargo = %{version}
Cargo downloads dependencies of Rust projects and compiles it.
%package -n cargo-doc
Version: %{version}
Release: 0
Summary: Documentation for Cargo
# Cargo no longer builds its own documentation
# https://github.com/rust-lang/cargo/pull/4904
@ -305,34 +307,34 @@ This package includes HTML documentation for Cargo.
%prep
%if %{with rust_bootstrap}
%ifarch x86_64
%setup -q -T -b 100 -n rust-%{prev_rust}-%{rust_triple}
%setup -q -T -b 100 -n rust-%{version_bootstrap}-%{rust_triple}
%endif
%ifarch %{ix86}
%setup -q -T -b 101 -n rust-%{prev_rust}-i686-unknown-linux-%{abi}
%setup -q -T -b 101 -n rust-%{version_bootstrap}-i686-unknown-linux-%{abi}
%endif
%ifarch aarch64
%setup -q -T -b 102 -n rust-%{prev_rust}-%{rust_triple}
%setup -q -T -b 102 -n rust-%{version_bootstrap}-%{rust_triple}
%endif
%ifarch armv7hl
%setup -q -T -b 103 -n rust-%{prev_rust}-%{rust_triple}
%setup -q -T -b 103 -n rust-%{version_bootstrap}-%{rust_triple}
%endif
%ifarch armv6hl
%setup -q -T -b 104 -n rust-%{prev_rust}-%{rust_triple}
%setup -q -T -b 104 -n rust-%{version_bootstrap}-%{rust_triple}
%endif
%ifarch ppc64
%setup -q -T -b 105 -n rust-%{prev_rust}-%{rust_triple}
%setup -q -T -b 105 -n rust-%{version_bootstrap}-%{rust_triple}
%endif
%ifarch ppc64le
%setup -q -T -b 106 -n rust-%{prev_rust}-%{rust_triple}
%setup -q -T -b 106 -n rust-%{version_bootstrap}-%{rust_triple}
%endif
%ifarch s390x
%setup -q -T -b 107 -n rust-%{prev_rust}-%{rust_triple}
%setup -q -T -b 107 -n rust-%{version_bootstrap}-%{rust_triple}
%endif
./install.sh --components=cargo,rustc,rust-std-%{rust_triple} --prefix=.%{_prefix} --disable-ldconfig
%endif
%if %{with rust_bootstrap}
%global rust_root %{_builddir}/rust-%{prev_rust}-%{rust_triple}%{_prefix}
%global rust_root %{_builddir}/rust-%{version_bootstrap}-%{rust_triple}%{_prefix}
%else
%global rust_root %{_prefix}
%endif
@ -340,6 +342,7 @@ This package includes HTML documentation for Cargo.
%setup -q -n rustc-%{version}-src
%patch0 -p1
%patch1 -p1
# use python3
sed -i -e "1s|#!.*|#!%{_bindir}/python3|" x.py
@ -351,15 +354,17 @@ rm -rf src/llvm-emscripten/
rm -rf src/tools/clang
rm -rf src/tools/lld
rm -rf src/tools/lldb
# CI tooling won't be used
rm -rf src/stdsimd/ci
# Remove hidden files from source
find src/ -type f -name '.appveyor.yml -exec rm -v '{}' '+'
find src/ -type f -name '.travis.yml -exec rm -v '{}' '+'
%if !%with bundled_llvm
rm -rf src/llvm/
%endif
# extract bundled licenses for packaging
sed -e '/*\//q' src/libbacktrace/backtrace.h \
>src/libbacktrace/LICENSE-libbacktrace
# The configure macro will modify some autoconf-related files, which upsets
# cargo when it tries to verify checksums in those files. If we just truncate
# that file list, cargo won't have anything to complain about.
@ -368,15 +373,8 @@ find vendor -name .cargo-checksum.json \
# Fix rpmlint error "This script uses 'env' as an interpreter"
sed -i '1s|#!%{_bindir}/env python|#!%{_bindir}/python3|' src/libcore/unicode/unicode.py
find src/libcompiler_builtins/compiler-rt/lib/ -name '*.py' \
-exec sed -i -e '1s|#!%{_bindir}/env python|#!%{_bindir}/python3|' '{}' '+'
# Fix rpmlint warnings about these shell scripts not having a shebang or incorrect path
sed -i '1s|^|#!/bin/bash\n|' src/libbacktrace/ltmain.sh
sed -i '1s|^|#!/bin/bash\n|' src/libcompiler_builtins/ci/run.sh
sed -i '1s|^|#!/bin/bash\n|' src/liblibc/ci/run-docker.sh
sed -i '1s|^|#!/bin/bash\n|' src/liblibc/ci/emscripten-entry.sh
sed -i '1s|^|#!/bin/bash\n|' src/stdsimd/ci/run-docker.sh
sed -i '1s|#!%{_bindir}/env python|#!%{_bindir}/python3|' src/libcore/unicode/printable.py
chmod +x src/libcore/unicode/printable.py
%build
%configure \
@ -386,17 +384,20 @@ 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 --set llvm.link-jobs=1} \
%{!?with_bundled_llvm: --llvm-root=%{_prefix} --enable-llvm-link-shared} \
%{?with_bundled_llvm: --disable-llvm-link-shared --set llvm.link-jobs=4} \
--disable-codegen-tests \
--enable-optimize \
--enable-ccache \
--enable-docs \
--enable-verbose-tests \
--disable-jemalloc \
--disable-rpath \
%{debug_info} \
%{codegen_units} \
--enable-extended \
--enable-vendor \
--enable-extended \
--tools="cargo","rls","clippy","rustfmt","analysis","src" \
--release-channel="stable"
# Sometimes we may be rebuilding with the same compiler,
@ -464,19 +465,13 @@ rm %{buildroot}%{_docdir}/%{name}/*.old
# Remove installer artifacts (manifests, uninstall scripts, etc.)
find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
# Remove hidden files from source
find %{buildroot}%{rustlibdir} -type f -name '.appveyor.yml -exec rm -v '{}' '+'
find %{buildroot}%{rustlibdir} -type f -name '.travis.yml -exec rm -v '{}' '+'
# The shared libraries should be executable for debuginfo extraction.
find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -name '*.so' -exec chmod -v +x '{}' '+'
# extract bundled licenses for packaging - From fedora spec
sed -e '/*\//q' src/libbacktrace/backtrace.h > src/libbacktrace/LICENSE-libbacktrace
# The html docs for x86 and x86_64 are the same in most places
%fdupes %{buildroot}%{_docdir}/%{name}/html
# We don't want to run fdupes over much else (like src) or it may cause weirdness.
%fdupes -s %{buildroot}%{_docdir}/%{name}/html
%fdupes -s %{buildroot}/%{_mandir}
%fdupes %{buildroot}/%{_prefix}
# Create the path for crate-devel packages
mkdir -p %{buildroot}%{_datadir}/cargo/registry
@ -497,10 +492,8 @@ rm -rf %{buildroot}%{_sysconfdir}
%files
%if 0%{?suse_version} == 1315
%doc COPYRIGHT LICENSE-APACHE LICENSE-MIT
%doc src/libbacktrace/LICENSE-libbacktrace
%else
%license COPYRIGHT LICENSE-APACHE LICENSE-MIT
%license src/libbacktrace/LICENSE-libbacktrace
%endif
%doc CONTRIBUTING.md README.md RELEASES.md
%{_bindir}/rustc

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d617a7dc39daaafa8256320991005fc376c8ef2080593918301b24466d0067af
size 99602696

3
rustc-1.33.0-src.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f4b1a72f1a29b23dcc9d7be5f60878f0434560513273906aa93dcd5c0de39b71
size 100635400