diff mbox series

[bug#42888] gnu: rust: Fix install phase for non-x86_64 platforms.

Message ID 875z9ips81.fsf@gmx.com
State Accepted
Headers show
Series [bug#42888] gnu: rust: Fix install phase for non-x86_64 platforms. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Pierre Langlois Aug. 16, 2020, 2:42 p.m. UTC
Pierre Langlois writes:

> Hello Guix!
>
> In an optimistic attempt to eventually have Icecat on a Pinebook Pro, I
> thought I'd try and get rust building on aarch64. Here's a fix for the
> post-install phase that had an x86 triplet hardcoded. With this we're
> able to start off the bootstrap chain!
>
> That being said, each step takes ~5 hours on this machine so this is
> going to take a while :-), it's currently working on 1.23.
>
> So, I suppose this should go into either core-updates or staging? WDYT?

Whoops, I forgot the copyright line on that file.

Comments

Maja Kądziołka Aug. 19, 2020, 9:55 p.m. UTC | #1
On Sun, Aug 16, 2020 at 03:42:38PM +0100, Pierre Langlois wrote:
> 
> Pierre Langlois writes:
> 
> > Hello Guix!
> >
> > In an optimistic attempt to eventually have Icecat on a Pinebook Pro, I
> > thought I'd try and get rust building on aarch64. Here's a fix for the
> > post-install phase that had an x86 triplet hardcoded. With this we're
> > able to start off the bootstrap chain!
> >
> > That being said, each step takes ~5 hours on this machine so this is
> > going to take a while :-), it's currently working on 1.23.
> >
> > So, I suppose this should go into either core-updates or staging? WDYT?
> 
> Whoops, I forgot the copyright line on that file.
> 

Pierre,

thanks for your patch! I was working on a similar change before, but
when I tried it, it failed even earlier in the bootstrap chain. It
might've been QEMU weirdness, though, a la #42448.

> @@ -612,9 +613,10 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
>                         (cargo-out (assoc-ref outputs "cargo")))
>                     (for-each
>                       (lambda (file) (delete-manifest-file out file))
> -                     '("install.log"
> +                     `("install.log"
>                         "manifest-rust-docs"
> -                       "manifest-rust-std-x86_64-unknown-linux-gnu"
> +                       ,,(string-append "manifest-rust-std-"
> +                                        (nix-system->gnu-triplet-for-rust))
>                         "manifest-rustc"))
>                     (for-each
>                       (lambda (file) (delete-manifest-file cargo-out file))

If I understand the code correctly, this quasiquote is unnecessary, as
the host-side code will evaluate to a string that can be inserted as-is,
without another unquote on the build side.

Fixing this would mean that the patch can go on master, since it would
now only trigger rebuilds on architectures that are already broken.

I wish you best of luck on your quest for Rust on ARM boards. This has
been a long-standing issue, and it'd be nice to have it fixed. Let me
know if you need any help - I packaged the last few versions, so I got
quite familiar with the various failure modes of the build process. I'm
NieDzejkob on IRC, if you prefer.

Regards,
Jakub Kądziołka
diff mbox series

Patch

From 199c76dc3d92056881fbebc4d1884b0283ed056b Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Sun, 16 Aug 2020 12:17:18 +0100
Subject: [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms.

* gnu/packages/rust.scm (rust-1.20)[arguments]: Replace hardcoded x86_64
triplet with nix-system->gnu-triplet-for-rust in 'delete-install-logs phase.
---
 gnu/packages/rust.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 778aeaab05..17a99aed37 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -9,6 +9,7 @@ 
 ;;; Copyright © 2018 Danny Milosavljevic <dannym+a@scratchpost.org>
 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -612,9 +613,10 @@  jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                        (cargo-out (assoc-ref outputs "cargo")))
                    (for-each
                      (lambda (file) (delete-manifest-file out file))
-                     '("install.log"
+                     `("install.log"
                        "manifest-rust-docs"
-                       "manifest-rust-std-x86_64-unknown-linux-gnu"
+                       ,,(string-append "manifest-rust-std-"
+                                        (nix-system->gnu-triplet-for-rust))
                        "manifest-rustc"))
                    (for-each
                      (lambda (file) (delete-manifest-file cargo-out file))
-- 
2.28.0