unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#42888] [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms.
@ 2020-08-16 14:12 Pierre Langlois
  2020-08-16 14:19 ` Efraim Flashner
  2020-08-16 14:42 ` Pierre Langlois
  0 siblings, 2 replies; 8+ messages in thread
From: Pierre Langlois @ 2020-08-16 14:12 UTC (permalink / raw)
  To: 42888

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

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?

Thanks!
Pierre


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-rust-Fix-install-phase-for-non-x86_64-platforms.patch --]
[-- Type: text/x-patch, Size: 1377 bytes --]

From ac0415f8f724ec56022b526ade68c1aa708d51ea 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 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 778aeaab05..a031683ea5 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -612,9 +612,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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#42888] [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms.
  2020-08-16 14:12 [bug#42888] [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms Pierre Langlois
@ 2020-08-16 14:19 ` Efraim Flashner
  2020-08-16 14:42 ` Pierre Langlois
  1 sibling, 0 replies; 8+ messages in thread
From: Efraim Flashner @ 2020-08-16 14:19 UTC (permalink / raw)
  To: Pierre Langlois; +Cc: 42888

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

On Sun, Aug 16, 2020 at 03:12:08PM +0100, Pierre Langlois wrote:
> 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!

I forgot about that! It takes so long to build I never bothered with it
on my boards.

> 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?

I'd go with staging. No one wants to rebuild the rust bootstrap, but
they're basically all leaf packages so it's fine.

> 
> Thanks!
> Pierre
> 



-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#42888] [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms.
  2020-08-16 14:12 [bug#42888] [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms Pierre Langlois
  2020-08-16 14:19 ` Efraim Flashner
@ 2020-08-16 14:42 ` Pierre Langlois
  2020-08-19 21:55   ` Jakub Kądziołka
  1 sibling, 1 reply; 8+ messages in thread
From: Pierre Langlois @ 2020-08-16 14:42 UTC (permalink / raw)
  To: Pierre Langlois; +Cc: 42888

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]


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.


[-- Attachment #2: 0001-gnu-rust-Fix-install-phase-for-non-x86_64-platforms.patch --]
[-- Type: text/x-patch, Size: 1705 bytes --]

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#42888] [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms.
  2020-08-16 14:42 ` Pierre Langlois
@ 2020-08-19 21:55   ` Jakub Kądziołka
  2020-08-20 20:55     ` Pierre Langlois
  0 siblings, 1 reply; 8+ messages in thread
From: Jakub Kądziołka @ 2020-08-19 21:55 UTC (permalink / raw)
  To: Pierre Langlois; +Cc: 42888

[-- Attachment #1: Type: text/plain, Size: 2333 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#42888] [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms.
  2020-08-19 21:55   ` Jakub Kądziołka
@ 2020-08-20 20:55     ` Pierre Langlois
  2020-09-19 13:36       ` Pierre Langlois
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre Langlois @ 2020-08-20 20:55 UTC (permalink / raw)
  To: Jakub Kądziołka; +Cc: pierre.langlois, 42888

[-- Attachment #1: Type: text/plain, Size: 3270 bytes --]

Hi Jakub,

Jakub Kądziołka writes:

> 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.

Ooooh yeah, that'll be much better, I've attached a patch that does just
that. I can confirm it doesn't trigger a full rebuild, nice!

> 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.

haha, thanks :-), I haven't got very far with it yet, the build failed
at 1.23 with a test case failure. Something to do with receiving the
wrong signal on an expected crash. I'm optimistic though!

I don't have the build log around anymore, but we can see if the CI has
the same problem. I haven't spent much time investigating, instead
thinking I'm better off trying to get the patches that allow
bootstrapping from 1.29 working. I was planning on looking into that.

Otherwise we can skip any tests that don't pass and carry on, I suspect
it's normal behaviour on that platform and the tests need updating.  I
think aarch64 is officially supported now but it's probably quite
recent.

Thanks,
Pierre


[-- Attachment #2: 0001-gnu-rust-Fix-install-phase-for-non-x86_64-platforms.patch --]
[-- Type: text/x-patch, Size: 1564 bytes --]

From c2b9142fb3de5dd27f26914d89eb08750a3f33fb 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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 778aeaab05..7571cfee3f 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.
 ;;;
@@ -614,7 +615,8 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                      (lambda (file) (delete-manifest-file out file))
                      '("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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#42888] [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms.
  2020-08-20 20:55     ` Pierre Langlois
@ 2020-09-19 13:36       ` Pierre Langlois
  2020-09-25 18:57         ` Marius Bakke
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre Langlois @ 2020-09-19 13:36 UTC (permalink / raw)
  To: 42888; +Cc: Pierre Langlois


[-- Attachment #1.1: Type: text/plain, Size: 1780 bytes --]

Hello Guix!

Pierre Langlois writes:

> Hi Jakub,
>
> Jakub Kądziołka writes:
>

(snip)

>> 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.
>
> Ooooh yeah, that'll be much better, I've attached a patch that does just
> that. I can confirm it doesn't trigger a full rebuild, nice!
>

I've just rebased this patch and fixed a little formatting issue. I've
made sure, it doesn't trigger any rust rebuilds on x86.

Is this OK to commit?

Thanks,
Pierre


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 519 bytes --]

[-- Attachment #2: 0001-gnu-rust-Fix-install-phase-for-non-x86_64-platforms.patch --]
[-- Type: text/x-patch, Size: 1563 bytes --]

From 207071445a0a637075138fb678bdbcdcfbaa038d 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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index d5914f012b..1690ad96c5 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.
 ;;;
@@ -614,7 +615,8 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                      (lambda (file) (delete-manifest-file out file))
                      '("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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#42888] [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms.
  2020-09-19 13:36       ` Pierre Langlois
@ 2020-09-25 18:57         ` Marius Bakke
  2020-09-25 20:03           ` bug#42888: " Pierre Langlois
  0 siblings, 1 reply; 8+ messages in thread
From: Marius Bakke @ 2020-09-25 18:57 UTC (permalink / raw)
  To: Pierre Langlois, 42888; +Cc: Pierre Langlois

[-- Attachment #1: Type: text/plain, Size: 1984 bytes --]

Pierre Langlois <pierre.langlois@gmx.com> writes:

> Hello Guix!
>
> Pierre Langlois writes:
>
>> Hi Jakub,
>>
>> Jakub Kądziołka writes:
>>
>
> (snip)
>
>>> 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.
>>
>> Ooooh yeah, that'll be much better, I've attached a patch that does just
>> that. I can confirm it doesn't trigger a full rebuild, nice!
>>
>
> I've just rebased this patch and fixed a little formatting issue. I've
> made sure, it doesn't trigger any rust rebuilds on x86.
>
> Is this OK to commit?

LGTM!  Thanks a lot for tackling this long-standing issue.

Were you able to build all the way to the latest Rust?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#42888: [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms.
  2020-09-25 18:57         ` Marius Bakke
@ 2020-09-25 20:03           ` Pierre Langlois
  0 siblings, 0 replies; 8+ messages in thread
From: Pierre Langlois @ 2020-09-25 20:03 UTC (permalink / raw)
  To: Marius Bakke; +Cc: Pierre Langlois, 42888-done


[-- Attachment #1.1: Type: text/plain, Size: 3388 bytes --]


Marius Bakke writes:

> Pierre Langlois <pierre.langlois@gmx.com> writes:
>
>> Hello Guix!
>>
>> Pierre Langlois writes:
>>
>>> Hi Jakub,
>>>
>>> Jakub Kądziołka writes:
>>>
>>
>> (snip)
>>
>>>> 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.
>>>
>>> Ooooh yeah, that'll be much better, I've attached a patch that does just
>>> that. I can confirm it doesn't trigger a full rebuild, nice!
>>>
>>
>> I've just rebased this patch and fixed a little formatting issue. I've
>> made sure, it doesn't trigger any rust rebuilds on x86.
>>
>> Is this OK to commit?
>
> LGTM!  Thanks a lot for tackling this long-standing issue.

Thanks! Pushed as 2bab532fdfaa54a085abc0ac7fc2c859ee31f640.

>
> Were you able to build all the way to the latest Rust?

No not yet :-/, I got it building up to 1.26, having to fix most steps
with tests failing here and there. In the end I ran out of steam trying
to build 1.27 and thought we'd be better off waiting until we can
bootstrap from 1.29. I don't remember exactly what issues I had with
1.27, I've attacked my WIP patch in case somebody is interested
actually!

After that, I gave the patches on https://issues.guix.gnu.org/38110 a
go, however as Danny mentions on the thread, linking consumes too much
memory. I'm using a RockPro64 and it only has 4G of RAM.

Somebody on github https://github.com/thepowersgang/mrustc/issues/138
mentioned we could try building with LLD so I tried that as well (patch
attached) but memory consumption was still too much. That being said, I
might not have had any swap file at the time, I'll try again :-).

Soooo, yeah I don't know what the best approach is. We can try and get
the current chain building and start upstreaming bits of my WIP patch or
try and find a solution for the mrustc memory issue.

Anyway, I haven't given up! :-) I'd really like to see IceCat on aarch64
eventually for the PineBook Pro. Although there are quite a few other
things to fix on that platform first.

Thanks,
Pierre


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 519 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-wip.patch --]
[-- Type: text/x-patch, Size: 8513 bytes --]

From d44837f66c682e7111328adbfa34ea0cd6dfb6f6 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Tue, 1 Sep 2020 00:29:38 +0100
Subject: [PATCH] wip

---
 .../rust-1.26-fix-simd-doctest-non-x86.patch  | 25 ++++++++++++++
 .../rust-1.27-fix-simd-doctest-non-x86.patch  | 31 +++++++++++++++++
 gnu/packages/rust.scm                         | 33 ++++++++++++++++++-
 3 files changed, 88 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/rust-1.26-fix-simd-doctest-non-x86.patch
 create mode 100644 gnu/packages/patches/rust-1.27-fix-simd-doctest-non-x86.patch

diff --git a/gnu/packages/patches/rust-1.26-fix-simd-doctest-non-x86.patch b/gnu/packages/patches/rust-1.26-fix-simd-doctest-non-x86.patch
new file mode 100644
index 0000000000..6d11fc9f12
--- /dev/null
+++ b/gnu/packages/patches/rust-1.26-fix-simd-doctest-non-x86.patch
@@ -0,0 +1,25 @@
+From: QuietMisdreavus <grey@quietmisdreavus.net>
+Backported from https://github.com/rust-lang/stdarch/pull/466/commits/072a51187df3ed7bb9f1f200be65ecef33b88c76
+
+diff --git a/src/stdsimd/coresimd/mod.rs b/src/stdsimd/coresimd/mod.rs
+index c35eb418..939417ba 100644
+--- a/src/stdsimd/coresimd/mod.rs
++++ b/src/stdsimd/coresimd/mod.rs
+@@ -86,13 +86,17 @@ pub mod arch {
+ mod simd_llvm;
+
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64", dox))]
++#[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))]
+ mod x86;
+ #[cfg(any(target_arch = "x86_64", dox))]
++#[doc(cfg(target_arch = "x86_64"))]
+ mod x86_64;
+
+ #[cfg(any(target_arch = "arm", target_arch = "aarch64", dox))]
++#[doc(cfg(any(target_arch = "arm", target_arch = "aarch64")))]
+ mod arm;
+ #[cfg(any(target_arch = "aarch64", dox))]
++#[doc(cfg(target_arch = "aarch64"))]
+ mod aarch64;
+ #[cfg(target_arch = "wasm32")]
+ mod wasm32;
diff --git a/gnu/packages/patches/rust-1.27-fix-simd-doctest-non-x86.patch b/gnu/packages/patches/rust-1.27-fix-simd-doctest-non-x86.patch
new file mode 100644
index 0000000000..0f67c3bee6
--- /dev/null
+++ b/gnu/packages/patches/rust-1.27-fix-simd-doctest-non-x86.patch
@@ -0,0 +1,31 @@
+From: QuietMisdreavus <grey@quietmisdreavus.net>
+Backported from https://github.com/rust-lang/stdarch/pull/466/commits/072a51187df3ed7bb9f1f200be65ecef33b88c76
+
+diff --git a/src/stdsimd/coresimd/mod.rs b/src/stdsimd/coresimd/mod.rs
+index 9cf63d14..27c91d8b 100644
+--- a/src/stdsimd/coresimd/mod.rs
++++ b/src/stdsimd/coresimd/mod.rs
+@@ -121,18 +121,22 @@ pub mod arch {
+ mod simd_llvm;
+
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64", dox))]
++#[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))]
+ mod x86;
+ #[cfg(any(target_arch = "x86_64", dox))]
++#[doc(cfg(target_arch = "x86_64"))]
+ mod x86_64;
+
+ #[cfg(any(target_arch = "aarch64", dox))]
++#[doc(cfg(target_arch = "aarch64"))]
+ mod aarch64;
+ #[cfg(any(target_arch = "arm", target_arch = "aarch64", dox))]
++#[doc(cfg(any(target_arch = "arm", target_arch = "aarch64")))]
+ mod arm;
+ #[cfg(target_arch = "wasm32")]
+ mod wasm32;
+
+-#[cfg(any(target_arch = "mips", target_arch = "mips64", dox))]
++#[doc(cfg(any(target_arch = "mips", target_arch = "mips64")))]
+ mod mips;
+
+ mod nvptx;
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 05404de1d8..6f4ba0eb18 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -682,6 +682,11 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                  ;; XXX: Revisit this when we use gcc 6.
                  (substitute* "src/binaryen/CMakeLists.txt"
                   (("ADD_COMPILE_FLAG\\(\\\"-march=native\\\"\\)") ""))
+                 #t))
+             (add-after 'unpack 'remove-failing-test-aarch64
+               (lambda _
+                 (if (string-prefix? "aarch64" ,(%current-system))
+                   (delete-file "src/test/compile-fail/required-lang-item.rs"))
                  #t)))))))))

 (define-public rust-1.24
@@ -695,6 +700,11 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
          ((#:phases phases)
           `(modify-phases ,phases
              (delete 'use-readelf-for-tests)
+             (replace 'remove-failing-test-aarch64
+               (lambda* _
+                 (if (string-prefix? "aarch64" ,(%current-system))
+                   (delete-file "src/test/run-pass/mir_heavy_promoted.rs"))
+                 #t))
              (replace 'patch-aarch64-test
                (lambda* _
                  (substitute* "src/librustc_metadata/dynamic_lib.rs"
@@ -732,6 +742,11 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                    ;; This test wants to update the crate index.
                    (("fn no_index_update") "#[ignore]\nfn no_index_update"))
                  #t))
+             (replace 'remove-failing-test-aarch64
+               (lambda* _
+                 (if (string-prefix? "aarch64" ,(%current-system))
+                   (delete-file "src/test/debuginfo/pretty-uninitialized-vec.rs"))
+                 #t))
              (replace 'patch-aarch64-test
                (lambda _
                  (substitute* "src/librustc_metadata/dynamic_lib.rs"
@@ -757,7 +772,9 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
           (inherit (package-source base-rust))
           (patches (search-patches
                      "rust-coresimd-doctest.patch"
-                     "rust-1.25-accept-more-detailed-gdb-lines.patch"))))
+                     "rust-1.25-accept-more-detailed-gdb-lines.patch"
+                     ;; Fix for https://github.com/rust-lang/rust/issues/50988.
+                     "rust-1.26-fix-simd-doctest-non-x86.patch"))))
       (arguments
        (substitute-keyword-arguments (package-arguments base-rust)
          ((#:phases phases)
@@ -780,6 +797,14 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                  ;; <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00193.html>
                  (delete-file-recursively "src/test/run-make-fulldeps/linker-output-non-utf8")
                  #t))
+             (replace 'remove-failing-test-aarch64
+               (lambda* _
+                 (if (string-prefix? "aarch64" ,(%current-system))
+                   (begin
+                     (delete-file "src/test/compile-fail/dupe-symbols-7.rs")
+                     (delete-file "src/test/compile-fail/issue-15919.rs")
+                     (delete-file "src/test/debuginfo/pretty-uninitialized-vec.rs")))
+                 #t))
              (replace 'patch-cargo-tests
                (lambda* _
                  (substitute* "src/tools/cargo/tests/testsuite/build.rs"
@@ -828,6 +853,8 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
           (patches (search-patches "rust-coresimd-doctest.patch"
                                    "rust-bootstrap-stage0-test.patch"
                                    "rust-1.25-accept-more-detailed-gdb-lines.patch"
+                                   ;; Fix for https://github.com/rust-lang/rust/issues/50988.
+                                   "rust-1.27-fix-simd-doctest-non-x86.patch"
                                    "rust-reproducible-builds.patch"))))
       (native-inputs
        ;; FIXME: Rust 1.27 and some later versions require GDB 8.2 specifically.
@@ -864,6 +891,8 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
           (patches (search-patches "rust-coresimd-doctest.patch"
                                    "rust-bootstrap-stage0-test.patch"
                                    "rust-1.25-accept-more-detailed-gdb-lines.patch"
+                                   ;; Fix for https://github.com/rust-lang/rust/issues/50988.
+                                   "rust-1.27-fix-simd-doctest-non-x86.patch"
                                    "rust-reproducible-builds.patch"))))
       (inputs
        ;; Use LLVM 6.0
@@ -898,6 +927,8 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
         (origin
           (inherit (package-source base-rust))
           (patches (search-patches "rust-1.25-accept-more-detailed-gdb-lines.patch"
+                                   ;; Fix for https://github.com/rust-lang/rust/issues/50988.
+                                   "rust-1.27-fix-simd-doctest-non-x86.patch"
                                    "rust-reproducible-builds.patch")))))))

 (define-public rust-1.30
--
2.28.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-mrustc-Use-lld.patch --]
[-- Type: text/x-patch, Size: 2403 bytes --]

From 30b2f19fc1edabbcf929d400f289220875440ffe Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Tue, 1 Sep 2020 00:46:47 +0100
Subject: [PATCH 1/2] mrustc: Use lld.

---
 gnu/packages/patches/mrustc-use-lld.patch | 12 ++++++++++++
 gnu/packages/rust.scm                     |  9 +++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/mrustc-use-lld.patch

diff --git a/gnu/packages/patches/mrustc-use-lld.patch b/gnu/packages/patches/mrustc-use-lld.patch
new file mode 100644
index 0000000000..2df1f6f8f2
--- /dev/null
+++ b/gnu/packages/patches/mrustc-use-lld.patch
@@ -0,0 +1,12 @@
+diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp
+index df0abf6f..7ab8d183 100644
+--- a/src/trans/codegen_c.cpp
++++ b/src/trans/codegen_c.cpp
+@@ -953,6 +953,7 @@ namespace {
+                     break;
+                 }
+                 args.push_back(m_outfile_path_c.c_str());
++                args.push_back("-fuse-ld=lld");
+                 switch(out_ty)
+                 {
+                 case CodegenOutput::DynamicLibrary:
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 89d0ffee31..97952e8ebe 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -128,14 +128,17 @@
                 (file-name (git-file-name name version))
                 (sha256
                  (base32
-                  "194ny7vsks5ygiw7d8yxjmp1qwigd71ilchis6xjl6bb2sj97rd2"))))
+                  "194ny7vsks5ygiw7d8yxjmp1qwigd71ilchis6xjl6bb2sj97rd2"))
+                (patches (search-patches "mrustc-use-lld.patch"))))
       (outputs '("out" "cargo"))
       (build-system gnu-build-system)
       (inputs
-       `(("zlib" ,zlib)))
+       `(("lld" ,lld)
+         ("zlib" ,zlib)))
       (native-inputs
        `(("bison" ,bison)
          ("flex" ,flex)
+         ("gcc" ,gcc-10)
          ;; Required for the libstd sources.
          ("rustc" ,(package-source rust-1.29))))
       (arguments
@@ -418,6 +421,8 @@ safety and thread safety guarantees.")
        ("cmake" ,cmake-minimal)
        ("flex" ,flex) ; For the tests
        ("gdb" ,gdb)   ; For the tests
+       ("gcc" ,gcc-10)
+       ("lld" ,lld)
        ("procps" ,procps) ; For the tests
        ("python-2" ,python-2)
        ("rustc-bootstrap" ,mrustc)
--
2.28.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-09-25 20:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-16 14:12 [bug#42888] [PATCH] gnu: rust: Fix install phase for non-x86_64 platforms Pierre Langlois
2020-08-16 14:19 ` Efraim Flashner
2020-08-16 14:42 ` Pierre Langlois
2020-08-19 21:55   ` Jakub Kądziołka
2020-08-20 20:55     ` Pierre Langlois
2020-09-19 13:36       ` Pierre Langlois
2020-09-25 18:57         ` Marius Bakke
2020-09-25 20:03           ` bug#42888: " Pierre Langlois

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).