summary refs log tree commit diff
path: root/pkgs/development/compilers/rust
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-06-04 22:08:41 +0200
committerDaiderd Jordan <daiderd@gmail.com>2018-06-05 07:43:36 +0200
commitff37f08aa8807b683fa5dfcf52059286601de334 (patch)
tree5138f48224890131056ecbb7cd744d0e01cd1ca1 /pkgs/development/compilers/rust
parentfd95f532e0a0bfc8bdbef5c359351501c16807ce (diff)
downloadnixlib-ff37f08aa8807b683fa5dfcf52059286601de334.tar
nixlib-ff37f08aa8807b683fa5dfcf52059286601de334.tar.gz
nixlib-ff37f08aa8807b683fa5dfcf52059286601de334.tar.bz2
nixlib-ff37f08aa8807b683fa5dfcf52059286601de334.tar.lz
nixlib-ff37f08aa8807b683fa5dfcf52059286601de334.tar.xz
nixlib-ff37f08aa8807b683fa5dfcf52059286601de334.tar.zst
nixlib-ff37f08aa8807b683fa5dfcf52059286601de334.zip
rustc: re-enable tests on darwin
- disable doctest for stdsimd
- disable previous and some extra extra tcp tests
Diffstat (limited to 'pkgs/development/compilers/rust')
-rw-r--r--pkgs/development/compilers/rust/default.nix2
-rw-r--r--pkgs/development/compilers/rust/patches/net-tcp-disable-tests.patch104
-rw-r--r--pkgs/development/compilers/rust/patches/stdsimd-disable-doctest.patch20
-rw-r--r--pkgs/development/compilers/rust/rustc.nix6
4 files changed, 126 insertions, 6 deletions
diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index 8669af91a9a9..f3fe7b07b9a7 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 000000000000..70a91ceb9d97
--- /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 000000000000..6ef7fd0f7ce4
--- /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 72d0ee70782a..d3dcc8e2f6c9 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: