From ea5947864429e262e608ec97d0d852f4e0e9778ac52053f98378be57287d2a2f Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Sun, 3 Mar 2019 20:22:02 +0000 Subject: [PATCH 01/11] Accepting request 681133 from home:luke_nukem:branches:devel:languages:rust - 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. OBS-URL: https://build.opensuse.org/request/show/681133 OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=196 --- _constraints | 4 +- rust.changes | 103 ++++++++++++++++++++++++++++++++++++++++ rust.spec | 40 +++++++++------- rustc-1.32.0-src.tar.xz | 3 -- rustc-1.33.0-src.tar.xz | 3 ++ 5 files changed, 132 insertions(+), 21 deletions(-) delete mode 100644 rustc-1.32.0-src.tar.xz create mode 100644 rustc-1.33.0-src.tar.xz diff --git a/_constraints b/_constraints index 2d10a1c..03dc120 100644 --- a/_constraints +++ b/_constraints @@ -1,12 +1,12 @@ - 4 + 8 8 - 20 + 25 diff --git a/rust.changes b/rust.changes index 5ea36ce..65521c2 100644 --- a/rust.changes +++ b/rust.changes @@ -1,3 +1,106 @@ +------------------------------------------------------------------- +Sat Mar 2 05:17:36 UTC 2019 - Luke Jones + +- 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 diff --git a/rust.spec b/rust.spec index 393388b..0e447f4 100644 --- a/rust.spec +++ b/rust.spec @@ -79,7 +79,7 @@ %global rustflags -Clink-arg=-Wl,-z,relro,-z,now Name: rust -Version: 1.32.0 +Version: 1.33.0 Release: 0 Summary: A systems programming language License: MIT OR Apache-2.0 @@ -302,6 +302,19 @@ BuildArch: noarch %description -n cargo-doc This package includes HTML documentation for Cargo. +%package -n cargo-miri +Version: %{version} +Release: 0 +Summary: Interpretor for Rust MIR +License: MIT OR Apache-2.0 +Group: Development/Languages/Rust +Requires: cargo = %{version} + +%description -n cargo-miri +An interpreter for Rust's mid-level intermediate representation (MIR). +It can run binaries and test suites of cargo projects and detect certain +classes of undefined behavior. + %prep %if %{with rust_bootstrap} %ifarch x86_64 @@ -356,10 +369,6 @@ rm -rf src/tools/lldb 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,14 +377,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 %build @@ -471,9 +474,6 @@ 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. @@ -497,10 +497,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 @@ -594,4 +592,14 @@ rm -rf %{buildroot}%{_sysconfdir} %dir %{_docdir}/cargo %{_docdir}/cargo/html +%files -n cargo-miri +%if 0%{?suse_version} == 1315 +%doc src/tools/miri/LICENSE-{APACHE,MIT} +%else +%license src/tools/miri/LICENSE-{APACHE,MIT} +%endif +%doc src/tools/miri/README.md +%{_bindir}/cargo-miri +%{_bindir}/miri + %changelog diff --git a/rustc-1.32.0-src.tar.xz b/rustc-1.32.0-src.tar.xz deleted file mode 100644 index a5e9158..0000000 --- a/rustc-1.32.0-src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d617a7dc39daaafa8256320991005fc376c8ef2080593918301b24466d0067af -size 99602696 diff --git a/rustc-1.33.0-src.tar.xz b/rustc-1.33.0-src.tar.xz new file mode 100644 index 0000000..1116aac --- /dev/null +++ b/rustc-1.33.0-src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4b1a72f1a29b23dcc9d7be5f60878f0434560513273906aa93dcd5c0de39b71 +size 100635400 From 5f1b3154bd578fd57b9406f2c53cafddc1ee676219e7ce0e792c94cb08f2251b Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Tue, 5 Mar 2019 04:37:49 +0000 Subject: [PATCH 02/11] Accepting request 681589 from home:luke_nukem:branches:devel:languages:rust - 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 OBS-URL: https://build.opensuse.org/request/show/681589 OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=197 --- depreciated-trim_left_matches.patch | 12 ++++++++++++ rust.changes | 7 +++++++ rust.spec | 27 ++++----------------------- 3 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 depreciated-trim_left_matches.patch diff --git a/depreciated-trim_left_matches.patch b/depreciated-trim_left_matches.patch new file mode 100644 index 0000000..482c547 --- /dev/null +++ b/depreciated-trim_left_matches.patch @@ -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, diff --git a/rust.changes b/rust.changes index 65521c2..a24c6a5 100644 --- a/rust.changes +++ b/rust.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Mar 4 08:17:43 UTC 2019 - Luke Jones + +- 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 diff --git a/rust.spec b/rust.spec index 0e447f4..1bb5019 100644 --- a/rust.spec +++ b/rust.spec @@ -97,6 +97,8 @@ 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 +# PATCH-FIX-OPENSUSE: replace depreciated trim_left_matches with trim_start_matches +Patch1: depreciated-trim_left_matches.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. @@ -302,19 +304,6 @@ BuildArch: noarch %description -n cargo-doc This package includes HTML documentation for Cargo. -%package -n cargo-miri -Version: %{version} -Release: 0 -Summary: Interpretor for Rust MIR -License: MIT OR Apache-2.0 -Group: Development/Languages/Rust -Requires: cargo = %{version} - -%description -n cargo-miri -An interpreter for Rust's mid-level intermediate representation (MIR). -It can run binaries and test suites of cargo projects and detect certain -classes of undefined behavior. - %prep %if %{with rust_bootstrap} %ifarch x86_64 @@ -353,6 +342,7 @@ classes of undefined behavior. %setup -q -n rustc-%{version}-src %patch0 -p1 +%patch1 -p1 # use python3 sed -i -e "1s|#!.*|#!%{_bindir}/python3|" x.py @@ -514,6 +504,7 @@ rm -rf %{buildroot}%{_sysconfdir} %{rustlibdir}/%{rust_triple}/codegen-backends/ %exclude %{_docdir}/%{name}/html %exclude %{rustlibdir}/src +%exclude %{_bindir}/*miri %files -n rust-std-static %dir %{rustlibdir} @@ -592,14 +583,4 @@ rm -rf %{buildroot}%{_sysconfdir} %dir %{_docdir}/cargo %{_docdir}/cargo/html -%files -n cargo-miri -%if 0%{?suse_version} == 1315 -%doc src/tools/miri/LICENSE-{APACHE,MIT} -%else -%license src/tools/miri/LICENSE-{APACHE,MIT} -%endif -%doc src/tools/miri/README.md -%{_bindir}/cargo-miri -%{_bindir}/miri - %changelog From fe6a19e7a1daf6b567e28bbfa87fdbcc2eb9a5af30b2fdae040333e4a9e7dfc7 Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Wed, 6 Mar 2019 20:31:21 +0000 Subject: [PATCH 03/11] Accepting request 682056 from home:luke_nukem:branches:devel:languages:rust - Separate the bootstrap version from the minimum required system version for package builds. OBS-URL: https://build.opensuse.org/request/show/682056 OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=199 --- rust.changes | 6 ++++++ rust.spec | 34 ++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/rust.changes b/rust.changes index a24c6a5..2feec07 100644 --- a/rust.changes +++ b/rust.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Mar 6 09:07:43 UTC 2019 - Luke Jones + +- Separate the bootstrap version from the minimum required system + version for package builds. + ------------------------------------------------------------------- Mon Mar 4 08:17:43 UTC 2019 - Luke Jones diff --git a/rust.spec b/rust.spec index 1bb5019..e6448ad 100644 --- a/rust.spec +++ b/rust.spec @@ -17,7 +17,9 @@ # -%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.33.0 +Version: %{version_current} Release: 0 Summary: A systems programming language License: MIT OR Apache-2.0 @@ -87,14 +89,14 @@ 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 @@ -144,13 +146,13 @@ BuildRequires: llvm-devel >= 7.0 %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 From 2d62c78c648fc318945421f77f9f1ad764b0ff9da65095d586523227e11d1fcc Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Thu, 7 Mar 2019 00:04:55 +0000 Subject: [PATCH 04/11] OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=200 --- rust.spec | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rust.spec b/rust.spec index e6448ad..7021602 100644 --- a/rust.spec +++ b/rust.spec @@ -309,34 +309,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 From 3dbbcc65f4bdcebcb6a0084cfab6a707fb357f838a0de717677eb875852fd6d4 Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Sun, 10 Mar 2019 03:05:45 +0000 Subject: [PATCH 05/11] OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=201 --- _constraints | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_constraints b/_constraints index 03dc120..b1c6bb0 100644 --- a/_constraints +++ b/_constraints @@ -6,7 +6,7 @@ 8 - 25 + 60 From a96ee8dda37c552018fd44a3e77155a8c6f70cf22e336c0c78b8011d5d687e34 Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Tue, 19 Mar 2019 04:04:52 +0000 Subject: [PATCH 06/11] Accepting request 686253 from home:luke_nukem:branches:devel:languages:rust - 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 OBS-URL: https://build.opensuse.org/request/show/686253 OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=202 --- rust-rpmlintrc | 8 ++++++++ rust.changes | 14 +++++++++++++- rust.spec | 36 ++++++++++++++++++++---------------- 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/rust-rpmlintrc b/rust-rpmlintrc index e61d9c9..c1f27aa 100644 --- a/rust-rpmlintrc +++ b/rust-rpmlintrc @@ -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.*") \ No newline at end of file diff --git a/rust.changes b/rust.changes index 2feec07..e7cffb8 100644 --- a/rust.changes +++ b/rust.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Sat Mar 16 01:19:22 UTC 2019 - Luke Jones + +- 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 @@ -20,7 +32,7 @@ Sat Mar 2 05:17:36 UTC 2019 - Luke Jones `#[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 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. diff --git a/rust.spec b/rust.spec index 7021602..6289d08 100644 --- a/rust.spec +++ b/rust.spec @@ -13,7 +13,7 @@ # 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/ # @@ -101,6 +101,7 @@ Source107: %{dl_url}/rust-%{version_bootstrap}-s390x-unknown-linux-gnu.tar. 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. @@ -141,7 +142,7 @@ 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 @@ -204,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 @@ -293,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 @@ -356,6 +354,12 @@ 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/ @@ -369,9 +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 - -# Fix rpmlint warnings about these shell scripts not having a shebang or incorrect path -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 \ @@ -381,9 +384,11 @@ 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 \ @@ -459,16 +464,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 '{}' '+' # 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 @@ -482,6 +484,9 @@ ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html install -D %{buildroot}%{_sysconfdir}/bash_completion.d/cargo %{buildroot}%{_datadir}/bash-completion/completions/cargo # There should be nothing here at all rm -rf %{buildroot}%{_sysconfdir} +# miri is experimental, we should not package it +rm -rf %{buildroot}%{_bindir}/miri +rm -rf %{buildroot}%{_bindir}/cargo-miri %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -506,7 +511,6 @@ rm -rf %{buildroot}%{_sysconfdir} %{rustlibdir}/%{rust_triple}/codegen-backends/ %exclude %{_docdir}/%{name}/html %exclude %{rustlibdir}/src -%exclude %{_bindir}/*miri %files -n rust-std-static %dir %{rustlibdir} From d66cfe6b03331f9a8fc7f03697ff10d7b7bbbb5e32ae79860569372f8af3d1ea Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Tue, 19 Mar 2019 04:19:54 +0000 Subject: [PATCH 07/11] OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=203 --- _constraints | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/_constraints b/_constraints index b1c6bb0..2846a6a 100644 --- a/_constraints +++ b/_constraints @@ -48,4 +48,16 @@ + + + s390x + ppc64 + ppc64le + + + + 25 + + + From b7b40c9b10fde63e6b3815462e66f1aced31a76ce9732fda5a7e0d36584244fc Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Tue, 19 Mar 2019 04:26:22 +0000 Subject: [PATCH 08/11] OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=204 --- _constraints | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_constraints b/_constraints index 2846a6a..a295ba1 100644 --- a/_constraints +++ b/_constraints @@ -9,6 +9,7 @@ 60 + i586 @@ -25,6 +26,7 @@ + x86_64 @@ -35,6 +37,7 @@ + aarch64 @@ -48,6 +51,7 @@ + s390x From 499261084db48c4604a902989102f3a86ed98f6b49b51d26ff369e3ca93f59cb Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Tue, 19 Mar 2019 20:36:34 +0000 Subject: [PATCH 09/11] OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=205 --- _constraints | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_constraints b/_constraints index a295ba1..13036c9 100644 --- a/_constraints +++ b/_constraints @@ -35,6 +35,9 @@ 8 + + 25 + From 2bda63b681ac669f99a628ff97790cb00e7a33055f6cb46705fc84b98466eae1 Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Fri, 22 Mar 2019 00:05:38 +0000 Subject: [PATCH 10/11] Accepting request 687478 from home:luke_nukem:branches:devel:languages:rust - Explicitly build only a subset of tools OBS-URL: https://build.opensuse.org/request/show/687478 OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=206 --- rust.changes | 5 +++++ rust.spec | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rust.changes b/rust.changes index e7cffb8..38a7a17 100644 --- a/rust.changes +++ b/rust.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 22 00:02:26 UTC 2019 - Luke Jones + +- Explicitly build only a subset of tools + ------------------------------------------------------------------- Sat Mar 16 01:19:22 UTC 2019 - Luke Jones diff --git a/rust.spec b/rust.spec index 6289d08..a8663bf 100644 --- a/rust.spec +++ b/rust.spec @@ -395,8 +395,8 @@ chmod +x src/libcore/unicode/printable.py --disable-rpath \ %{debug_info} \ %{codegen_units} \ - --enable-extended \ --enable-vendor \ + --tools="cargo","rls","clippy","rustfmt","analysis","src" \ --release-channel="stable" # Sometimes we may be rebuilding with the same compiler, @@ -484,9 +484,6 @@ ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html install -D %{buildroot}%{_sysconfdir}/bash_completion.d/cargo %{buildroot}%{_datadir}/bash-completion/completions/cargo # There should be nothing here at all rm -rf %{buildroot}%{_sysconfdir} -# miri is experimental, we should not package it -rm -rf %{buildroot}%{_bindir}/miri -rm -rf %{buildroot}%{_bindir}/cargo-miri %post -p /sbin/ldconfig %postun -p /sbin/ldconfig From 5fd278d08a20e266d3b17322e5f56cff14b0c9d6315e1c414092cc456138cd8f Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Fri, 22 Mar 2019 10:36:36 +0000 Subject: [PATCH 11/11] Accepting request 687571 from home:luke_nukem:branches:devel:languages:rust Correct lack of bash completion OBS-URL: https://build.opensuse.org/request/show/687571 OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=207 --- rust.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/rust.spec b/rust.spec index a8663bf..f49ab7e 100644 --- a/rust.spec +++ b/rust.spec @@ -396,6 +396,7 @@ chmod +x src/libcore/unicode/printable.py %{debug_info} \ %{codegen_units} \ --enable-vendor \ + --enable-extended \ --tools="cargo","rls","clippy","rustfmt","analysis","src" \ --release-channel="stable"