summaryrefslogtreecommitdiff
path: root/gnu/packages/rust.scm
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2018-09-20 22:12:10 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2018-09-21 01:31:10 +0200
commit1bfaae25fab372c8ff86e34024adf20240699b55 (patch)
tree41c000e5ca70c5c77bbf326579e5ac567e922848 /gnu/packages/rust.scm
parent83e8b1d7946d07d1c26dd7bd6e11e6e9396024ac (diff)
downloadpatches-1bfaae25fab372c8ff86e34024adf20240699b55.tar
patches-1bfaae25fab372c8ff86e34024adf20240699b55.tar.gz
gnu: rust@1.20.0: Fix tests.
* gnu/packages/rust.scm (rust-1.23)[arguments]<#:phases> [patch-cargo-tests, ignore-glibc-2.27-incompatible-test,fix-mtime-bug]: Move to... (rust-1.20): ... here.
Diffstat (limited to 'gnu/packages/rust.scm')
-rw-r--r--gnu/packages/rust.scm57
1 files changed, 29 insertions, 28 deletions
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 74de6f3ae1..ec8b30d78f 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -514,6 +514,35 @@ safety and thread safety guarantees.")
(substitute-keyword-arguments (package-arguments rust-1.19)
((#:phases phases)
`(modify-phases ,phases
+ (add-after 'patch-tests 'patch-cargo-tests
+ (lambda _
+ (substitute* "src/tools/cargo/tests/build.rs"
+ (("/usr/bin/env") (which "env"))
+ ;; Guix llvm is compiled without asmjs-unknown-emscripten.
+ (("fn wasm32_final_outputs") "#[ignore]\nfn wasm32_final_outputs"))
+ (substitute* "src/tools/cargo/tests/death.rs"
+ ;; This is stuck when built in container.
+ (("fn ctrl_c_kills_everyone") "#[ignore]\nfn ctrl_c_kills_everyone"))
+ ;; Prints test output in the wrong order when built on
+ ;; i686-linux.
+ (substitute* "src/tools/cargo/tests/test.rs"
+ (("fn cargo_test_env") "#[ignore]\nfn cargo_test_env"))
+ #t))
+ (add-after 'patch-cargo-tests 'ignore-glibc-2.27-incompatible-test
+ ;; https://github.com/rust-lang/rust/issues/47863
+ (lambda _
+ (substitute* "src/test/run-pass/out-of-stack.rs"
+ (("// ignore-android") "// ignore-test\n// ignore-android"))
+ #t))
+ (add-after 'ignore-glibc-2.27-incompatible-test 'fix-mtime-bug
+ (lambda* _
+ (substitute* "src/build_helper/lib.rs"
+ ;; Bug in Rust code.
+ ;; Current implementation assume that if dst not exist then it's mtime
+ ;; is 0, but in same time "src" have 0 mtime in guix build!
+ (("let threshold = mtime\\(dst\\);")
+ "if !dst.exists() {\nreturn false\n}\n let threshold = mtime(dst);"))
+ #t))
(replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -651,34 +680,6 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
;; XXX: Revisit this when we use gcc 6.
(substitute* "src/binaryen/CMakeLists.txt"
(("ADD_COMPILE_FLAG\\(\\\"-march=native\\\"\\)") ""))
- #t))
- (add-after 'patch-tests 'patch-cargo-tests
- (lambda _
- (substitute* "src/tools/cargo/tests/build.rs"
- (("/usr/bin/env") (which "env"))
- ;; Guix llvm is compiled without asmjs-unknown-emscripten.
- (("fn wasm32_final_outputs") "#[ignore]\nfn wasm32_final_outputs"))
- (substitute* "src/tools/cargo/tests/death.rs"
- ;; This is stuck when built in container.
- (("fn ctrl_c_kills_everyone") "#[ignore]\nfn ctrl_c_kills_everyone"))
- ;; Prints test output in the wrong order when built on
- ;; i686-linux.
- (substitute* "src/tools/cargo/tests/test.rs"
- (("fn cargo_test_env") "#[ignore]\nfn cargo_test_env"))
- #t))
- (add-after 'patch-cargo-tests 'ignore-glibc-2.27-incompatible-test
- ;; https://github.com/rust-lang/rust/issues/47863
- (lambda _
- (substitute* "src/test/run-pass/out-of-stack.rs"
- (("// ignore-android") "// ignore-test\n// ignore-android"))))
- (add-after 'ignore-glibc-2.27-incompatible-test 'fix-mtime-bug
- (lambda* _
- (substitute* "src/build_helper/lib.rs"
- ;; Bug in Rust code.
- ;; Current implementation assume that if dst not exist then it's mtime
- ;; is 0, but in same time "src" have 0 mtime in guix build!
- (("let threshold = mtime\\(dst\\);")
- "if !dst.exists() {\nreturn false\n}\n let threshold = mtime(dst);"))
#t))))))))
(define-public rust-1.24