From adb15c3a63fd96edcf7585394b8ccbeb1ceee336 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 26 Sep 2019 14:50:07 +0200 Subject: [PATCH 1/3] Revert "rustc: Provide compiler-rt sources" This reverts commit b7a828031238b0962cd91131eba50844ef401b93. It's no longer needed with Rust 1.38. --- pkgs/development/compilers/rust/rustc.nix | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index daf7af1babdc..78d276c1f16e 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -1,6 +1,6 @@ { stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget , fetchurl, file, python2, tzdata, ps -, llvmPackages_7, darwin, git, cmake, rustPlatform +, llvm_7, darwin, git, cmake, rustPlatform , which, libffi, gdb , withBundledLLVM ? false }: @@ -9,17 +9,13 @@ let inherit (stdenv.lib) optional optionalString; inherit (darwin.apple_sdk.frameworks) Security; - llvmPackages = llvmPackages_7; - - llvmSharedForBuild = pkgsBuildBuild.llvmPackages.llvm.override { enableSharedLibraries = true; }; - llvmSharedForHost = pkgsBuildHost.llvmPackages.llvm.override { enableSharedLibraries = true; }; - llvmSharedForTarget = pkgsBuildTarget.llvmPackages.llvm.override { enableSharedLibraries = true; }; + llvmSharedForBuild = pkgsBuildBuild.llvm_7.override { enableSharedLibraries = true; }; + llvmSharedForHost = pkgsBuildHost.llvm_7.override { enableSharedLibraries = true; }; + llvmSharedForTarget = pkgsBuildTarget.llvm_7.override { enableSharedLibraries = true; }; # For use at runtime - llvmShared = llvmPackages.llvm.override { enableSharedLibraries = true; }; -in - -stdenv.mkDerivation rec { + llvmShared = llvm_7.override { enableSharedLibraries = true; }; +in stdenv.mkDerivation rec { pname = "rustc"; version = "1.37.0"; @@ -28,12 +24,6 @@ stdenv.mkDerivation rec { sha256 = "1hrqprybhkhs6d9b5pjskfnc5z9v2l2gync7nb39qjb5s0h703hj"; }; - # Provide the compiler-rt sources needed for profiling. - preConfigure = '' - mkdir src/llvm-project/compiler-rt - tar xf ${llvmPackages.compiler-rt.src} -C src/llvm-project/compiler-rt --strip-components=1 - ''; - __darwinAllowLocalNetworking = true; # rustc complains about modified source files otherwise From 9c0968fd8103a32b05c72d8137e6d9e388a86a7e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 26 Sep 2019 14:51:12 +0200 Subject: [PATCH 2/3] rustc: 1.37.0 -> 1.38.0 --- pkgs/development/compilers/rust/bootstrap.nix | 16 ++++++++-------- pkgs/development/compilers/rust/rustc.nix | 9 ++++++--- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/rust/bootstrap.nix b/pkgs/development/compilers/rust/bootstrap.nix index 43a72985ddec..7b774d066b7f 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.36.0"; + version = "1.37.0"; - # fetch hashes by running `print-hashes.sh 1.36.0` + # fetch hashes by running `print-hashes.sh 1.37.0` hashes = { - i686-unknown-linux-gnu = "9f95c3e96622a792858c8a1c9274fa63e6992370493b27c1ac7299a3bec5156d"; - x86_64-unknown-linux-gnu = "15e592ec52f14a0586dcebc87a957e472c4544e07359314f6354e2b8bd284c55"; - armv7-unknown-linux-gnueabihf = "798181a728017068f9eddfa665771805d97846cd87bddcd67e0fe27c8d082ceb"; - aarch64-unknown-linux-gnu = "db78c24d93756f9fe232f081dbc4a46d38f8eec98353a9e78b9b164f9628042d"; - i686-apple-darwin = "3dbc34fdea8bc030badf9c8b2572c09fd3f5369b59ac099fc521064b390b9e60"; - x86_64-apple-darwin = "91f151ec7e24f5b0645948d439fc25172ec4012f0584dd16c3fb1acb709aa325"; + i686-unknown-linux-gnu = "74510e0e52a55e65a9f716673c2cda4d2bd427e2453541c6993c77c3ec04acf9"; + x86_64-unknown-linux-gnu = "cb573229bfd32928177c3835fdeb62d52da64806b844bc1095c6225b0665a1cb"; + armv7-unknown-linux-gnueabihf = "5b87b877f0ed20c6a09ce26e7a15d8c61b26b62484b97e78a51099d0efefec98"; + aarch64-unknown-linux-gnu = "263ef98fa3a6b2911b56f89c06615cdebf6ef676eb9b2493ad1539602f79b6ba"; + i686-apple-darwin = "e45d0c4d882fc6c404ffa6fe790294f4ea96384a2b48804adbf723f3635477a8"; + x86_64-apple-darwin = "b2310c97ffb964f253c4088c8d29865f876a49da2a45305493af5b5c7a3ca73d"; }; platform = diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 78d276c1f16e..433dc1719fb3 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -1,6 +1,7 @@ { stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget , fetchurl, file, python2, tzdata, ps , llvm_7, darwin, git, cmake, rustPlatform +, pkgconfig, openssl , which, libffi, gdb , withBundledLLVM ? false }: @@ -17,11 +18,11 @@ let llvmShared = llvm_7.override { enableSharedLibraries = true; }; in stdenv.mkDerivation rec { pname = "rustc"; - version = "1.37.0"; + version = "1.38.0"; src = fetchurl { url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"; - sha256 = "1hrqprybhkhs6d9b5pjskfnc5z9v2l2gync7nb39qjb5s0h703hj"; + sha256 = "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4"; }; __darwinAllowLocalNetworking = true; @@ -157,10 +158,12 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ file python2 ps rustPlatform.rust.rustc git cmake which libffi removeReferencesTo + pkgconfig ] # Only needed for the debuginfo tests ++ optional (!stdenv.isDarwin) gdb; - buildInputs = optional stdenv.isDarwin Security + buildInputs = [ openssl ] + ++ optional stdenv.isDarwin Security ++ optional (!withBundledLLVM) llvmShared; outputs = [ "out" "man" "doc" ]; From 173d5a4e6ebb00e634c91fc07cd1ea62bce6fd4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 30 Sep 2019 10:00:33 +0100 Subject: [PATCH 3/3] rustc: remove test related patches/code Tests have been disabled since over a year and now the code starts to bit-rot. As it seems unlikely that they will come back in near future, let's just remove it. --- .../rust/patches/net-tcp-disable-tests.patch | 92 ------------------- .../patches/stdsimd-disable-doctest.patch | 20 ---- pkgs/development/compilers/rust/rustc.nix | 72 +-------------- 3 files changed, 5 insertions(+), 179 deletions(-) delete mode 100644 pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch delete mode 100644 pkgs/development/compilers/rust/patches/stdsimd-disable-doctest.patch diff --git a/pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch b/pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch deleted file mode 100644 index 583a6027f83a..000000000000 --- a/pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch +++ /dev/null @@ -1,92 +0,0 @@ -diff -ru rustc-1.36.0-src-orig/src/libstd/net/tcp.rs rustc-1.36.0-src/src/libstd/net/tcp.rs ---- rustc-1.36.0-src-orig/src/libstd/net/tcp.rs 2019-07-03 10:00:00.000000000 +0200 -+++ rustc-1.36.0-src/src/libstd/net/tcp.rs 2019-07-07 11:33:35.378130207 +0200 -@@ -973,6 +973,7 @@ - } - } - -+ #[cfg_attr(target_os = "macos", ignore)] - #[test] - fn listen_localhost() { - let socket_addr = next_test_ip4(); -@@ -1031,6 +1032,7 @@ - }) - } - -+ #[cfg_attr(target_os = "macos", ignore)] - #[test] - fn read_eof() { - each_ip(&mut |addr| { -@@ -1050,6 +1052,7 @@ - }) - } - -+ #[cfg_attr(target_os = "macos", ignore)] - #[test] - fn write_close() { - each_ip(&mut |addr| { -@@ -1076,6 +1079,7 @@ - }) - } - -+ #[cfg_attr(target_os = "macos", ignore)] - #[test] - fn multiple_connect_serial() { - each_ip(&mut |addr| { -@@ -1098,6 +1102,7 @@ - }) - } - -+ #[cfg_attr(target_os = "macos", ignore)] - #[test] - fn multiple_connect_interleaved_greedy_schedule() { - const MAX: usize = 10; -@@ -1134,6 +1139,7 @@ - } - - #[test] -+ #[cfg_attr(target_os = "macos", ignore)] - fn multiple_connect_interleaved_lazy_schedule() { - const MAX: usize = 10; - each_ip(&mut |addr| { -@@ -1467,6 +1473,7 @@ - } - - #[test] -+ #[cfg_attr(target_os = "macos", ignore)] - fn clone_while_reading() { - each_ip(&mut |addr| { - let accept = t!(TcpListener::bind(&addr)); -@@ -1597,7 +1604,7 @@ - - // FIXME: re-enabled openbsd tests once their socket timeout code - // no longer has rounding errors. -- #[cfg_attr(any(target_os = "netbsd", target_os = "openbsd"), ignore)] -+ #[cfg_attr(any(target_os = "netbsd", target_os = "openbsd", target_os = "macos"), ignore)] - #[cfg_attr(target_env = "sgx", ignore)] // FIXME: https://github.com/fortanix/rust-sgx/issues/31 - #[test] - fn timeouts() { -@@ -1643,6 +1650,7 @@ - drop(listener); - } - -+ #[cfg_attr(target_os = "macos", ignore)] - #[test] - #[cfg_attr(target_env = "sgx", ignore)] // FIXME: https://github.com/fortanix/rust-sgx/issues/31 - fn test_read_with_timeout() { -@@ -1687,6 +1695,7 @@ - drop(listener); - } - -+ #[cfg_attr(target_os = "macos", ignore)] - #[test] - #[cfg_attr(target_env = "sgx", ignore)] - fn nodelay() { -@@ -1719,6 +1728,7 @@ - assert_eq!(ttl, t!(stream.ttl())); - } - -+ #[cfg_attr(target_os = "macos", ignore)] - #[test] - #[cfg_attr(target_env = "sgx", ignore)] - fn set_nonblocking() { diff --git a/pkgs/development/compilers/rust/patches/stdsimd-disable-doctest.patch b/pkgs/development/compilers/rust/patches/stdsimd-disable-doctest.patch deleted file mode 100644 index 6ef7fd0f7ce4..000000000000 --- a/pkgs/development/compilers/rust/patches/stdsimd-disable-doctest.patch +++ /dev/null @@ -1,20 +0,0 @@ -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 433dc1719fb3..27336aa501b5 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -1,8 +1,8 @@ { stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget -, fetchurl, file, python2, tzdata, ps +, fetchurl, file, python2 , llvm_7, darwin, git, cmake, rustPlatform , pkgconfig, openssl -, which, libffi, gdb +, which, libffi , withBundledLLVM ? false }: @@ -98,18 +98,6 @@ in stdenv.mkDerivation rec { --replace 'BOOTSTRAP_ARGS :=' 'BOOTSTRAP_ARGS := --jobs $(NIX_BUILD_CORES)' ''; - patches = [ - ./patches/net-tcp-disable-tests.patch - - # Re-evaluate if this we need to disable this one - #./patches/stdsimd-disable-doctest.patch - - # Fails on hydra - not locally; the exact reason is unknown. - # Comments in the test suggest that some non-reproducible environment - # variables such $RANDOM can make it fail. - # ./patches/disable-test-inherit-env.patch - ]; - # the rust build system complains that nix alters the checksums dontFixLibtool = true; @@ -122,45 +110,18 @@ in stdenv.mkDerivation rec { sed -i configure \ -e '/probe_need CFG_CURL curl/d' - # On Hydra: `TcpListener::bind(&addr)`: Address already in use (os error 98)' - sed '/^ *fn fast_rebind()/i#[ignore]' -i src/libstd/net/tcp.rs - - # https://github.com/rust-lang/rust/issues/39522 - echo removing gdb-version-sensitive tests... - find src/test/debuginfo -type f -execdir grep -q ignore-gdb-version '{}' \; -print -delete - rm src/test/debuginfo/{borrowed-c-style-enum.rs,c-style-enum-in-composite.rs,gdb-pretty-struct-and-enums.rs,generic-enum-with-different-disr-sizes.rs} - # Useful debugging parameter # export VERBOSE=1 - '' + optionalString stdenv.isDarwin '' - # Disable all lldb tests. - # error: Can't run LLDB test because LLDB's python path is not set - rm -vr src/test/debuginfo/* - rm -v src/test/run-pass/backtrace-debuginfo.rs || true - - # error: No such file or directory - rm -v src/test/ui/run-pass/issues/issue-45731.rs || true - - # Disable tests that fail when sandboxing is enabled. - substituteInPlace src/libstd/sys/unix/ext/net.rs \ - --replace '#[test]' '#[test] #[ignore]' - substituteInPlace src/test/run-pass/env-home-dir.rs \ - --replace 'home_dir().is_some()' true - rm -v src/test/run-pass/fds-are-cloexec.rs || true # FIXME: pipes? - rm -v src/test/ui/run-pass/threads-sendsync/sync-send-in-std.rs || true # FIXME: ??? ''; # rustc unfortunately needs cmake to compile llvm-rt but doesn't # use it for the normal build. This disables cmake in Nix. dontUseCmakeConfigure = true; - # ps is needed for one of the test cases nativeBuildInputs = [ - file python2 ps rustPlatform.rust.rustc git cmake - which libffi removeReferencesTo - pkgconfig - ] # Only needed for the debuginfo tests - ++ optional (!stdenv.isDarwin) gdb; + file python2 rustPlatform.rust.rustc git cmake + which libffi removeReferencesTo pkgconfig + ]; buildInputs = [ openssl ] ++ optional stdenv.isDarwin Security @@ -169,29 +130,6 @@ in stdenv.mkDerivation rec { outputs = [ "out" "man" "doc" ]; setOutputFlags = false; - # 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 - # directory. - optionalString stdenv.isDarwin '' - export TMPDIR=/tmp - sed -i '28s/home_dir().is_some()/true/' ./src/test/run-pass/env-home-dir.rs - ''; - - # 1. Upstream is not running tests on aarch64: - # see https://github.com/rust-lang/rust/issues/49807#issuecomment-380860567 - # So we do the same. - # 2. Tests run out of memory for i686 - #doCheck = !stdenv.isAarch64 && !stdenv.isi686; - - # Disabled for now; see https://github.com/NixOS/nixpkgs/pull/42348#issuecomment-402115598. - doCheck = false; - # remove references to llvm-config in lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so # and thus a transitive dependency on ncurses postInstall = ''