Updated to 1.47.0

This commit is contained in:
Alzim 2020-10-21 01:14:22 +03:00
parent 40102fbffa
commit 751e7340f8
6 changed files with 103 additions and 187 deletions

View file

@ -1,5 +1,5 @@
sources: sources:
rust-1.45.2-aarch64-unknown-linux-gnu.tar.xz: 482602a622df75ea83e17a2c60986a7635055e5f rust-1.46.0-aarch64-unknown-linux-gnu.tar.xz: 7e321a3c787370000a3d82b290fab1e3cd24ff70
rust-1.45.2-i686-unknown-linux-gnu.tar.xz: 88aa07ce9a2dd265f18a6179fd78493a7cff043d rust-1.46.0-i686-unknown-linux-gnu.tar.xz: b0a27f94bbfe7b19ed5dfbe2635a52fe5e694077
rust-1.45.2-x86_64-unknown-linux-gnu.tar.xz: 654f5ddbda9725c43d05079d69461448f940165c rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz: ae9b6f51bf29a7bcc093055d1234459a688891fc
rustc-1.46.0-src.tar.xz: 7fe631f9d8eb27a1443db17431b8922ca97cffe5 rustc-1.47.0-src.tar.xz: 7c74bea0e1db296aa0cf8c6e0b6fb1d392b62c0c

View file

@ -1,29 +0,0 @@
From 02fc16aece46abcd23d2ade2d969497f07fe26ab Mon Sep 17 00:00:00 2001
From: Alex Crichton <alex@alexcrichton.com>
Date: Fri, 7 Aug 2020 12:50:25 -0700
Subject: [PATCH] Fix jobserver_exists test on single-cpu systems
Closes #8595
---
tests/testsuite/jobserver.rs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/testsuite/jobserver.rs b/tests/testsuite/jobserver.rs
index 9e91c956cd75..16518ee2c614 100644
--- a/tests/testsuite/jobserver.rs
+++ b/tests/testsuite/jobserver.rs
@@ -51,7 +51,10 @@ fn jobserver_exists() {
.file("src/lib.rs", "")
.build();
- p.cargo("build").run();
+ // Explicitly use `-j2` to ensure that there's eventually going to be a
+ // token to read from `valdiate` above, since running the build script
+ // itself consumes a token.
+ p.cargo("build -j2").run();
}
#[cargo_test]
--
2.26.2

View file

