Merge branch 'master' into beta

This commit is contained in:
Josh Stone 2019-01-09 14:27:09 -08:00
commit 4f5c2bcd74
6 changed files with 179 additions and 83 deletions

9
.gitignore vendored
View File

@ -161,3 +161,12 @@
/rust-1.29.2-s390x-unknown-linux-gnu.tar.xz
/rust-1.29.2-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.30.1-src.tar.xz
/rustc-1.31.0-src.tar.xz
/rust-1.30.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.30.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.30.0-i686-unknown-linux-gnu.tar.xz
/rust-1.30.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.30.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.30.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.30.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.31.1-src.tar.xz

View File

@ -0,0 +1,118 @@
From f107514aef0b25b0d959941df1e45b18a478151b Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Fri, 30 Nov 2018 15:33:40 -0800
Subject: [PATCH] Deal with EINTR in net timeout tests
We've seen sporadic QE failures in the timeout tests on this assertion:
assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut);
So there's an error, but not either of the expected kinds. Adding a
format to show the kind revealed `ErrorKind::Interrupted` (`EINTR`).
For the cases that were using `read`, we can just use `read_exact` to
keep trying after interruption. For those using `recv_from`, we have to
manually loop until we get a non-interrupted result.
---
src/libstd/net/tcp.rs | 10 ++++++----
src/libstd/net/udp.rs | 20 ++++++++++++++++----
src/libstd/sys/unix/ext/net.rs | 10 ++++++----
3 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs
index ad212a547579..be797803233a 100644
--- a/src/libstd/net/tcp.rs
+++ b/src/libstd/net/tcp.rs
@@ -1548,8 +1548,9 @@ mod tests {
let mut buf = [0; 10];
let start = Instant::now();
- let kind = stream.read(&mut buf).err().expect("expected error").kind();
- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut);
+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind();
+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut,
+ "unexpected_error: {:?}", kind);
assert!(start.elapsed() > Duration::from_millis(400));
drop(listener);
}
@@ -1570,8 +1571,9 @@ mod tests {
assert_eq!(b"hello world", &buf[..]);
let start = Instant::now();
- let kind = stream.read(&mut buf).err().expect("expected error").kind();
- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut);
+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind();
+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut,
+ "unexpected_error: {:?}", kind);
assert!(start.elapsed() > Duration::from_millis(400));
drop(listener);
}
diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs
index 0ebe3284b4f0..fc68abae05a0 100644
--- a/src/libstd/net/udp.rs
+++ b/src/libstd/net/udp.rs
@@ -1030,8 +1030,14 @@ mod tests {
let mut buf = [0; 10];
let start = Instant::now();
- let kind = stream.recv_from(&mut buf).err().expect("expected error").kind();
- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut);
+ loop {
+ let kind = stream.recv_from(&mut buf).err().expect("expected error").kind();
+ if kind != ErrorKind::Interrupted {
+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut,
+ "unexpected_error: {:?}", kind);
+ break;
+ }
+ }
assert!(start.elapsed() > Duration::from_millis(400));
}
@@ -1049,8 +1055,14 @@ mod tests {
assert_eq!(b"hello world", &buf[..]);
let start = Instant::now();
- let kind = stream.recv_from(&mut buf).err().expect("expected error").kind();
- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut);
+ loop {
+ let kind = stream.recv_from(&mut buf).err().expect("expected error").kind();
+ if kind != ErrorKind::Interrupted {
+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut,
+ "unexpected_error: {:?}", kind);
+ break;
+ }
+ }
assert!(start.elapsed() > Duration::from_millis(400));
}
diff --git a/src/libstd/sys/unix/ext/net.rs b/src/libstd/sys/unix/ext/net.rs
index 55f43ccd7db4..737437c76b7c 100644
--- a/src/libstd/sys/unix/ext/net.rs
+++ b/src/libstd/sys/unix/ext/net.rs
@@ -1654,8 +1654,9 @@ mod test {
or_panic!(stream.set_read_timeout(Some(Duration::from_millis(1000))));
let mut buf = [0; 10];
- let kind = stream.read(&mut buf).err().expect("expected error").kind();
- assert!(kind == io::ErrorKind::WouldBlock || kind == io::ErrorKind::TimedOut);
+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind();
+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut,
+ "unexpected_error: {:?}", kind);
}
#[test]
@@ -1675,8 +1676,9 @@ mod test {
or_panic!(stream.read(&mut buf));
assert_eq!(b"hello world", &buf[..]);
- let kind = stream.read(&mut buf).err().expect("expected error").kind();
- assert!(kind == io::ErrorKind::WouldBlock || kind == io::ErrorKind::TimedOut);
+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind();
+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut,
+ "unexpected_error: {:?}", kind);
}
// Ensure the `set_read_timeout` and `set_write_timeout` calls return errors
--
2.19.1

