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

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

Hi Julien and Marius,

Julien Lepiller writes:

> Le 2018-11-22 14:58, Marius Bakke a écrit:
>> * gnu/packages/rust.scm (rust-1.19)[inputs]: Remove GIT.
>> (rust-1.20)[arguments]: Disable Cargo tests that require git.
>> (rust-1.26)[arguments]: Likewise.
>> ---
>>
>> Notes:
>>     Guix,
>>
>>     The Rust toolchain is very expensive to build and needs less
>> volatility.
>>
>>     So far I have only built up to Rust 1.23 with this patch.  I
>> suggest
>>     applying this on 'core-updates', and giving Rust in 'master' a
>>     git-2.19.1 input to the previous substitutes are valid again.
>>
>>     WDYT?
>
> Hi, I don't really know how our rust packages are built, but I wonder
> if they have more than the bare minimum optional features for our
> purposes (apart from 1.24 used by icecat and the latest version, we
> probably don't need to build everything)? Maybe it's worth
> investigating if that can speed up the build of the whole chain.

One thing I've been wondering about would be to remove the 'check phase
when building a rust that will be used for bootstrapping only. Since the
tests are not ran in parallel, they take a huge amount of time.

See attached patched, I'm testing it now. It's currently building
[email-masked]. WDYT?

Thanks,
Pierre

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

* gnu/packages/rust.scm (rust-bootstrapped-package): Add 'arguments' field
that removes the check phase.
---
 gnu/packages/rust.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index a56faad079..40160de05c 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.
 ;;;
@@ -91,7 +92,15 @@
     (native-inputs
      (alist-replace "cargo-bootstrap" (list base-rust "cargo")
                     (alist-replace "rustc-bootstrap" (list base-rust)
-                                   (package-native-inputs base-rust))))))
+                                   (package-native-inputs base-rust))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments base-rust)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           ;; Tests take a long time to run, as they do not run in parallel
+           ;; for stability reasons. Disable them when building rust for
+           ;; bootstrapping.
+           (delete 'check)))))))
 
 (define-public mrustc
   (let ((rustc-version "1.19.0"))
-- 
2.19.1