Subject: [PATCH 2/?] gnu: rust: Add 1.41

From: Jakub Kądziołka <[email-masked]>
Date: Wed, 29 Apr 2020 18:02:18 +0200

---
 gnu/packages/rust.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index a82bfa5912..78cfdfc97a 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1210,4 +1210,37 @@ move around."
                ;; "Remove painful test that is not pulling its weight"
                (delete 'remove-unsupported-tests)))))))))
 
+(define-public rust-1.41
+  (let ((base-rust
+         (rust-bootstrapped-package rust-1.40 "1.41.1"
+           "0ws5x0fxv57fyllsa6025h3q6j9v3m8nb3syl4x0hgkddq0kvj9q")))
+    (package
+      (inherit base-rust)
+      (arguments
+       (substitute-keyword-arguments (package-arguments base-rust)
+         ((#:validate-runpath? _) #t)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             ;; The tests got moved.
+             (replace 'patch-command-exec-tests
+               ,(patch-command-exec-tests-phase
+                  "src/test/ui/command/command-exec.rs"))
+             (replace 'patch-command-uid-gid-test
+               (lambda _
+                 (substitute* "src/test/ui/command/command-uid-gid.rs"
+                   (("/bin/sh") (which "sh"))
+                   (("ignore-sgx") "ignore-sgx\n// ignore-tidy-linelength"))
+                 #t))
+             ;; The test in question got fixed long ago, no need to chase it
+             ;; after renames.
+             (delete 'disable-cargo-test-for-nightly-channel)
+             ;; The patch-tests phase in rust-1.19 uses the fragile approach
+             ;; of inserting additional newlines instead of disabling the tidy
+             ;; check. Fixing this retroactively requires painful rebuilds.
+             (add-after 'patch-tests 'ignore-tidy-linelength
+               (lambda _
+                 (let ((port (open-file "src/libstd/process.rs" "a")))
+                   (display "// ignore-tidy-linelength\n" port))
+                 #t)))))))))
+
 (define-public rust rust-1.37)
-- 
2.26.2