@ -0,0 +1,46 @@
From f200c1e7afdd04b42c01c0108735e5b14ca07d93 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Fri, 9 Oct 2020 20:12:26 -0700
Subject: [PATCH] doc: disambiguate stat in MetadataExt::as_raw_stat
A few architectures in `os::linux::raw` import `libc::stat`, rather than
defining that type directly. However, that also imports the _function_
called `stat`, which makes this doc link ambiguous:
error: `crate::os::linux::raw::stat` is both a struct and a function
--> library/std/src/os/linux/fs.rs:21:19
|
21 | /// [`stat`]: crate::os::linux::raw::stat
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous link
|
= note: `-D broken-intra-doc-links` implied by `-D warnings`
help: to link to the struct, prefix with the item type
|
21 | /// [`stat`]: struct@crate::os::linux::raw::stat
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: to link to the function, add parentheses
|
21 | /// [`stat`]: crate::os::linux::raw::stat()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We want the `struct`, so it's now prefixed accordingly.
---
library/std/src/os/linux/fs.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/library/std/src/os/linux/fs.rs b/library/std/src/os/linux/fs.rs
index ff23c3d67e3b..9b7af97616c9 100644
--- a/library/std/src/os/linux/fs.rs
+++ b/library/std/src/os/linux/fs.rs
@@ -20,7 +20,7 @@ pub trait MetadataExt {
/// Unix platforms. The `os::unix::fs::MetadataExt` trait contains the
/// cross-Unix abstractions contained within the raw stat.
///
- /// [`stat`]: crate::os::linux::raw::stat
+ /// [`stat`]: struct@crate::os::linux::raw::stat
///
/// # Examples
///
--
2.26.2

View file

@ -0,0 +1,28 @@
From 6f8efee8c936de65bc31610eea30abd5461a5dd1 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Thu, 8 Oct 2020 15:53:49 -0700
Subject: [PATCH] use NativeEndian in symbolize::gimli::Context
`Object` uses `NativeEndian`, so the `Context` should too.
Cc: https://github.com/rust-lang/rust/issues/77410
---
src/symbolize/gimli.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/symbolize/gimli.rs b/src/symbolize/gimli.rs
index 58ed8bafca3d..273ff43f1c8c 100644
--- a/src/symbolize/gimli.rs
+++ b/src/symbolize/gimli.rs
@@ -5,7 +5,7 @@
//! intended to wholesale replace the `libbacktrace.rs` implementation.
use self::gimli::read::EndianSlice;
-use self::gimli::LittleEndian as Endian;
+use self::gimli::NativeEndian as Endian;
use self::mmap::Mmap;
use self::stash::Stash;
use super::BytesOrWideString;
--
2.26.2

View file

@ -1,133 +0,0 @@
From 2c9deaabf99dab9998f6ddbbe496d19ff7ce31f0 Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
Date: Fri, 28 Aug 2020 21:56:45 +0200
Subject: [PATCH 2/2] Fix LTO with doctests
---
.../src/cargo/core/compiler/context/mod.rs | 3 +-
.../cargo/src/cargo/core/compiler/mod.rs | 59 +++++----------
src/tools/cargo/src/cargo/core/profiles.rs | 7 +-
src/tools/cargo/tests/testsuite/lto.rs | 71 ++++++++++++++++---
4 files changed, 85 insertions(+), 55 deletions(-)
diff --git a/src/tools/cargo/src/cargo/core/compiler/context/mod.rs b/src/tools/cargo/src/cargo/core/compiler/context/mod.rs
index 52b954dd1..82831f423 100644
--- a/src/tools/cargo/src/cargo/core/compiler/context/mod.rs
+++ b/src/tools/cargo/src/cargo/core/compiler/context/mod.rs
@@ -210,7 +210,8 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
// Collect information for `rustdoc --test`.
if unit.mode.is_doc_test() {
let mut unstable_opts = false;
- let args = compiler::extern_args(&self, unit, &mut unstable_opts)?;
+ let mut args = compiler::extern_args(&self, unit, &mut unstable_opts)?;
+ args.extend(compiler::lto_args(&self, unit));
self.compilation.to_doc_test.push(compilation::Doctest {
unit: unit.clone(),
args,
diff --git a/src/tools/cargo/src/cargo/core/compiler/mod.rs b/src/tools/cargo/src/cargo/core/compiler/mod.rs
index 9399c5042..47d2b9bb4 100644
--- a/src/tools/cargo/src/cargo/core/compiler/mod.rs
+++ b/src/tools/cargo/src/cargo/core/compiler/mod.rs
@@ -783,49 +783,9 @@ fn build_base_args(
cmd.arg("-C").arg(format!("panic={}", panic));
}
- match cx.lto[unit] {
- lto::Lto::Run(None) => {
- cmd.arg("-C").arg("lto");
- }
- lto::Lto::Run(Some(s)) => {
- cmd.arg("-C").arg(format!("lto={}", s));
- }
- lto::Lto::Off => {
- cmd.arg("-C").arg("lto=off");
- }
- lto::Lto::ObjectAndBitcode => {} // this is rustc's default
- lto::Lto::OnlyBitcode => {
- // Note that this compiler flag, like the one below, is just an
- // optimization in terms of build time. If we don't pass it then
- // both object code and bitcode will show up. This is lagely just
- // compat until the feature lands on stable and we can remove the
- // conditional branch.
- if cx
- .bcx
- .target_data
- .info(CompileKind::Host)
- .supports_embed_bitcode
- .unwrap()
- {
- cmd.arg("-Clinker-plugin-lto");
- }
- }
- lto::Lto::OnlyObject => {
- if cx
- .bcx
- .target_data
- .info(CompileKind::Host)
- .supports_embed_bitcode
- .unwrap()
- {
- cmd.arg("-Cembed-bitcode=no");
- }
- }
- }
+ cmd.args(&lto_args(cx, unit));
if let Some(n) = codegen_units {
- // There are some restrictions with LTO and codegen-units, so we
- // only add codegen units when LTO is not used.
cmd.arg("-C").arg(&format!("codegen-units={}", n));
}
@@ -952,6 +912,23 @@ fn build_base_args(
Ok(())
}
+fn lto_args(cx: &Context<'_, '_>, unit: &Unit) -> Vec<OsString> {
+ let mut result = Vec::new();
+ let mut push = |arg: &str| {
+ result.push(OsString::from("-C"));
+ result.push(OsString::from(arg));
+ };
+ match cx.lto[unit] {
+ lto::Lto::Run(None) => push("lto"),
+ lto::Lto::Run(Some(s)) => push(&format!("lto={}", s)),
+ lto::Lto::Off => push("lto=off"),
+ lto::Lto::ObjectAndBitcode => {} // this is rustc's default
+ lto::Lto::OnlyBitcode => push("linker-plugin-lto"),
+ lto::Lto::OnlyObject => push("embed-bitcode=no"),
+ }
+ result
+}
+
fn build_deps_args(
cmd: &mut ProcessBuilder,
cx: &mut Context<'_, '_>,
diff --git a/src/tools/cargo/src/cargo/core/profiles.rs b/src/tools/cargo/src/cargo/core/profiles.rs
index 6a28bd261..ca0c2e417 100644
--- a/src/tools/cargo/src/cargo/core/profiles.rs
+++ b/src/tools/cargo/src/cargo/core/profiles.rs
@@ -302,7 +302,7 @@ impl Profiles {
};
match mode {
- CompileMode::Test | CompileMode::Bench => {
+ CompileMode::Test | CompileMode::Bench | CompileMode::Doctest => {
if release {
(
InternedString::new("bench"),
@@ -315,10 +315,7 @@ impl Profiles {
)
}
}
- CompileMode::Build
- | CompileMode::Check { .. }
- | CompileMode::Doctest
- | CompileMode::RunCustomBuild => {
+ CompileMode::Build | CompileMode::Check { .. } | CompileMode::RunCustomBuild => {
// Note: `RunCustomBuild` doesn't normally use this code path.
// `build_unit_profiles` normally ensures that it selects the
// ancestor's profile. However, `cargo clean -p` can hit this
--
2.26.2

View file

@ -8,7 +8,6 @@
%define __requires_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$ %define __requires_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$
%define debug_package %{nil} %define debug_package %{nil}
%define _disable_lto 1
%define _disable_ld_no_undefined 1 %define _disable_ld_no_undefined 1
# To avoid undefined symbols # To avoid undefined symbols
%define _find_debuginfo_opts -g %define _find_debuginfo_opts -g
@ -25,9 +24,9 @@
# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
# or nightly wants some beta-YYYY-MM-DD # or nightly wants some beta-YYYY-MM-DD
# Note that cargo matches the program version here, not its crate version. # Note that cargo matches the program version here, not its crate version.
%define bootstrap_rust 1.45.2 %define bootstrap_rust 1.46.0
%define bootstrap_cargo 1.45.2 %define bootstrap_cargo 1.46.0
%define bootstrap_date 2020-08-03 %define bootstrap_date 2020-08-27
%bcond_without bootstrap %bcond_without bootstrap
@ -65,7 +64,7 @@
Summary: The Rust Programming Language Summary: The Rust Programming Language
Name: rust Name: rust
Version: 1.46.0 Version: 1.47.0
Release: 1 Release: 1
License: (ASL 2.0 or MIT) and (BSD and MIT) License: (ASL 2.0 or MIT) and (BSD and MIT)
Group: Development/Rust Group: Development/Rust
@ -77,10 +76,10 @@ Source1: https://static.rust-lang.org/dist/rust-%{bootstrap_rust}-x86_64-unknown
Source2: https://static.rust-lang.org/dist/rust-%{bootstrap_rust}-i686-unknown-linux-gnu.tar.xz Source2: https://static.rust-lang.org/dist/rust-%{bootstrap_rust}-i686-unknown-linux-gnu.tar.xz
Source3: https://static.rust-lang.org/dist/rust-%{bootstrap_rust}-aarch64-unknown-linux-gnu.tar.xz Source3: https://static.rust-lang.org/dist/rust-%{bootstrap_rust}-aarch64-unknown-linux-gnu.tar.xz
Source10: rust.rpmlintrc Source10: rust.rpmlintrc
# https://github.com/rust-lang/cargo/pull/8598 # https://github.com/rust-lang/backtrace-rs/pull/373
Patch1: 0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch Patch1: 0001-use-NativeEndian-in-symbolize-gimli-Context.patch
# https://github.com/rust-lang/cargo/pull/8657 (backported) # https://github.com/rust-lang/rust/pull/77777
Patch2: 0002-Fix-LTO-with-doctests.patch Patch2: 0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: curl BuildRequires: curl
BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(libcurl)
@ -120,7 +119,6 @@ This package includes the Rust compiler and documentation generator.
%files %files
%doc README.md COPYRIGHT LICENSE-APACHE LICENSE-MIT %doc README.md COPYRIGHT LICENSE-APACHE LICENSE-MIT
%doc vendor/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace
%{_bindir}/rustc %{_bindir}/rustc
%{_bindir}/rustdoc %{_bindir}/rustdoc
%{_libdir}/*.so %{_libdir}/*.so
@ -186,9 +184,9 @@ which allows easier debugging of Rust programs.
%files gdb %files gdb
%doc README.md COPYRIGHT LICENSE-APACHE LICENSE-MIT %doc README.md COPYRIGHT LICENSE-APACHE LICENSE-MIT
%{_bindir}/rust-gdb %{_bindir}/rust-gdb
%{rustlibdir}/etc/gdb_*.py* %{rustlibdir}/etc/gdb_*
%if %{mdvver} >= 201910 %if %{mdvver} >= 201910
%{rustlibdir}/etc/__pycache__/gdb_*.py* %{rustlibdir}/etc/__pycache__/gdb_*
%endif %endif
# %%exclude - No work! # %%exclude - No work!
#%%exclude %%{_bindir}/rust-gdbgui #%%exclude %%{_bindir}/rust-gdbgui
@ -216,7 +214,7 @@ which allows easier debugging of Rust programs.
%files lldb %files lldb
%doc README.md COPYRIGHT LICENSE-APACHE LICENSE-MIT %doc README.md COPYRIGHT LICENSE-APACHE LICENSE-MIT
%{_bindir}/rust-lldb %{_bindir}/rust-lldb
%{rustlibdir}/etc/lldb_*.py* %{rustlibdir}/etc/lldb_*
%endif %endif
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -362,7 +360,7 @@ test -f '%{local_rust_root}/bin/rustc'
%setup -qn rustc-%{version}-src %setup -qn rustc-%{version}-src
%patch1 -p1 -d src/tools/cargo %patch1 -p1 -d library/backtrace
%patch2 -p1 %patch2 -p1
# python3 # python3
@ -379,9 +377,6 @@ rm -rf vendor/openssl-src/openssl/
# This only affects the transient rust-installer, but let it use our dynamic xz-libs # This only affects the transient rust-installer, but let it use our dynamic xz-libs
sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs
# rename bundled license for packaging
cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace}
%if %{with llvm_static} %if %{with llvm_static}
# Static linking to distro LLVM needs to add -lffi # Static linking to distro LLVM needs to add -lffi
# https://github.com/rust-lang/rust/issues/34486 # https://github.com/rust-lang/rust/issues/34486
@ -409,14 +404,17 @@ export CXX=clang++
# Use hardening ldflags. # Use hardening ldflags.
%if %{without bootstrap} %if %{without bootstrap}
%ifarch x86_64 %ifarch x86_64
%define rustflags -Clink-arg=-Wl,-z,relro,-z,now -L %{rustlibdir}/%{rust_triple}/lib %global rustflags -Clink-arg=-Wl,-z,relro,-z,now -L %{rustlibdir}/%{rust_triple}/lib
%else %else
%define rustflags -Clink-arg=-Wl,-z,relro,-z,now %global rustflags -Clink-arg=-Wl,-z,relro,-z,now
%endif %endif
%else %else
%define rustflags -Clink-arg=-Wl,-z,relro,-z,now %global rustflags -Clink-arg=-Wl,-z,relro,-z,now
%endif %endif
# convince libgit2-sys to use the distro libgit2
export LIBGIT2_SYS_USE_PKG_CONFIG=1
# convince libssh2-sys to use the distro libssh2 # convince libssh2-sys to use the distro libssh2
export LIBSSH2_SYS_USE_PKG_CONFIG=1 export LIBSSH2_SYS_USE_PKG_CONFIG=1
@ -447,6 +445,12 @@ export RUSTFLAGS="%{rustflags}"
python3 ./x.py build python3 ./x.py build
%install %install
# convince libgit2-sys to use the distro libgit2
export LIBGIT2_SYS_USE_PKG_CONFIG=1
# convince libssh2-sys to use the distro libssh2
export LIBSSH2_SYS_USE_PKG_CONFIG=1
export RUSTFLAGS="%{rustflags}" export RUSTFLAGS="%{rustflags}"
DESTDIR=%{buildroot} python3 ./x.py install DESTDIR=%{buildroot} python3 ./x.py install
@ -495,5 +499,5 @@ mkdir -p %{buildroot}%{_datadir}/cargo/registry
%if %{without lldb} %if %{without lldb}
rm -f %{buildroot}%{_bindir}/rust-lldb rm -f %{buildroot}%{_bindir}/rust-lldb
rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* rm -f %{buildroot}%{rustlibdir}/etc/lldb_*
%endif %endif