View File

@ -55,15 +55,15 @@
# Some sub-packages are versioned independently of the rust compiler and runtime itself.
# Also beware that if any of these are not changed in a version bump, then the release
# number should still increase, not be reset to 1!
%global rustc_version 1.31.0
%global rustc_version 1.31.1
%global cargo_version 1.31.0
%global rustfmt_version 1.0.0
%global rls_version 1.31.6
%global rls_version 1.31.7
%global clippy_version 0.0.212
Name: rust
Version: %{rustc_version}
Release: 0.1.beta.17%{?dist}
Release: 9%{?dist}
Summary: The Rust Programming Language
License: (ASL 2.0 or MIT) and (BSD and MIT)
# ^ written as: (rust itself) and (bundled libraries)
@ -77,9 +77,8 @@ ExclusiveArch: %{rust_arches}
%endif
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
# rustfmt->bytecount->simd only works on i686, x86_64, and aarch64
# https://github.com/rust-lang/rust/issues/56261
Patch1: rustfmt-bytecount-no-simd.patch
# https://github.com/rust-lang/rust/pull/56394
Patch1: 0001-Deal-with-EINTR-in-net-timeout-tests.patch
# Get the Rust triple for any arch.
%{lua: function rust_triple(arch)
@ -161,7 +160,7 @@ BuildRequires: %{python}
%if %with bundled_llvm
BuildRequires: cmake3 >= 3.4.3
Provides: bundled(llvm) = 8.0
Provides: bundled(llvm) = 8.0.0~svn
%else
BuildRequires: cmake >= 2.8.11
%if 0%{?epel}
@ -224,10 +223,15 @@ Requires: /usr/bin/cc
# Use hardening ldflags.
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
%if %{without bundled_llvm} && "%{llvm_root}" != "%{_prefix}"
%if %{without bundled_llvm}
%if 0%{?fedora} || 0%{?rhel} > 7 || 0%{?scl:1}
%global llvm_has_filecheck 1
%endif
%if "%{llvm_root}" != "%{_prefix}"
# https://github.com/rust-lang/rust/issues/40717
%global library_path $(%{llvm_root}/bin/llvm-config --libdir)
%endif
%endif
%description
Rust is a systems programming language that runs blazingly fast, prevents
@ -301,7 +305,7 @@ Version: %{cargo_version}
Provides: bundled(libgit2) = 0.27
%endif
%if %with bundled_libssh2
Provides: bundled(libssh2) = 1.8.1
Provides: bundled(libssh2) = 1.8.1~dev
%endif
# For tests:
BuildRequires: git
@ -325,21 +329,20 @@ Requires: rust-doc = %{rustc_version}-%{release}
This package includes HTML documentation for Cargo.
%package -n rustfmt-preview
%package -n rustfmt
Summary: Tool to find and fix Rust formatting issues
Version: %{rustfmt_version}
Requires: cargo
# Despite the lower version, our rustfmt-preview is newer than rustfmt-0.9.
# It's expected to stay "preview" until it's released as 1.0.
Obsoletes: rustfmt <= 0.9.0
Provides: rustfmt = %{rustfmt_version}
# The component/package was rustfmt-preview until Rust 1.31.
Obsoletes: rustfmt-preview < 1.0.0
Provides: rustfmt-preview = %{rustfmt_version}-%{release}
%description -n rustfmt-preview
%description -n rustfmt
A tool for formatting Rust code according to style guidelines.
%package -n rls-preview
%package -n rls
Summary: Rust Language Server for IDE integration
Version: %{rls_version}
Provides: rls = %{rls_version}
@ -347,20 +350,24 @@ Provides: rls = %{rls_version}
Provides: bundled(libgit2) = 0.27
%endif
%if %with bundled_libssh2
Provides: bundled(libssh2) = 1.8.1
Provides: bundled(libssh2) = 1.8.1~dev
%endif
Requires: rust-analysis
# /usr/bin/rls is dynamically linked against internal rustc libs
Requires: %{name}%{?_isa} = %{rustc_version}-%{release}
%description -n rls-preview
# The component/package was rls-preview until Rust 1.31.
Obsoletes: rls-preview < 1.31.6
Provides: rls-preview = %{rls_version}-%{release}
%description -n rls
The Rust Language Server provides a server that runs in the background,
providing IDEs, editors, and other tools with information about Rust programs.
It supports functionality such as 'goto definition', symbol search,
reformatting, and code completion, and enables renaming and refactorings.
%package -n clippy-preview
%package -n clippy
Summary: Lints to catch common mistakes and improve your Rust code
Version: %{clippy_version}
Provides: clippy = %{clippy_version}
@ -368,7 +375,11 @@ Requires: cargo
# /usr/bin/clippy-driver is dynamically linked against internal rustc libs
Requires: %{name}%{?_isa} = %{rustc_version}-%{release}
%description -n clippy-preview
# The component/package was clippy-preview until Rust 1.31.
Obsoletes: clippy-preview <= 0.0.212
Provides: clippy-preview = %{clippy_version}-%{release}
%description -n clippy
A collection of lints to catch common mistakes and improve your Rust code.
@ -403,11 +414,7 @@ test -f '%{local_rust_root}/bin/rustc'
%setup -q -n %{rustc_package}
# rustfmt->bytecount->simd only works on i686, x86_64, and aarch64
# https://github.com/rust-lang/rust/issues/56261
%ifnarch i686 x86_64 aarch64
%patch1 -p0
%endif
%patch1 -p1
%if "%{python}" == "python3"
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
@ -491,7 +498,8 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
--libdir=%{common_libdir} \
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
--local-rust-root=%{local_rust_root} \
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} --disable-codegen-tests \
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} \
%{!?llvm_has_filecheck: --disable-codegen-tests} \
%{!?with_llvm_static: --enable-llvm-link-shared } } \
--disable-jemalloc \
--disable-rpath \
@ -661,20 +669,20 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%{_docdir}/cargo/html
%files -n rustfmt-preview
%files -n rustfmt
%{_bindir}/rustfmt
%{_bindir}/cargo-fmt
%doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md
%license src/tools/rustfmt/LICENSE-{APACHE,MIT}
%files -n rls-preview
%files -n rls
%{_bindir}/rls
%doc src/tools/rls/{README.md,COPYRIGHT,debugging.md}
%license src/tools/rls/LICENSE-{APACHE,MIT}
%files -n clippy-preview
%files -n clippy
%{_bindir}/cargo-clippy
%{_bindir}/clippy-driver
%doc src/tools/clippy/{README.md,CHANGELOG.md}
@ -691,8 +699,12 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%changelog
* Sat Nov 17 2018 Josh Stone <jistone@redhat.com> - 1.31.0-0.1.beta.13
- beta test
* Mon Jan 07 2019 Josh Stone <jistone@redhat.com> - 1.31.1-9
- Update to 1.31.1 for RLS fixes.
* Thu Dec 06 2018 Josh Stone <jistone@redhat.com> - 1.31.0-8
- Update to 1.31.0 -- Rust 2018!
- clippy/rls/rustfmt are no longer -preview
* Thu Nov 08 2018 Josh Stone <jistone@redhat.com> - 1.30.1-7
- Update to 1.30.1.

