Accepting request 680376 from devel:languages:rust

OBS-URL: https://build.opensuse.org/request/show/680376
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rust?expand=0&rev=34
This commit is contained in:
Dominique Leuenberger 2019-03-05 11:17:12 +00:00 committed by Git OBS Bridge
commit bfba188fdf
21 changed files with 366 additions and 101 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<constraints>
<hardware>
<processors>4</processors>
<processors>4</processors>
<memory>
<size unit="G">8</size>
</memory>
@ -17,6 +17,9 @@
</conditions>
<hardware>
<processors>2</processors>
<physicalmemory>
<size unit="G">4</size>
</physicalmemory>
<disk>
<size unit="G">15</size>
</disk>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,219 @@
-------------------------------------------------------------------
Fri Mar 1 06:57:58 UTC 2019 - Luke Jones <jones_ld@protonmail.com>
- Bump minimum LLVM to 7.0
- Add conditions to build SLE versions with bundled libgit2 and
libssh2
-------------------------------------------------------------------
Thu Feb 28 17:08:08 UTC 2019 - Federico Mena Quintero <federico@suse.com>
- Use cmake3, not cmake, in SLE-12 SP2 and earlier. The stock cmake
package there was 2.x, and building llvm requires cmake 3.5.
-------------------------------------------------------------------
Wed Feb 27 21:39:35 UTC 2019 - jones_ld@protonmail.com
- Use same version bootstrap as package source
- Fixes to build with correct LLVM for SLE and Leap releases
-------------------------------------------------------------------
Wed Feb 27 02:38:54 UTC 2019 - Luke Jones <jones_ld@protonmail.com>
- Move export vars directly to where used.
- Change codegen units to 2 for Arm and x86 builds in attempt to
reduce memory use by LLVM.
-------------------------------------------------------------------
Wed Feb 27 02:12:17 UTC 2019 - Federico Mena Quintero <federico@suse.com>
- Put each exported environment variable in a separate line so the
specfile will work on SLE SP0/SP1/SP2.
-------------------------------------------------------------------
Sun Feb 24 09:40:06 UTC 2019 - Jan Engelhardt <jengelh@inai.de>
- Avoid bash-specific syntax in "test" call.
-------------------------------------------------------------------
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>
- Ensure install environment is the same as build environment to
prevent building everything twice (second time without correct
flags).
-------------------------------------------------------------------
Thu Jan 17 21:22:11 UTC 2019 - Luke Jones <jones_ld@protonmail.com>
- Update to version 1.32.0
- Language
+ 2018 edition
- You can now use the `?` operator in macro definitions. The `?`
operator allows you to specify zero or one repetitions similar to the `*` and
`+` operators.
- Module paths with no leading keyword like `super`, `self`, or `crate`, will
now always resolve to the item (`enum`, `struct`, etc.) available in the
module if present, before resolving to a external crate or an item the prelude.
E.g.
enum Color { Red, Green, Blue }
use Color::*;
+ All editions
- You can now match against `PhantomData<T>` types.
- You can now match against literals in macros with the `literal`
specifier. This will match against a literal of any type.
E.g. `1`, `'A'`, `"Hello World"`
- Self can now be used as a constructor and pattern for unit and tuple structs. E.g.
struct Point(i32, i32);
impl Point {
pub fn new(x: i32, y: i32) -> Self {
Self(x, y)
}
pub fn is_origin(&self) -> bool {
match self {
Self(0, 0) => true,
_ => false,
}
}
}
- Self can also now be used in type definitions. E.g.
enum List<T>
where
Self: PartialOrd<Self> // can write `Self` instead of `List<T>`
{
Nil,
Cons(T, Box<Self>) // likewise here
}
- You can now mark traits with `#[must_use]`. This provides a warning if
a `impl Trait` or `dyn Trait` is returned and unused in the program.
- Compiler
+ The default allocator has changed from jemalloc to the default allocator on
your system. The compiler itself on Linux & macOS will still use
jemalloc, but programs compiled with it will use the system allocator.
+ Added the `aarch64-pc-windows-msvc` target.
- Libraries
+ `PathBuf` now implements `FromStr`.
- `Box<[T]>` now implements `FromIterator<T>`.
- The `dbg!` macro has been stabilized. This macro enables you to
easily debug expressions in your rust program. E.g.
let a = 2;
let b = dbg!(a * 2) + 1;
// ^-- prints: [src/main.rs:4] a * 2 = 4
assert_eq!(b, 5);
+ The following APIs are now `const` functions and can be used in a
`const` context.
- `Cell::as_ptr`
- `UnsafeCell::get`
- `char::is_ascii`
- `iter::empty`
- `ManuallyDrop::new`
- `ManuallyDrop::into_inner`
- `RangeInclusive::start`
- `RangeInclusive::end`
- `NonNull::as_ptr`
- `slice::as_ptr`
- `str::as_ptr`
- `Duration::as_secs`
- `Duration::subsec_millis`
- `Duration::subsec_micros`
- `Duration::subsec_nanos`
- `CStr::as_ptr`
- `Ipv4Addr::is_unspecified`
- `Ipv6Addr::new`
- `Ipv6Addr::octets`
- Stabilized APIs
+ `i8::to_be_bytes`
+ `i8::to_le_bytes`
+ `i8::to_ne_bytes`
+ `i8::from_be_bytes`
+ `i8::from_le_bytes`
+ `i8::from_ne_bytes`
+ `i16::to_be_bytes`
+ `i16::to_le_bytes`
+ `i16::to_ne_bytes`
+ `i16::from_be_bytes`
+ `i16::from_le_bytes`
+ `i16::from_ne_bytes`
+ `i32::to_be_bytes`
+ `i32::to_le_bytes`
+ `i32::to_ne_bytes`
+ `i32::from_be_bytes`
+ `i32::from_le_bytes`
+ `i32::from_ne_bytes`
+ `i64::to_be_bytes`
+ `i64::to_le_bytes`
+ `i64::to_ne_bytes`
+ `i64::from_be_bytes`
+ `i64::from_le_bytes`
+ `i64::from_ne_bytes`
+ `i128::to_be_bytes`
+ `i128::to_le_bytes`
+ `i128::to_ne_bytes`
+ `i128::from_be_bytes`
+ `i128::from_le_bytes`
+ `i128::from_ne_bytes`
+ `isize::to_be_bytes`
+ `isize::to_le_bytes`
+ `isize::to_ne_bytes`
+ `isize::from_be_bytes`
+ `isize::from_le_bytes`
+ `isize::from_ne_bytes`
+ `u8::to_be_bytes`
+ `u8::to_le_bytes`
+ `u8::to_ne_bytes`
+ `u8::from_be_bytes`
+ `u8::from_le_bytes`
+ `u8::from_ne_bytes`
+ `u16::to_be_bytes`
+ `u16::to_le_bytes`
+ `u16::to_ne_bytes`
+ `u16::from_be_bytes`
+ `u16::from_le_bytes`
+ `u16::from_ne_bytes`
+ `u32::to_be_bytes`
+ `u32::to_le_bytes`
+ `u32::to_ne_bytes`
+ `u32::from_be_bytes`
+ `u32::from_le_bytes`
+ `u32::from_ne_bytes`
+ `u64::to_be_bytes`
+ `u64::to_le_bytes`
+ `u64::to_ne_bytes`
+ `u64::from_be_bytes`
+ `u64::from_le_bytes`
+ `u64::from_ne_bytes`
+ `u128::to_be_bytes`
+ `u128::to_le_bytes`
+ `u128::to_ne_bytes`
+ `u128::from_be_bytes`
+ `u128::from_le_bytes`
+ `u128::from_ne_bytes`
+ `usize::to_be_bytes`
+ `usize::to_le_bytes`
+ `usize::to_ne_bytes`
+ `usize::from_be_bytes`
+ `usize::from_le_bytes`
+ `usize::from_ne_bytes`
- Cargo
+ You can now run `cargo c` as an alias for `cargo check`.][cargo/6218]
+ Usernames are now allowed in alt registry URLs.][cargo/6242]
- Misc
+ `libproc_macro` has been added to the `rust-src` distribution.
- Compatibility Notes
+ The argument types for AVX's
`_mm256_stream_si256`, `_mm256_stream_pd`, `_mm256_stream_ps` have
been changed from `*const` to `*mut` as the previous implementation
was unsound.
-------------------------------------------------------------------
Sat Jan 5 10:51:54 UTC 2019 - Luke Jones <jones_ld@protonmail.com>
@ -127,15 +343,15 @@ Update to version 1.30.0 (2018-10-25)
- You can now use keywords as identifiers using the raw identifiers
syntax (`r#`),- e.g. `let r#for = true;`
- Using anonymous parameters in traits is now deprecated with a warning and
will be a hard error in the 2018 edition.-
will be a hard error in the 2018 edition.-
- You can now use `crate` in paths.- This allows you to refer to the
crate root in the path, e.g. `use crate::foo;` refers to `foo` in `src/lib.rs`.
- Using a external crate no longer requires being prefixed with `::`.-
- Using a external crate no longer requires being prefixed with `::`.-
Previously, using a external crate in a module without a use statement
required `let json = ::serde_json::from_str(foo);` but can now be written
as `let json = serde_json::from_str(foo);`.
- You can now apply the `#[used]` attribute to static items to prevent the
compiler from optimising them away, even if they appear to be unused,-
compiler from optimising them away, even if they appear to be unused,-
e.g. `#[used] static FOO: u32 = 1;`
- You can now import and reexport macros from other crates with the `use`
syntax.- Macros exported with `#[macro_export]` are now placed into
@ -144,17 +360,17 @@ Update to version 1.30.0 (2018-10-25)
`#[macro_export(local_inner_macros)]` attribute so users won't have to import
those macros.
- You can now catch visibility keywords (e.g. `pub`, `pub(crate)`) in macros
using the `vis` specifier.-
using the `vis` specifier.-
- Non-macro attributes now allow all forms of literals, not just
strings.- Previously, you would write `#[attr("true")]`, and you can now
write `#[attr(true)]`.
- You can now specify a function to handle a panic in the Rust runtime with the
`#[panic_handler]` attribute.-
`#[panic_handler]` attribute.-
+ Compiler
- Added the `riscv32imc-unknown-none-elf` target.-
- Added the `aarch64-unknown-netbsd` target-
- Added the `riscv32imc-unknown-none-elf` target.-
- Added the `aarch64-unknown-netbsd` target-
+ Libraries
- `ManuallyDrop` now allows the inner type to be unsized.-
- `ManuallyDrop` now allows the inner type to be unsized.-
+ Stabilized APIs
- `Ipv4Addr::BROADCAST`
- `Ipv4Addr::LOCALHOST`
@ -176,11 +392,11 @@ Update to version 1.30.0 (2018-10-25)
- Cargo will now provide a progress bar for builds.][cargo/5995]
+ Misc
- `rustdoc` allows you to specify what edition to treat your code as with the
`--edition` option.-
`--edition` option.-
- `rustdoc` now has the `--color` (specify whether to output color) and
`--error-format` (specify error format, e.g. `json`) options.-
`--error-format` (specify error format, e.g. `json`) options.-
- We now distribute a `rust-gdbgui` script that invokes `gdbgui` with Rust
debug symbols.-
debug symbols.-
- Attributes from Rust tools such as `rustfmt` or `clippy` are now
available,- e.g. `#[rustfmt::skip]` will skip formatting the next item.
- Update to version 1.29.2 (2018-10-11)
@ -240,12 +456,12 @@ Update to version 1.30.0 (2018-10-25)
allows a Rust newtype wrapper (`struct NewType<T>(T);`) to be represented as
the inner type across Foreign Function Interface (FFI) boundaries.
- The keywords `pure`, `sizeof`, `alignof`, and `offsetof` have been unreserved
and can now be used as identifiers.-
and can now be used as identifiers.-
- The `GlobalAlloc` trait and `#[global_allocator]` attribute are now
stable.- This will allow users to specify a global allocator for
their program.
- Unit test functions marked with the `#[test]` attribute can now return
`Result<(), E: Debug>` in addition to `()`.-
`Result<(), E: Debug>` in addition to `()`.-
- The `lifetime` specifier for `macro_rules!` is now stable.- This
allows macros to easily target lifetimes.
+ Compiler
@ -256,13 +472,13 @@ Update to version 1.30.0 (2018-10-25)
- The short error format is now stable.- Specified with
`--error-format=short` this option will provide a more compressed output of
rust error messages.
- Added a lint warning when you have duplicated `macro_export`s.-
- Added a lint warning when you have duplicated `macro_export`s.-
- Reduced the number of allocations in the macro parser.- This can
improve compile times of macro heavy crates on average by 5%.
+ Libraries
- Implemented `Default` for `&mut str`.-
- Implemented `From<bool>` for all integer and unsigned number types.-
- Implemented `Extend` for `()`.-
- Implemented `Default` for `&mut str`.-
- Implemented `From<bool>` for all integer and unsigned number types.-
- Implemented `Extend` for `()`.-
- The `Debug` implementation of `time::Duration` should now be more easily
human readable.- Previously a `Duration` of one second would printed as
`Duration { secs: 1, nanos: 0 }` and will now be printed as `1s`.
@ -270,12 +486,12 @@ Update to version 1.30.0 (2018-10-25)
`From<Cow<CStr>>` for `CString`, `From<CString>, From<CStr>, From<&CString>`
for `Cow<CStr>`, `From<OsString>, From<OsStr>, From<&OsString>` for
`Cow<OsStr>`, `From<&PathBuf>` for `Cow<Path>`, and `From<Cow<Path>>`
for `PathBuf`.-
for `PathBuf`.-
- Implemented `Shl` and `Shr` for `Wrapping<u128>`
and `Wrapping<i128>`.-
and `Wrapping<i128>`.-
- `DirEntry::metadata` now uses `fstatat` instead of `lstat` when
possible.- This can provide up to a 40% speed increase.
- Improved error messages when using `format!`.-
- Improved error messages when using `format!`.-
+ Stabilized APIs
- `Iterator::step_by`
- `Path::ancestors`
@ -555,7 +771,7 @@ Sat Feb 24 19:26:15 UTC 2018 - mmanu84@outlook.de
- Update to 1.24.0
- Language changes:
+ External `sysv64` ffi is now available.
+ External `sysv64` ffi is now available.
eg. `extern "sysv64" fn foo () {}`
- Compiler changes:
+ rustc now uses 16 codegen units by default for release builds.
@ -573,18 +789,18 @@ Sat Feb 24 19:26:15 UTC 2018 - mmanu84@outlook.de
+ Copied `AsciiExt` methods onto `char`
+ Remove `T: Sized` requirement on `ptr::is_null()`
+ impl `From<RecvError>` for `{TryRecvError, RecvTimeoutError}`
+ Optimised `f32::{min, max}` to generate more efficient x86
+ Optimised `f32::{min, max}` to generate more efficient x86
assembly
+ `[u8]::contains` now uses memchr which provides a 3x speed
improvement
- Compatibility Notes:
+ Floating point types `Debug` impl now always prints a decimal
point.
+ `Ipv6Addr` now rejects superfluous `::`'s in IPv6 addresses
+ `Ipv6Addr` now rejects superfluous `::`'s in IPv6 addresses
This is in accordance with IETF RFC 4291 §2.2.
+ Unwinding will no longer go past FFI boundaries, and will
instead abort.
+ `Formatter::flags` method is now deprecated. The `sign_plus`,
+ `Formatter::flags` method is now deprecated. The `sign_plus`,
`sign_minus`, `alternate`, and `sign_aware_zero_pad` should be
used instead.
+ Leading zeros in tuple struct members is now an error
@ -702,7 +918,7 @@ Thu Nov 23 00:27:24 UTC 2017 - jones_ld@protonmail.com
+ The minimum Android version that rustc can build for has been bumped
to `4.0` from `2.3`
+ Allowing `T op= &T` for numeric types has broken some type inference cases
- Remove rust-1.21.0-44203-exclude-compiler-rt-test.patch
- Remove rust-1.21.0-44066-ppc64-struct-abi.patch
- Remove rust-1.21.0-44440-s390x-global-align.patch

