From 899d02642672005a3e65d71d9cbf5908601f094c Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Sun, 31 Jul 2016 20:06:01 +0200 Subject: [PATCH] rustUnstable.rustc: Fix tests by disabling lowering thread-count. --- pkgs/development/compilers/rust/head.nix | 6 ++- ...test-run-a-smaller-number-of-threads.patch | 44 +++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/compilers/rust/patches/tcp-stress-test-run-a-smaller-number-of-threads.patch diff --git a/pkgs/development/compilers/rust/head.nix b/pkgs/development/compilers/rust/head.nix index 5cedc4b72a9a..9befaca86daa 100644 --- a/pkgs/development/compilers/rust/head.nix +++ b/pkgs/development/compilers/rust/head.nix @@ -6,10 +6,12 @@ rec { shortVersion = "master-1.12.0"; forceBundledLLVM = false; needsCmake = true; - srcRev = "c77f8ce7c3284441a00faed6782d08eb5a78296c"; - srcSha = "11y24bm2rj7bzsf86iyx3v286ygxprch4c804qbl1w477mkhcac7"; + configureFlags = [ "--release-channel=nightly" ]; + srcRev = "d9a911d236cbecb47775276ba51a5f9111bdbc9c"; + srcSha = "07wybqvnw99fljmcy33vb9iwirmp10cwy47n008p396s7pb852hv"; patches = [ ./patches/disable-lockfile-check.patch + ./patches/tcp-stress-test-run-a-smaller-number-of-threads.patch ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch; inherit targets; inherit targetPatches; diff --git a/pkgs/development/compilers/rust/patches/tcp-stress-test-run-a-smaller-number-of-threads.patch b/pkgs/development/compilers/rust/patches/tcp-stress-test-run-a-smaller-number-of-threads.patch new file mode 100644 index 000000000000..1b1d62160f65 --- /dev/null +++ b/pkgs/development/compilers/rust/patches/tcp-stress-test-run-a-smaller-number-of-threads.patch @@ -0,0 +1,44 @@ +From b6202b5d602ca8216febe8ce9078581faa32955e Mon Sep 17 00:00:00 2001 +From: Moritz Ulrich +Date: Sat, 30 Jul 2016 09:01:13 +0200 +Subject: [PATCH] tcp-stress-test: Run a smaller number of threads. + +--- + src/test/run-pass/tcp-stress.rs | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/test/run-pass/tcp-stress.rs b/src/test/run-pass/tcp-stress.rs +index dfc8649..df8cdc9 100644 +--- a/src/test/run-pass/tcp-stress.rs ++++ b/src/test/run-pass/tcp-stress.rs +@@ -21,6 +21,8 @@ use std::sync::mpsc::channel; + use std::time::Duration; + use std::thread::{self, Builder}; + ++const TARGET_CNT: usize = 256; ++ + fn main() { + // This test has a chance to time out, try to not let it time out + thread::spawn(move|| -> () { +@@ -42,8 +44,9 @@ fn main() { + }); + + let (tx, rx) = channel(); ++ + let mut spawned_cnt = 0; +- for _ in 0..1000 { ++ for _ in 0..TARGET_CNT { + let tx = tx.clone(); + let res = Builder::new().stack_size(64 * 1024).spawn(move|| { + match TcpStream::connect(addr) { +@@ -66,6 +69,6 @@ fn main() { + for _ in 0..spawned_cnt { + rx.recv().unwrap(); + } +- assert_eq!(spawned_cnt, 1000); ++ assert_eq!(spawned_cnt, TARGET_CNT); + process::exit(0); + } +-- +2.9.1 +