View File

@ -1,43 +0,0 @@
--- src/tools/rustfmt/Cargo.toml 2018-11-25 01:44:10.000000000 -0800
+++ src/tools/rustfmt/Cargo.toml 2018-11-26 14:57:07.921495841 -0800
@@ -51,7 +51,7 @@
rustc-ap-syntax = "297.0.0"
rustc-ap-syntax_pos = "297.0.0"
failure = "0.1.1"
-bytecount = { version = "0.3", features = ["simd-accel"] }
+bytecount = { version = "0.3", features = [] }
# A noop dependency that changes in the Rust repository, it's a bit of a hack.
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
--- src/Cargo.lock 2018-11-25 01:42:12.000000000 -0800
+++ src/Cargo.lock 2018-11-26 15:21:01.917516541 -0800
@@ -182,9 +182,6 @@
name = "bytecount"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "simd 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
[[package]]
name = "byteorder"
@@ -2651,11 +2648,6 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
-name = "simd"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
name = "siphasher"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3396,7 +3388,6 @@
"checksum serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "bb47a3d5c84320222f66d7db21157c4a7407755de41798f9b4c1c40593397b1a"
"checksum shell-escape 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "170a13e64f2a51b77a45702ba77287f5c6829375b04a69cf2222acd17d0cfab9"
"checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
-"checksum simd 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0048b17eb9577ac545c61d85c3559b41dfb4cbea41c9bd9ca6a4f73ff05fda84"
"checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537"
"checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d"
"checksum socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7"

View File

@ -1 +1 @@
SHA512 (rustc-1.30.1-src.tar.xz) = e466db81b9a82239670c48b876dc7390fcdda28c6390308691ddf2e0c12a39b57bd5ddb18322d1b4cd58165f69a666c7d83bee6573049da3b94e401657459bf5
SHA512 (rustc-1.31.1-src.tar.xz) = d6688711452295c41468af214f036499074d82fbeedc3f03560275219c2fae910e623e38e3210176d86f78ba5533ea098da5ff21532c8ad1a5aac132bb74ee02

View File

