Update to 1.46.0.

I've unbundled libgit2 for fedora >= 32, where we have libgit2-1.0.1.

I've also pulled in some RHEL config and patches I had in other
branches, but these should end up as no-ops for Fedora.
This commit is contained in:
Josh Stone 2020-08-27 10:49:15 -07:00
parent 99cf40c754
commit 105a7c0012
8 changed files with 266 additions and 54 deletions

8
.gitignore vendored
View File

@ -289,3 +289,11 @@
/rust-1.44.0-s390x-unknown-linux-gnu.tar.xz
/rustc-1.45.1-src.tar.xz
/rustc-1.45.2-src.tar.xz
/rustc-1.46.0-src.tar.xz
/rust-1.45.2-aarch64-unknown-linux-gnu.tar.xz
/rust-1.45.2-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.45.2-i686-unknown-linux-gnu.tar.xz
/rust-1.45.2-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.45.2-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.45.2-s390x-unknown-linux-gnu.tar.xz
/rust-1.45.2-x86_64-unknown-linux-gnu.tar.xz

View File

@ -0,0 +1,29 @@
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

137
rust.spec
View File

@ -9,10 +9,10 @@
# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
# or nightly wants some beta-YYYY-MM-DD
# Note that cargo matches the program version here, not its crate version.
%global bootstrap_rust 1.44.0
%global bootstrap_cargo 1.44.0
%global bootstrap_channel 1.44.0
%global bootstrap_date 2020-06-04
%global bootstrap_rust 1.45.2
%global bootstrap_cargo 1.45.2
%global bootstrap_channel 1.45.2
%global bootstrap_date 2020-08-03
# Only the specified arches will use bootstrap binaries.
#global bootstrap_arches %%{rust_arches}
@ -22,33 +22,37 @@
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM
# is insufficient. Rust currently requires LLVM 8.0+.
%if 0%{?rhel} && !0%{?epel}
%bcond_without bundled_llvm
%else
%bcond_with bundled_llvm
# Requires stable libgit2 1.0
%if 0%{?fedora} >= 32
%bcond_with bundled_libgit2
%else
%bcond_without bundled_libgit2
%endif
# libgit2-sys expects to use its bundled library, which is sometimes just a
# snapshot of libgit2's master branch. This can mean the FFI declarations
# won't match our released libgit2.so, e.g. having changed struct fields.
# So, tread carefully if you toggle this...
%bcond_without bundled_libgit2
%if 0%{?rhel}
%bcond_without bundled_libssh2
# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
%bcond_without disabled_libssh2
%else
%bcond_with bundled_libssh2
%bcond_with disabled_libssh2
%endif
%if 0%{?rhel} && 0%{?rhel} < 8
%bcond_with curl_http2
%else
%bcond_without curl_http2
%endif
# LLDB isn't available everywhere...
%if !0%{?rhel}
%bcond_without lldb
%else
%if 0%{?rhel} && 0%{?rhel} < 8
%bcond_with lldb
%else
%bcond_without lldb
%endif
Name: rust
Version: 1.45.2
Version: 1.46.0
Release: 1%{?dist}
Summary: The Rust Programming Language
License: (ASL 2.0 or MIT) and (BSD and MIT)
@ -63,6 +67,23 @@ ExclusiveArch: %{rust_arches}
%endif
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
# https://github.com/rust-lang/cargo/pull/8598
Patch1: 0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch
### RHEL-specific patches below ###
# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
Patch100: rustc-1.42.0-disable-libssh2.patch
# libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys
# will try to build it statically -- instead we turn off the feature.
Patch101: rustc-1.45.0-disable-http2.patch
# kernel rh1410097 causes too-small stacks for PIE.
# (affects RHEL6 kernels when building for RHEL7)
Patch102: rustc-1.45.0-no-default-pie.patch
# Get the Rust triple for any arch.
%{lua: function rust_triple(arch)
local abi = "gnu"
@ -73,6 +94,8 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
arch = "powerpc64"
elseif arch == "ppc64le" then
arch = "powerpc64le"
elseif arch == "riscv64" then
arch = "riscv64gc"
end
return arch.."-unknown-linux-"..abi
end}
@ -106,11 +129,11 @@ end}
Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust}
%else
BuildRequires: cargo >= %{bootstrap_cargo}
%if 0%{?fedora} >= 27
BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version})
%else
%if 0%{?rhel} && 0%{?rhel} < 8
BuildRequires: %{name} >= %{bootstrap_rust}
BuildConflicts: %{name} > %{version}
%else
BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version})
%endif
%global local_rust_root %{_prefix}
%endif
@ -120,6 +143,8 @@ BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: ncurses-devel
BuildRequires: curl
# explicit curl-devel to avoid httpd24-curl (rhbz1540167)
BuildRequires: curl-devel
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(openssl)
@ -129,16 +154,12 @@ BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(libgit2) >= 1.0.0
%endif
%if %without bundled_libssh2
%if %{without disabled_libssh2} && %{without bundled_libssh2}
# needs libssh2_userauth_publickey_frommemory
BuildRequires: pkgconfig(libssh2) >= 1.6.0
%endif
%if 0%{?rhel} && 0%{?rhel} <= 7
%global python python2
%else
%global python python3
%endif
BuildRequires: %{python}
%if %with bundled_llvm
@ -146,7 +167,7 @@ BuildRequires: cmake3 >= 3.4.3
Provides: bundled(llvm) = 10.0.1
%else
BuildRequires: cmake >= 2.8.11
%if 0%{?epel}
%if 0%{?epel} == 7
%global llvm llvm9.0
%endif
%if %defined llvm
@ -192,14 +213,14 @@ Requires: /usr/bin/cc
# While we don't want to encourage dynamic linking to Rust shared libraries, as
# there's no stable ABI, we still need the unallocated metadata (.rustc) to
# support custom-derive plugins like #[proc_macro_derive(Foo)]. But eu-strip is
# very eager by default, so we have to limit it to -g, only debugging symbols.
%if 0%{?fedora} >= 27
# Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997
%global _find_debuginfo_opts --keep-section .rustc
%else
# support custom-derive plugins like #[proc_macro_derive(Foo)].
%if 0%{?rhel} && 0%{?rhel} < 8
# eu-strip is very eager by default, so we have to limit it to -g, only debugging symbols.
%global _find_debuginfo_opts -g
%undefine _include_minidebuginfo
%else
# Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997
%global _find_debuginfo_opts --keep-section .rustc
%endif
# Use hardening ldflags.
@ -251,11 +272,7 @@ programs.
Summary: LLDB pretty printers for Rust
BuildArch: noarch
Requires: lldb
%if 0%{?fedora} >= 31
Requires: python3-lldb
%else
Requires: python2-lldb
%endif
Requires: %{python}-lldb
Requires: %{name}-debugger-common = %{version}-%{release}
%description lldb
@ -391,8 +408,24 @@ test -f '%{local_rust_root}/bin/rustc'
%setup -q -n %{rustc_package}
%if "%{python}" == "python3"
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
%patch1 -p1 -d src/tools/cargo
%if %with disabled_libssh2
%patch100 -p1
%endif
%if %without curl_http2
%patch101 -p1
rm -rf vendor/libnghttp2-sys/
%endif
%if 0%{?rhel} && 0%{?rhel} < 8
%patch102 -p1 -b .no-pie
%endif
%if "%{python}" != "python3"
# Use our preferred python first
sed -i.try-python -e '/^try python3 /i try "%{python}" "$@"' ./configure
%endif
%if %without bundled_llvm
@ -413,6 +446,9 @@ rm -rf vendor/libgit2-sys/libgit2/
%if %without bundled_libssh2
rm -rf vendor/libssh2-sys/libssh2/
%endif
%if %with disabled_libssh2
rm -rf vendor/libssh2-sys/
%endif
# 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
@ -420,7 +456,7 @@ 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 bundled_llvm} && 0%{?epel}
%if %{with bundled_llvm} && 0%{?epel} == 7
mkdir -p cmake-bin
ln -s /usr/bin/cmake3 cmake-bin/cmake
%global cmake_path $PWD/cmake-bin
@ -472,7 +508,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
%ifarch %{arm} %{ix86} s390x
# full debuginfo is exhausting memory; just do libstd for now
# https://github.com/rust-lang/rust/issues/45854
%if (0%{?fedora} && 0%{?fedora} < 27) || (0%{?rhel} && 0%{?rhel} <= 7)
%if 0%{?rhel} && 0%{?rhel} < 8
# Older rpmbuild didn't work with partial debuginfo coverage.
%global debug_package %{nil}
%define enable_debuginfo --debuginfo-level=0
@ -490,6 +526,14 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
%define codegen_units_std --set rust.codegen-units-std=1
%endif
# Some builders have relatively little memory for their CPU count.
# At least 2GB per CPU is a good rule of thumb for building rustc.
ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN)
max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 2 ))
if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then
ncpus="$max_cpus"
fi
%configure --disable-option-checking \
--libdir=%{common_libdir} \
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
@ -507,7 +551,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
%{?codegen_units_std} \
--release-channel=%{channel}
%{python} ./x.py build
%{python} ./x.py build -j "$ncpus" --stage 2
%{python} ./x.py doc
@ -621,7 +665,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%files debugger-common
%dir %{rustlibdir}
%dir %{rustlibdir}/etc
%{rustlibdir}/etc/debugger_*.py*
%{rustlibdir}/etc/rust_*.py*
%files gdb
@ -700,6 +744,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%changelog
* Thu Aug 27 2020 Josh Stone <jistone@redhat.com> - 1.46.0-1
- Update to 1.46.0.
* Mon Aug 03 2020 Josh Stone <jistone@redhat.com> - 1.45.2-1
- Update to 1.45.2.

View File

@ -0,0 +1,42 @@
--- rustc-1.42.0-src/Cargo.lock.orig 2020-03-09 15:11:17.000000000 -0700
+++ rustc-1.42.0-src/Cargo.lock 2020-04-02 16:39:22.268896227 -0700
@@ -1796,7 +1796,6 @@
dependencies = [
"cc",
"libc",
- "libssh2-sys",
"libz-sys",
"openssl-sys",
"pkg-config",
@@ -1813,20 +1812,6 @@
]
[[package]]
-name = "libssh2-sys"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36aa6e813339d3a063292b77091dfbbb6152ff9006a459895fa5bebed7d34f10"
-dependencies = [
- "cc",
- "libc",
- "libz-sys",
- "openssl-sys",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
name = "libz-sys"
version = "1.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
--- rustc-1.42.0-src/vendor/git2/Cargo.toml.orig 2020-03-09 17:00:19.000000000 -0700
+++ rustc-1.42.0-src/vendor/git2/Cargo.toml 2020-04-02 16:38:46.163664007 -0700
@@ -55,7 +55,7 @@
version = "0.1.39"
[features]
-default = ["ssh", "https", "ssh_key_from_memory"]
+default = ["https"]
https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"]
ssh = ["libgit2-sys/ssh"]
ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"]

View File

@ -0,0 +1,66 @@
--- rustc-1.45.0-src/Cargo.lock.orig 2020-07-13 09:27:24.000000000 -0700
+++ rustc-1.45.0-src/Cargo.lock 2020-07-16 12:12:32.253903599 -0700
@@ -896,7 +896,6 @@
dependencies = [
"cc",
"libc",
- "libnghttp2-sys",
"libz-sys",
"openssl-sys",
"pkg-config",
@@ -1875,16 +1874,6 @@
]
[[package]]
-name = "libnghttp2-sys"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02254d44f4435dd79e695f2c2b83cd06a47919adea30216ceaf0c57ca0a72463"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[package]]
name = "libz-sys"
version = "1.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
--- rustc-1.45.0-src/src/tools/cargo/Cargo.toml.orig 2020-07-13 09:27:49.000000000 -0700
+++ rustc-1.45.0-src/src/tools/cargo/Cargo.toml 2020-07-16 12:12:32.253903599 -0700
@@ -25,7 +25,7 @@
crates-io = { path = "crates/crates-io", version = "0.31.1" }
crossbeam-utils = "0.7"
crypto-hash = "0.3.1"
-curl = { version = "0.4.23", features = ["http2"] }
+curl = { version = "0.4.23", features = [] }
curl-sys = "0.4.22"
env_logger = "0.7.0"
pretty_env_logger = { version = "0.4", optional = true }
--- rustc-1.45.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-07-13 09:27:49.000000000 -0700
+++ rustc-1.45.0-src/src/tools/cargo/src/cargo/core/package.rs 2020-07-16 12:12:32.253903599 -0700
@@ -393,14 +393,8 @@
// Also note that pipelining is disabled as curl authors have indicated
// that it's buggy, and we've empirically seen that it's buggy with HTTP
// proxies.
- let mut multi = Multi::new();
- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true);
- multi
- .pipelining(false, multiplexing)
- .chain_err(|| "failed to enable multiplexing/pipelining in curl")?;
-
- // let's not flood crates.io with connections
- multi.set_max_host_connections(2)?;
+ let multi = Multi::new();
+ let multiplexing = false;
Ok(PackageSet {
packages: package_ids
@@ -563,7 +557,7 @@
macro_rules! try_old_curl {
($e:expr, $msg:expr) => {
let result = $e;
- if cfg!(target_os = "macos") {
+ if cfg!(any(target_os = "linux", target_os = "macos")) {
if let Err(e) = result {
warn!("ignoring libcurl {} error: {}", $msg, e);
}

View File

@ -0,0 +1,20 @@
diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
index dcce1d45298c..5c11f7276f26 100644
--- a/src/librustc_codegen_ssa/back/link.rs
+++ b/src/librustc_codegen_ssa/back/link.rs
@@ -1184,10 +1184,12 @@ fn exec_linker(
}
fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind {
- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) {
- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe,
+ // Only use PIE if explicity specified.
+ let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic));
+ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) {
+ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe,
(CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe,
- (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe,
+ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe,
(CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe,
(_, true, _) => LinkOutputKind::StaticDylib,
(_, false, _) => LinkOutputKind::DynamicDylib,

View File

@ -1 +1 @@
SHA512 (rustc-1.45.2-src.tar.xz) = cc6250c0bc844e77ca6dd7ae013e434ed3009b001914114866ed31f28edf3960221454d131e298b15050e3b8153fb8298d509559c2f7307c64611aa8e36b4d25
SHA512 (rustc-1.46.0-src.tar.xz) = 099857f1d295043587a4e2a65ef3e6a90e12c8b6958e98535a1656c113c553f9a9b621aba8a19cf21bd8d2c79d27cbfa4b8e6fabbcb3cbfee23b545be7b450b4

View File

@ -1,8 +1,8 @@
SHA512 (rustc-1.45.2-src.tar.xz) = cc6250c0bc844e77ca6dd7ae013e434ed3009b001914114866ed31f28edf3960221454d131e298b15050e3b8153fb8298d509559c2f7307c64611aa8e36b4d25
SHA512 (rust-1.44.0-x86_64-unknown-linux-gnu.tar.xz) = 25c762e07e178ffc1b96b4a113e437541d6dc18bd81fb9933af676e99ca391c6cdd8d420caabcfca1b3ddb987a84ff9eb1d0bdb3cca486e71925555f51ecaa4c
SHA512 (rust-1.44.0-i686-unknown-linux-gnu.tar.xz) = 85ee1d7cd4581d9cdc18f0cfe89b0c78c32039f658b85c5f6a60ac8047864234bdff955e02d6e15ae40dd98e8e27cb3d83fab978dba6373f9e487cfd2ba0b594
SHA512 (rust-1.44.0-armv7-unknown-linux-gnueabihf.tar.xz) = 59fd1f0dc058118a838c4c3c66dd5a5c2acb1b05ebf4525188846577cb22c4b46a57605d6a9cede5fbd34c0b5c638434a186d1ce3693ace6be8105c265b59b7b
SHA512 (rust-1.44.0-aarch64-unknown-linux-gnu.tar.xz) = c853a585bd76730a9ed1e95c12baf2939928fd3c5ba7cc0f95c03ec472c0012f01d0b7d7c37e21dfdcc1d1eca4c7e392709a2585e42bc759b636e95b4ab870d0
SHA512 (rust-1.44.0-powerpc64-unknown-linux-gnu.tar.xz) = dff9aa248cd0efd1b28c6254c040cd30356ce973a3ed525530db783d6f7ebcdd32568bfa5c68c2aba0bb312ee74f03d1c91361e69830fe79ddd4d31e73fc2865
SHA512 (rust-1.44.0-powerpc64le-unknown-linux-gnu.tar.xz) = d74802fc29641d08b5e5d526e91258c71d914daf0f33abea71ad7d300da4ae39d457b9d4e95b0b0811ec8ed5e60e7d0292e8e928f3079189e07887ce115bd466
SHA512 (rust-1.44.0-s390x-unknown-linux-gnu.tar.xz) = 39fac45e0c1e8786275ba30ed13d13334c7f0fc03d653a3e0a3e174d18e244d9e4bb99614ed1465e7a21befb2542ed4d3a54d4ea2702da449b1e6a7770a43970
SHA512 (rustc-1.46.0-src.tar.xz) = 099857f1d295043587a4e2a65ef3e6a90e12c8b6958e98535a1656c113c553f9a9b621aba8a19cf21bd8d2c79d27cbfa4b8e6fabbcb3cbfee23b545be7b450b4
SHA512 (rust-1.45.2-aarch64-unknown-linux-gnu.tar.xz) = b4b3fb198bf85192563fb8b6017cf07f92b9c26d6e590efa9476aa878871839315db935e3353c664e635a229f17b0979bcfd31488e29e02ce0dc266d252b9e41
SHA512 (rust-1.45.2-armv7-unknown-linux-gnueabihf.tar.xz) = dbf36643e87fc31cda5c0d5fc8b1589ce80531a94379060106ce81d525cd77c36ac6f89d5ae05d8872020baf31e5391422ed58c01ec6f801428d67e2e10896fb
SHA512 (rust-1.45.2-i686-unknown-linux-gnu.tar.xz) = afe81d38d8692e5792e111c3b2c83da4dffa99c9a8a89b5f1e10a6e449e49d4dd19d68c96d7b2f5013054d141bf4b1a08da1c2b877c7bbe87f81c19232020ecb
SHA512 (rust-1.45.2-powerpc64le-unknown-linux-gnu.tar.xz) = 6cb169efae4c847ba204fa24c1f40b4320e53928ab8966727971a5bc7a565eaa6142f40904cec93927543b25450db23d816c20653f53d3aa36ac616fe85ee6ba
SHA512 (rust-1.45.2-powerpc64-unknown-linux-gnu.tar.xz) = fbf909e5f9135d5216dbbc1be0d1e3159000c58b83bcdeb9839a12f5a9ff56261a61edfab93cd21800a90ff56bb9eff8a1ad83c60fa54bf0cf4b149219dbe914
SHA512 (rust-1.45.2-s390x-unknown-linux-gnu.tar.xz) = 7727cfbeed29e8a1e79398392332b25b5498900f593f3d08414c70b44da0cd06dca0791a361956c47c3367e6572d59d885085d3cd99fd4a9c28c431a158ddbfd
SHA512 (rust-1.45.2-x86_64-unknown-linux-gnu.tar.xz) = dfd3ce0cc42ae82a2d13866c5c94c304b031e253a1485ccc1d6ecd62cc05018b01ac7b2183297bc45ada286b5e91d1344aa3d8417694ab834f8265c7838b4fd2