142
rust.spec
View File

@ -2,7 +2,7 @@
# spec file for package rust
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 Luke Jones, jones_ld@protonmail.com
# Copyright (c) 2019 Luke Jones, jones_ld@protonmail.com
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -13,11 +13,11 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%global prev_rust 1.30.1
%global prev_rust 1.32.0
# some sub-packages are versioned independantly
%global rustfmt_version 1.0.0
%global rls_version 1.31.6
@ -47,29 +47,44 @@
%global rust_triple %{rust_arch}-unknown-linux-%{abi}
# All sources and bootstraps are fetched form here
%global dl_url https://static.rust-lang.org/dist
# Rust doesn't function well when put in /usr/lib64
%global common_libdir %{_prefix}/lib
%global rustlibdir %{common_libdir}/rustlib
# Will build with distro LLVM by default, but the following
# versions do not have a version new enough, >= 6.0
# add --without bundled_llvm option, i.e. enable bundled_llvm by default
# Leap 15.0, SLE 15
%if 0%{?sle_version} == 150000
%bcond_without bundled_llvm
%endif
# Leap 42 to 42.3, SLE12 SP1 to SLE12 SP3
%if 0%{?sle_version} >= 120000 && 0%{?sle_version} <= 120400
%bcond_without bundled_llvm
%endif
# enable the --with-rust_bootstrap flag
%bcond_with rust_bootstrap
# Debuginfo can exhaust memory on these architecture workers
%ifarch %{arm} %{ix86}
%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.
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
# We occasionally need to bootstrap builds due to breakage etc. Rust only guarantees
# v-1 will build v
# %bcond_with rust_bootstrap
# Temporarily set the bootstrap flag in the spec so rings will build without intervention
%bcond_with rust_bootstrap
# Distro LLVM should be sufficient, this also cuts compile times byu almost half
%if 0%{?suse_version} <= 1315
%bcond_without bundled_llvm
%else
%bcond_with bundled_llvm
%endif
Name: rust
Version: 1.31.1
Version: 1.32.0
Release: 0
Summary: A systems programming language
License: MIT OR Apache-2.0
Group: Development/Languages/Rust
URL: https://www.rust-lang.org
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
@ -82,7 +97,14 @@ Source106: %{dl_url}/rust-%{prev_rust}-powerpc64le-unknown-linux-gnu.tar.xz
Source107: %{dl_url}/rust-%{prev_rust}-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
# 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.
BuildRequires: cmake3
%else
# cmake got upgraded to 3.5 in SLE-12 SP2
BuildRequires: cmake
%endif
BuildRequires: curl
BuildRequires: fdupes
BuildRequires: gcc-c++
@ -91,8 +113,13 @@ BuildRequires: pkgconfig
BuildRequires: procps
BuildRequires: python3-base
BuildRequires: pkgconfig(libcurl)
# The following requires must mirror:
# LIBGIT2_SYS_USE_PKG_CONFIG &&
# LIBSSH2_SYS_USE_PKG_CONFIG
%if !%with rust_bootstrap || 0%{?sle_version} >= 120000 && 0%{?sle_version} <= 120400
BuildRequires: pkgconfig(libgit2) >= 0.23
BuildRequires: pkgconfig(libssh2) >= 1.4.3
%endif
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(zlib)
# The compiler is not generally useful without the std library installed
@ -108,11 +135,11 @@ ExclusiveArch: x86_64 %{arm} aarch64 ppc64 ppc64le s390x %{ix86}
%ifarch %{ix86}
ExclusiveArch: i686
%endif
%if %{without bundled_llvm}
# LLVM gives incorrect C++ flags for GCC
BuildRequires: llvm-devel >= 5.0
# Real LLVM minimum version should be 7.x, but rust has a fallback mode
%if !%with bundled_llvm
BuildRequires: llvm-devel >= 7.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}
@ -325,7 +352,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
@ -336,11 +363,10 @@ sed -e '/*\//q' src/libbacktrace/backtrace.h \
# 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.
find src/vendor -name .cargo-checksum.json \
find vendor -name .cargo-checksum.json \
-exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
# Fix rpmlint error "This script uses 'env' as an interpreter"
sed -i '1s|#!%{_bindir}/env python|#!%{_bindir}/python3|' src/jemalloc/scripts/gen_travis.py
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|' '{}' '+'
@ -353,52 +379,72 @@ sed -i '1s|^|#!/bin/bash\n|' src/liblibc/ci/emscripten-entry.sh
sed -i '1s|^|#!/bin/bash\n|' src/stdsimd/ci/run-docker.sh
%build
# This should eventually migrate to distro policy
# Enable optimization, debuginfo, and link hardening.
export RUSTFLAGS="%{rustflags}"
# Cargo use system libs
export LIBGIT2_SYS_USE_PKG_CONFIG=1
export LIBSSH2_SYS_USE_PKG_CONFIG=1
# 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
%else
%define debug_info --enable-debuginfo --disable-debuginfo-only-std --enable-debuginfo-tools --disable-debuginfo-lines
%endif
%configure \
--disable-option-checking \
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
--enable-local-rust \
--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 \
--enable-verbose-tests \
--disable-jemalloc \
--disable-rpath \
%{debug_info} \
%{codegen_units} \
--enable-extended \
--enable-vendor \
--release-channel="stable"
export CPPFLAGS="%{optflags}" # eliminate complain from RPMlint
# 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
# 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
# BEGIN EXPORTS
# Keep all the "export VARIABLE" together here, so they can be
# cut&pasted to the %install section below. And please keep them
# in sync!
# If the environments between build and install and different,
# everything will be rebuilt during installation!
export RUSTFLAGS="%{rustflags}"
# Cargo use system libs if not bootstrapping
# restircted only to libgit due to version changes causing with cargo rpm deps
%if !%with rust_bootstrap || 0%{?sle_version} >= 120000 && 0%{?sle_version} <= 120400
export LIBGIT2_SYS_USE_PKG_CONFIG=1
export LIBSSH2_SYS_USE_PKG_CONFIG=1
%endif
# eliminate complain from RPMlint
export CPPFLAGS="%{optflags}"
# END EXPORTS
./x.py build
./x.py doc
./x.py build -v
./x.py doc -v
%install
DESTDIR=%{buildroot} python3 ./x.py install
DESTDIR=%{buildroot} python3 ./x.py install src
# BEGIN EXPORTS
# Keep all the "export VARIABLE" together here, so they can be
# cut&pasted to the %install section below. And please keep them
# in sync!
# If the environments between build and install and different,
# everything will be rebuilt during installation!
export RUSTFLAGS="%{rustflags}"
# Cargo use system libs if not bootstrapping
# restircted only to libgit due to version changes causing with cargo rpm deps
%if !%with rust_bootstrap || 0%{?sle_version} >= 120000 && 0%{?sle_version} <= 120400
export LIBGIT2_SYS_USE_PKG_CONFIG=1
export LIBSSH2_SYS_USE_PKG_CONFIG=1
%endif
# eliminate complain from RPMlint
export CPPFLAGS="%{optflags}"
# END EXPORTS
DESTDIR=%{buildroot} ./x.py install
DESTDIR=%{buildroot} ./x.py install src
# Remove executable permission from HTML documentation
# to prevent RPMLINT errors.

View File

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

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

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