@ -1,8 +1,8 @@
SHA512 (rustc-1.30.1-src.tar.xz) = e466db81b9a82239670c48b876dc7390fcdda28c6390308691ddf2e0c12a39b57bd5ddb18322d1b4cd58165f69a666c7d83bee6573049da3b94e401657459bf5
SHA512 (rust-1.29.2-aarch64-unknown-linux-gnu.tar.xz) = f871359a3b1ac54fb237921204d98ef4fac06830e9835849538397c27d40283662c0f6ab3f6eafe0e9ef63182a460e26d615111055430ece0fe94ddf7ad03914
SHA512 (rust-1.29.2-armv7-unknown-linux-gnueabihf.tar.xz) = bff1220781eca904a93d2cefafed3587e3f76e1dc04fbef09a0281295b6c06491c5fa327830c430d31df80eb7a3e64eac7f45739bc118e3626854f96dce246e2
SHA512 (rust-1.29.2-i686-unknown-linux-gnu.tar.xz) = faac22aec54d0754ff991f2a34ed7b8bfefa8dc9720d247eec1c6b671bbc701907146a796699591e4a677a0f378b9d96bfea5b33452f05dd876c668525f9f33d
SHA512 (rust-1.29.2-powerpc64le-unknown-linux-gnu.tar.xz) = b9181da601a467f46713f2f438fc7ad69c46fc310e62a8d45f665744c8578491d832b8624ff454c19c94f1694fa406846a82289250241030a70b2cb4b88913d1
SHA512 (rust-1.29.2-powerpc64-unknown-linux-gnu.tar.xz) = 1af0b55bc62d7641d33e2d33aadaf474298d3284cb2d914be0240eae54e20f464513db4b04f7518385dc5135498c58ec18e0d4cc6341c9e165847536479f44dc
SHA512 (rust-1.29.2-s390x-unknown-linux-gnu.tar.xz) = f76a030257edbdd993d7a4e83da895c8b4749904fb2252a125b3e4ef4331a1cb2c389ec54a372bea413718e3dad987e4b17eb29d301c29ba330222502e6b9b75
SHA512 (rust-1.29.2-x86_64-unknown-linux-gnu.tar.xz) = 8bc05942a72b186ea1765831bea6921f734e2dd58790a8e427a6d63a2db0d9064937d3198ca3febffeba73b1cc3bef716155ef6cb32127ddeef29ac884cde4b8
SHA512 (rustc-1.31.1-src.tar.xz) = d6688711452295c41468af214f036499074d82fbeedc3f03560275219c2fae910e623e38e3210176d86f78ba5533ea098da5ff21532c8ad1a5aac132bb74ee02
SHA512 (rust-1.30.0-aarch64-unknown-linux-gnu.tar.xz) = 47459ea5a92418fdbfed9517d2ca741d02d8342e87e8b0e191103ff5407e39da917534445008a036cf043f0e8aff15a5d8c1884b0144ce4022f626fcfb5a46c6
SHA512 (rust-1.30.0-armv7-unknown-linux-gnueabihf.tar.xz) = c2849807e1fd37dc175ea4e41345076f5b24944471c191539b625eb59183d899c1f416b99bac8365ead20d2b49ede4254ccf39dc8006e17721a031f11fa42348
SHA512 (rust-1.30.0-i686-unknown-linux-gnu.tar.xz) = 76542f5d1f030696c6fb2aea6d4d7d3cb5739a16b7ce38f85cd7295d8f5ff1f1854266a5d30830898ab2fc06030be10d70f246c1391f241b8d9cba243d9ff992
SHA512 (rust-1.30.0-powerpc64le-unknown-linux-gnu.tar.xz) = 18095b68c6a5a4be32d4ad3413a251fe570c22d2c793852de6247fde5e061fc6d77bbcd812fff7e5bae7361c9588d7e41ef89ad791da678c89763acddc06a88f
SHA512 (rust-1.30.0-powerpc64-unknown-linux-gnu.tar.xz) = 8d371215eb3ba6b2f1fa9cc05ede5dd1cac873c82dde0f508f962cd27a13b15b814a6a9fdbce92b524dcebbb19294cd607c29d2d123cde1daefb61cd57090010
SHA512 (rust-1.30.0-s390x-unknown-linux-gnu.tar.xz) = 19a2f218b3104cfa5e5578365cc9927c818ddf721e4e8eb381bba1bd182fdefd9ad085ba4cbe8248fdbf5b173081ca1a2648b5be5fad62a0a324c3ade7f21ae7
SHA512 (rust-1.30.0-x86_64-unknown-linux-gnu.tar.xz) = 09d272bcc5b062815135d64441162b737078799328418adc4a4734fee69fcb9ad6abcbdc77b399688998481f0453915231b8b6d31b1d4066ac578035272c19f0