From fd95f532e0a0bfc8bdbef5c359351501c16807ce Mon Sep 17 00:00:00 2001 From: jD91mZM2 Date: Fri, 11 May 2018 16:37:29 +0200 Subject: [PATCH 1/4] rust: 1.25.0 -> 1.26.1 --- pkgs/development/compilers/rust/bootstrap.nix | 14 ++--- pkgs/development/compilers/rust/default.nix | 13 ++--- ...tests-libstd-net-tcp-on-Darwin-Linux.patch | 53 ------------------- .../compilers/rust/patches/grsec.patch | 24 --------- pkgs/development/compilers/rust/rustc.nix | 3 +- 5 files changed, 14 insertions(+), 93 deletions(-) delete mode 100644 pkgs/development/compilers/rust/patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch delete mode 100644 pkgs/development/compilers/rust/patches/grsec.patch diff --git a/pkgs/development/compilers/rust/bootstrap.nix b/pkgs/development/compilers/rust/bootstrap.nix index 44d96bc4ad1..589054ef438 100644 --- a/pkgs/development/compilers/rust/bootstrap.nix +++ b/pkgs/development/compilers/rust/bootstrap.nix @@ -3,16 +3,16 @@ let # Note: the version MUST be one version prior to the version we're # building - version = "1.24.1"; + version = "1.26.0"; # fetch hashes by running `print-hashes.sh 1.24.1` hashes = { - i686-unknown-linux-gnu = "a483576bb2ab237aa1ef62b66c0814f934afd8129d7c9748cb9a75da4a678c98"; - x86_64-unknown-linux-gnu = "4567e7f6e5e0be96e9a5a7f5149b5452828ab6a386099caca7931544f45d5327"; - armv7-unknown-linux-gnueabihf = "1169ab005b771c4befcdab536347a90242cae544b6b76eccd0f76796b61a534c"; - aarch64-unknown-linux-gnu = "64bb25a9689b18ddadf025b90d9bdb150b809ebfb74432dc69cc2e46120adbb2"; - i686-apple-darwin = "c96f7579e2406220895da80a989daaa194751c141e112ebe95761f2ed4ecb662"; - x86_64-apple-darwin = "9d4aacdb5849977ea619d399903c9378163bd9c76ea11dac5ef6eca27849f501"; + i686-unknown-linux-gnu = "2aef0709b1f2e93d396143b7a926f262ac6fd24dd8768bf2c9425255a4a401c1"; + x86_64-unknown-linux-gnu = "13691d7782577fc9f110924b26603ade1990de0b691a3ce2dc324b4a72a64a68"; + armv7-unknown-linux-gnueabihf = "d10c892cd3267010068930599e1e3835b50c6ba5261a912107dcba5ca1893ec5"; + aarch64-unknown-linux-gnu = "e12dc84bdb569cdb382268a5fe6ae6a8e2e53810cb890ec3a7133c20ba8451ac"; + i686-apple-darwin = "04dd24d7a5d5e02d5e992eaabd5952d39363885ce2a9980e3e96e5bc09dab2f0"; + x86_64-apple-darwin = "38708803c3096b8f101d1919ee2d7e723b0adf1bc1bb986b060973b57d8c7c28"; }; platform = diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix index f191515b745..8669af91a9a 100644 --- a/pkgs/development/compilers/rust/default.nix +++ b/pkgs/development/compilers/rust/default.nix @@ -6,16 +6,18 @@ let rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {})); - version = "1.25.0"; - cargoVersion = "0.26.0"; + version = "1.26.1"; + cargoVersion = "1.26.1"; src = fetchurl { url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"; - sha256 = "0baxjr99311lvwdq0s38bipbnj72pn6fgbk6lcq7j555xq53mxpf"; + sha256 = "1w0da0cysvzxqyn0ap0aprzlm006185yk5lq3v0b4hzcv0drd9vh"; }; in rec { rustc = callPackage ./rustc.nix { inherit stdenv llvm targets targetPatches targetToolchains rustPlatform version src; + patches = []; + forceBundledLLVM = true; configureFlags = [ "--release-channel=stable" ]; @@ -25,11 +27,6 @@ in rec { # So we do the same. # 2. Tests run out of memory for i686 doCheck = !stdenv.isAarch64 && !stdenv.isi686; - - patches = [ - ./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch - ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch; - }; cargo = callPackage ./cargo.nix rec { diff --git a/pkgs/development/compilers/rust/patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch b/pkgs/development/compilers/rust/patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch deleted file mode 100644 index f55d0badb82..00000000000 --- a/pkgs/development/compilers/rust/patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 26d3b70abec1adf773522643b31ce9c03439916a Mon Sep 17 00:00:00 2001 -From: Joerg Thalheim -Date: Tue, 10 Oct 2017 00:40:20 +0100 -Subject: [PATCH] Disable fragile tests libstd::net::tcp on Darwin/Linux - -Signed-off-by: Joerg Thalheim ---- - src/libstd/net/tcp.rs | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs -index 8d1e7882e5..2c223fb315 100644 ---- a/src/libstd/net/tcp.rs -+++ b/src/libstd/net/tcp.rs -@@ -949,6 +949,7 @@ mod tests { - }) - } - -+ #[cfg_attr(target_os = "macos", ignore)] - #[test] - fn write_close() { - each_ip(&mut |addr| { -@@ -1421,7 +1422,10 @@ mod tests { - - // FIXME: re-enabled bitrig/openbsd tests once their socket timeout code - // no longer has rounding errors. -- #[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)] -+ #[cfg_attr(any(target_os = "bitrig", -+ target_os = "netbsd", -+ target_os = "openbsd", -+ target_os = "macos"), ignore)] - #[test] - fn timeouts() { - let addr = next_test_ip4(); -@@ -1500,6 +1504,7 @@ mod tests { - assert_eq!(false, t!(stream.nodelay())); - } - -+ #[cfg_attr(target_os = "macos", ignore)] - #[test] - fn ttl() { - let ttl = 100; -@@ -1568,6 +1573,7 @@ mod tests { - }) - } - -+ #[cfg_attr(target_os = "linux", ignore)] - #[test] - fn connect_timeout_unroutable() { - // this IP is unroutable, so connections should always time out, --- -2.14.2 - diff --git a/pkgs/development/compilers/rust/patches/grsec.patch b/pkgs/development/compilers/rust/patches/grsec.patch deleted file mode 100644 index b97b40c2409..00000000000 --- a/pkgs/development/compilers/rust/patches/grsec.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/src/test/run-make/relocation-model/Makefile b/src/test/run-make/relocation-model/Makefile -index b22f34f..c6489bd 100644 ---- a/src/test/run-make/relocation-model/Makefile -+++ b/src/test/run-make/relocation-model/Makefile -@@ -2,9 +2,11 @@ - - all: others - $(RUSTC) -C relocation-model=dynamic-no-pic foo.rs -+ paxctl -czexm $(TMPDIR)/foo - $(call RUN,foo) - - $(RUSTC) -C relocation-model=default foo.rs -+ paxctl -czexm $(TMPDIR)/foo - $(call RUN,foo) - - $(RUSTC) -C relocation-model=default --crate-type=dylib foo.rs -@@ -16,6 +18,7 @@ others: - else - others: - $(RUSTC) -C relocation-model=static foo.rs -+ paxctl -czexm $(TMPDIR)/foo - $(call RUN,foo) - $(RUSTC) -C relocation-model=static --crate-type=dylib foo.rs - endif diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 277ffda20af..72d0ee70782 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -149,10 +149,11 @@ stdenv.mkDerivation { outputs = [ "out" "man" "doc" ]; setOutputFlags = false; - # Disable codegen units for the tests. + # Disable codegen units and hardening for the tests. preCheck = '' export RUSTFLAGS= export TZDIR=${tzdata}/share/zoneinfo + export hardeningDisable=all '' + # Ensure TMPDIR is set, and disable a test that removing the HOME # variable from the environment falls back to another home From ff37f08aa8807b683fa5dfcf52059286601de334 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 4 Jun 2018 22:08:41 +0200 Subject: [PATCH 2/4] rustc: re-enable tests on darwin - disable doctest for stdsimd - disable previous and some extra extra tcp tests --- pkgs/development/compilers/rust/default.nix | 2 +- .../rust/patches/net-tcp-disable-tests.patch | 104 ++++++++++++++++++ .../patches/stdsimd-disable-doctest.patch | 20 ++++ pkgs/development/compilers/rust/rustc.nix | 6 +- 4 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch create mode 100644 pkgs/development/compilers/rust/patches/stdsimd-disable-doctest.patch diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix index 8669af91a9a..f3fe7b07b9a 100644 --- a/pkgs/development/compilers/rust/default.nix +++ b/pkgs/development/compilers/rust/default.nix @@ -16,7 +16,7 @@ in rec { rustc = callPackage ./rustc.nix { inherit stdenv llvm targets targetPatches targetToolchains rustPlatform version src; - patches = []; + patches = [ ./patches/net-tcp-disable-tests.patch ./patches/stdsimd-disable-doctest.patch ]; forceBundledLLVM = true; diff --git a/pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch b/pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch new file mode 100644 index 00000000000..70a91ceb9d9 --- /dev/null +++ b/pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch @@ -0,0 +1,104 @@ +diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs +index 0f60b5b3e..9b08415e7 100644 +--- a/src/libstd/net/tcp.rs ++++ b/src/libstd/net/tcp.rs +@@ -962,6 +962,7 @@ mod tests { + } + } + ++ #[cfg_attr(target_os = "macos", ignore)] + #[test] + fn listen_localhost() { + let socket_addr = next_test_ip4(); +@@ -1020,6 +1021,7 @@ mod tests { + }) + } + ++ #[cfg_attr(target_os = "macos", ignore)] + #[test] + fn read_eof() { + each_ip(&mut |addr| { +@@ -1039,6 +1041,7 @@ mod tests { + }) + } + ++ #[cfg_attr(target_os = "macos", ignore)] + #[test] + fn write_close() { + each_ip(&mut |addr| { +@@ -1065,6 +1068,7 @@ mod tests { + }) + } + ++ #[cfg_attr(target_os = "macos", ignore)] + #[test] + fn multiple_connect_serial() { + each_ip(&mut |addr| { +@@ -1087,6 +1091,7 @@ mod tests { + }) + } + ++ #[cfg_attr(target_os = "macos", ignore)] + #[test] + fn multiple_connect_interleaved_greedy_schedule() { + const MAX: usize = 10; +@@ -1123,6 +1128,7 @@ mod tests { + } + + #[test] ++ #[cfg_attr(target_os = "macos", ignore)] + fn multiple_connect_interleaved_lazy_schedule() { + const MAX: usize = 10; + each_ip(&mut |addr| { +@@ -1401,6 +1407,7 @@ mod tests { + } + + #[test] ++ #[cfg_attr(target_os = "macos", ignore)] + fn clone_while_reading() { + each_ip(&mut |addr| { + let accept = t!(TcpListener::bind(&addr)); +@@ -1421,7 +1422,10 @@ mod tests { + + // FIXME: re-enabled bitrig/openbsd tests once their socket timeout code + // no longer has rounding errors. +- #[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)] ++ #[cfg_attr(any(target_os = "bitrig", ++ target_os = "netbsd", ++ target_os = "openbsd", ++ target_os = "macos"), ignore)] + #[test] + fn timeouts() { + let addr = next_test_ip4(); +@@ -1596,6 +1603,7 @@ mod tests { + drop(listener); + } + ++ #[cfg_attr(target_os = "macos", ignore)] + #[test] + fn nodelay() { + let addr = next_test_ip4(); +@@ -1610,6 +1618,7 @@ mod tests { + assert_eq!(false, t!(stream.nodelay())); + } + ++ #[cfg_attr(target_os = "macos", ignore)] + #[test] + fn ttl() { + let ttl = 100; +@@ -1647,6 +1656,7 @@ mod tests { + } + } + ++ #[cfg_attr(target_os = "macos", ignore)] + #[test] + fn peek() { + each_ip(&mut |addr| { +@@ -1679,6 +1689,7 @@ mod tests { + } + + #[test] ++ #[cfg_attr(target_os = "linux", target_os = "macos", ignore)] + fn connect_timeout_unroutable() { + // this IP is unroutable, so connections should always time out, + // provided the network is reachable to begin with. diff --git a/pkgs/development/compilers/rust/patches/stdsimd-disable-doctest.patch b/pkgs/development/compilers/rust/patches/stdsimd-disable-doctest.patch new file mode 100644 index 00000000000..6ef7fd0f7ce --- /dev/null +++ b/pkgs/development/compilers/rust/patches/stdsimd-disable-doctest.patch @@ -0,0 +1,20 @@ +diff --git a/src/stdsimd/coresimd/x86/mod.rs b/src/stdsimd/coresimd/x86/mod.rs +index 32915c332..7cb54f31e 100644 +--- a/src/stdsimd/coresimd/x86/mod.rs ++++ b/src/stdsimd/coresimd/x86/mod.rs +@@ -279,7 +279,6 @@ types! { + /// + /// # Examples + /// +- /// ``` + /// # #![feature(cfg_target_feature, target_feature, stdsimd)] + /// # #![cfg_attr(not(dox), no_std)] + /// # #[cfg(not(dox))] +@@ -301,7 +300,6 @@ types! { + /// # } + /// # if is_x86_feature_detected!("sse") { unsafe { foo() } } + /// # } +- /// ``` + pub struct __m256(f32, f32, f32, f32, f32, f32, f32, f32); + + /// 256-bit wide set of four `f64` types, x86-specific diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 72d0ee70782..d3dcc8e2f6c 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -10,11 +10,7 @@ , targets , targetPatches , targetToolchains - -# Tests frequently break on Darwin -# See the rust issue: https://github.com/rust-lang/rust/issues/51006 -, doCheck ? (!stdenv.isDarwin) - +, doCheck ? true , broken ? false , buildPlatform, hostPlatform } @ args: From 810e6759c23c8e1a71bc0963e712757327c91911 Mon Sep 17 00:00:00 2001 From: jD91mZM2 Date: Tue, 5 Jun 2018 21:54:27 +0200 Subject: [PATCH 3/4] rustc: 1.26.1 -> 1.26.2 --- pkgs/development/compilers/rust/binaryBuild.nix | 2 +- pkgs/development/compilers/rust/bootstrap.nix | 14 +++++++------- pkgs/development/compilers/rust/default.nix | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/rust/binaryBuild.nix b/pkgs/development/compilers/rust/binaryBuild.nix index 1904c12dfdc..849917c4a0c 100644 --- a/pkgs/development/compilers/rust/binaryBuild.nix +++ b/pkgs/development/compilers/rust/binaryBuild.nix @@ -14,7 +14,7 @@ let installComponents = "rustc,rust-std-${platform}" - + (optionalString bootstrapping ",rust-docs,cargo") + + (optionalString bootstrapping ",cargo") ; in diff --git a/pkgs/development/compilers/rust/bootstrap.nix b/pkgs/development/compilers/rust/bootstrap.nix index 589054ef438..9d67dd8f856 100644 --- a/pkgs/development/compilers/rust/bootstrap.nix +++ b/pkgs/development/compilers/rust/bootstrap.nix @@ -3,16 +3,16 @@ let # Note: the version MUST be one version prior to the version we're # building - version = "1.26.0"; + version = "1.26.1"; # fetch hashes by running `print-hashes.sh 1.24.1` hashes = { - i686-unknown-linux-gnu = "2aef0709b1f2e93d396143b7a926f262ac6fd24dd8768bf2c9425255a4a401c1"; - x86_64-unknown-linux-gnu = "13691d7782577fc9f110924b26603ade1990de0b691a3ce2dc324b4a72a64a68"; - armv7-unknown-linux-gnueabihf = "d10c892cd3267010068930599e1e3835b50c6ba5261a912107dcba5ca1893ec5"; - aarch64-unknown-linux-gnu = "e12dc84bdb569cdb382268a5fe6ae6a8e2e53810cb890ec3a7133c20ba8451ac"; - i686-apple-darwin = "04dd24d7a5d5e02d5e992eaabd5952d39363885ce2a9980e3e96e5bc09dab2f0"; - x86_64-apple-darwin = "38708803c3096b8f101d1919ee2d7e723b0adf1bc1bb986b060973b57d8c7c28"; + i686-unknown-linux-gnu = "d704ba5cbaaf93c5e2112d211630db0e460d5dc819a43464ba91581e5c821df3"; + x86_64-unknown-linux-gnu = "b7e964bace1286696d511c287b945f3ece476ba77a231f0c31f1867dfa5080e0"; + armv7-unknown-linux-gnueabihf = "34fbcebc8e60b6496f1ce7998cf0b50cd618770f039da529b65110fff1f25fa0"; + aarch64-unknown-linux-gnu = "d4a369053c2dfd5f457de6853557dab563944579fa4bb55bc919bacf259bff6d"; + i686-apple-darwin = "047c31a872161ebb1d21ef616f7658190403769a8734f84364a3cf15838b4708"; + x86_64-apple-darwin = "ebf898b9fa7e2aafc53682a41f18af5ca6660ebe82dd78f28cd9799fe4dc189a"; }; platform = diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix index f3fe7b07b9a..e6caebe88bf 100644 --- a/pkgs/development/compilers/rust/default.nix +++ b/pkgs/development/compilers/rust/default.nix @@ -6,11 +6,11 @@ let rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {})); - version = "1.26.1"; - cargoVersion = "1.26.1"; + version = "1.26.2"; + cargoVersion = "1.26.2"; src = fetchurl { url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"; - sha256 = "1w0da0cysvzxqyn0ap0aprzlm006185yk5lq3v0b4hzcv0drd9vh"; + sha256 = "0047ais0fvmqvngqkdsxgrzhb0kljg8wy85b01kbbjc88hqcz7pv"; }; in rec { rustc = callPackage ./rustc.nix { From c5d1f8f313433154b80753b46a5de7fb3738e4b3 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Wed, 6 Jun 2018 20:18:13 +0200 Subject: [PATCH 4/4] rust: fix test condition in tcp patch --- .../compilers/rust/patches/net-tcp-disable-tests.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch b/pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch index 70a91ceb9d9..10713b6b7aa 100644 --- a/pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch +++ b/pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch @@ -98,7 +98,7 @@ index 0f60b5b3e..9b08415e7 100644 } #[test] -+ #[cfg_attr(target_os = "linux", target_os = "macos", ignore)] ++ #[cfg_attr(any(target_os = "linux", target_os = "macos"), ignore)] fn connect_timeout_unroutable() { // this IP is unroutable, so connections should always time out, // provided the network is reachable to begin with.