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

Message ID cubsgzsngo0.fsf@gmx.com
State Accepted
Headers show
Series [bug#33465] gnu: rust: Don't depend on 'git'. | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied

Commit Message

Pierre Langlois Nov. 23, 2018, 12:04 p.m. UTC
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
rust@1.23. WDYT?

Thanks,
Pierre

Comments

Pierre Langlois Nov. 23, 2018, 4:25 p.m. UTC | #1
> From 46233c5f6ced0ad5e535a848527ad35309535b97 Mon Sep 17 00:00:00 2001
> From: Pierre Langlois <pierre.langlois@gmx.com>
> 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.

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.

Thanks,
Pierre

Patch

From 46233c5f6ced0ad5e535a848527ad35309535b97 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
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 <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Danny Milosavljevic <dannym+a@scratchpost.org>
+;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
 ;;;
 ;;; 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