Subject: Re: [bug#33465] [PATCH] gnu: rust: Don't depend on 'git'.

From: Pierre Langlois <[email-masked]>
Date: Fri, 23 Nov 2018 17:47:33 +0000

Pierre Langlois writes:

> Whoops, ignore that patch, it doesn't do what I wanted it to do. The
> point was to skip the tests *only* for temporary packages used for
> bootstrapping the final one. But here it's disabled the tests all the
> time, we don't want that... my bad!  I'll another look when I have time.

Right, attached is what I meant to do.

Thanks!
Pierre

>From 326a4761b03c50481d44d5b485954d823006bbb8 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <[email-masked]>
Date: Fri, 23 Nov 2018 11:58:06 +0000
Subject: [PATCH v2] gnu: rust: Do not run tests when building for bootstrapping.

* gnu/packages/rust.scm (rust-bootstrapped-package): Create a temporary
rust-bootstrap package that inherits from base-rust and removes the check
phase.  Then use it for the cargo-bootsrap and rustc-bootstrap native inputs.
---
 gnu/packages/rust.scm | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index a56faad079..7d416836aa 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2017 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2018 Danny Milosavljevic <[email-masked]>
+;;; Copyright © 2018 Pierre Langlois <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -83,15 +84,26 @@
 (define* (rust-bootstrapped-package base-rust version checksum
                                     #:key (patches '()))
   "Bootstrap rust VERSION with source checksum CHECKSUM patched with PATCHES using BASE-RUST."
-  (package
-    (inherit base-rust)
-    (version version)
-    (source
-     (rust-source version checksum #:patches patches))
-    (native-inputs
-     (alist-replace "cargo-bootstrap" (list base-rust "cargo")
-                    (alist-replace "rustc-bootstrap" (list base-rust)
-                                   (package-native-inputs base-rust))))))
+  ;; Tests take a long time to run, as they do not run in parallel for
+  ;; stability reasons.  Disable them when building the rust used for
+  ;; bootstrapping.
+  (let ((rust-bootstrap
+         (package
+           (inherit base-rust)
+           (arguments
+            (substitute-keyword-arguments (package-arguments base-rust)
+              ((#:phases phases)
+               `(modify-phases ,phases
+                  (delete 'check))))))))
+    (package
+      (inherit base-rust)
+      (version version)
+      (source
+       (rust-source version checksum #:patches patches))
+      (native-inputs
+       (alist-replace "cargo-bootstrap" (list rust-bootstrap "cargo")
+                      (alist-replace "rustc-bootstrap" (list rust-bootstrap)
+                                     (package-native-inputs base-rust)))))))
 
 (define-public mrustc
   (let ((rustc-version "1.19.0"))
-- 
2.19.2