unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#40556] [PATCH] gnu: dovecot: Add libunwind input.
@ 2020-04-11 15:42 Pierre Langlois
  2020-04-11 16:17 ` Tobias Geerinckx-Rice via Guix-patches via
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre Langlois @ 2020-04-11 15:42 UTC (permalink / raw)
  To: 40556; +Cc: Julien Lepiller

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

Hi Guix, Julien,

I noticed I couldn't build dovecot on either aarch64 or arm :-/. I did a
little bit of debugging, and it looks like the backtrace_symbols()
function isn't working correctly. Dovecot is able to use libunwind
instead, and this appears to work.

I then noticed it was reported upstream already, coming to the same
conclusion https://markmail.org/message/fjgo7lkuk7tk4iek

I wonder what's wrong with backtrace_symbols() in guix, I'm not sure how
to investigate that. For now though, what do you think of using
libunwind?

Thanks,
Pierre


[-- Attachment #2: 0001-gnu-dovecot-Add-libunwind-input.patch --]
[-- Type: text/x-patch, Size: 1687 bytes --]

From b95b8f4769f5543d196fe7e334a891f8fe276816 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Sat, 11 Apr 2020 16:34:01 +0100
Subject: [PATCH] gnu: dovecot: Add libunwind input.

* gnu/packages/mail.scm (dovecot)[inputs]: Add libunwind.
---
 gnu/packages/mail.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index a6ed776db1..4ea8fb6051 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -24,7 +24,7 @@
 ;;; Copyright © 2017 Kyle Meyer <kyle@kyleam.com>
 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017, 2018 Rene Saavedra <pacoon@protonmail.com>
-;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2018, 2019, 2020 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
@@ -89,6 +89,7 @@
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libidn)
   #:use-module (gnu packages libunistring)
+  #:use-module (gnu packages libunwind)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lsof)
   #:use-module (gnu packages lua)
@@ -1435,6 +1436,7 @@ facilities for checking incoming mail.")
     (inputs
      `(("bzip2" ,bzip2)
        ("libsodium" ,libsodium)         ; extra password algorithms
+       ("libunwind" ,libunwind)
        ("linux-pam" ,linux-pam)
        ("lz4" ,lz4)
        ("openssl" ,openssl)
-- 
2.26.0


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

* [bug#40556] [PATCH] gnu: dovecot: Add libunwind input.
  2020-04-11 15:42 [bug#40556] [PATCH] gnu: dovecot: Add libunwind input Pierre Langlois
@ 2020-04-11 16:17 ` Tobias Geerinckx-Rice via Guix-patches via
  2020-04-11 16:53   ` Pierre Langlois
  0 siblings, 1 reply; 8+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-04-11 16:17 UTC (permalink / raw)
  To: 40556, Pierre Langlois

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

Pierre,

Pierre Langlois 写道:
> I wonder what's wrong with backtrace_symbols() in guix, I'm not 
> sure how
> to investigate that. For now though, what do you think of using
> libunwind?

OK, but it should only be included on platforms that require it:

  ;; Untested…
  (inputs
   `(…
     ,@(match (%current-system)
         ((or "aarch64-linux" "armhf-linux" …)
          `(("libunwind" ,libunwind)))
         (_ `()))
     …))

Could you test that?

Kind regards,

T G-R

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

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

* [bug#40556] [PATCH] gnu: dovecot: Add libunwind input.
  2020-04-11 16:17 ` Tobias Geerinckx-Rice via Guix-patches via
@ 2020-04-11 16:53   ` Pierre Langlois
  2020-04-11 17:56     ` Julien Lepiller
  2020-04-16 16:24     ` Ludovic Courtès
  0 siblings, 2 replies; 8+ messages in thread
From: Pierre Langlois @ 2020-04-11 16:53 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: Pierre Langlois, 40556

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


Tobias Geerinckx-Rice writes:

> Pierre,
>
> Pierre Langlois 写道:
>> I wonder what's wrong with backtrace_symbols() in guix, I'm not sure
>> how
>> to investigate that. For now though, what do you think of using
>> libunwind?
>
> OK, but it should only be included on platforms that require it:

Oh sure thing!

>
>  ;; Untested…
>  (inputs
>   `(…
>     ,@(match (%current-system)
>         ((or "aarch64-linux" "armhf-linux" …)
>          `(("libunwind" ,libunwind)))
>         (_ `()))
>     …))
>
> Could you test that?

OK, the following patch works for me (tested building for armhf and
aarch64 on a rockpro64). I've also added a "FIXME" comment to mention
the issue so we can remove/keep it when we have a good understanding of
what's going on.


[-- Attachment #2: 0001-gnu-dovecot-Add-libunwind-input-for-arm.patch --]
[-- Type: text/x-patch, Size: 2050 bytes --]

From ea4c7a2dec7c81951cf0d27cbb669ef39b07de95 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Sat, 11 Apr 2020 16:34:01 +0100
Subject: [PATCH] gnu: dovecot: Add libunwind input for arm.

* gnu/packages/mail.scm (dovecot)[inputs]: Add libunwind if the system is
either aarch64-linux or armhf-linux.
---
 gnu/packages/mail.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index a6ed776db1..91577f72b1 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -24,7 +24,7 @@
 ;;; Copyright © 2017 Kyle Meyer <kyle@kyleam.com>
 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017, 2018 Rene Saavedra <pacoon@protonmail.com>
-;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2018, 2019, 2020 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
@@ -89,6 +89,7 @@
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libidn)
   #:use-module (gnu packages libunistring)
+  #:use-module (gnu packages libunwind)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lsof)
   #:use-module (gnu packages lua)
@@ -1435,6 +1436,12 @@ facilities for checking incoming mail.")
     (inputs
      `(("bzip2" ,bzip2)
        ("libsodium" ,libsodium)         ; extra password algorithms
+       ;; FIXME: The 'test-backtrace' tests fail on arm when using glibc's
+       ;; backtrace_symbol() function so fallback to using libunwind.
+       ,@(match (or (%current-target-system) (%current-system))
+           ((or "aarch64-linux" "armhf-linux")
+            `(("libunwind" ,libunwind)))
+           (_ '()))
        ("linux-pam" ,linux-pam)
        ("lz4" ,lz4)
        ("openssl" ,openssl)
-- 
2.26.0


[-- Attachment #3: Type: text/plain, Size: 16 bytes --]


Thanks,
Pierre

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

* [bug#40556] [PATCH] gnu: dovecot: Add libunwind input.
  2020-04-11 16:53   ` Pierre Langlois
@ 2020-04-11 17:56     ` Julien Lepiller
  2020-04-16 16:24     ` Ludovic Courtès
  1 sibling, 0 replies; 8+ messages in thread
From: Julien Lepiller @ 2020-04-11 17:56 UTC (permalink / raw)
  To: Pierre Langlois, Tobias Geerinckx-Rice; +Cc: 40556

Le 11 avril 2020 12:53:29 GMT-04:00, Pierre Langlois <pierre.langlois@gmx.com> a écrit :
>
>Tobias Geerinckx-Rice writes:
>
>> Pierre,
>>
>> Pierre Langlois 写道:
>>> I wonder what's wrong with backtrace_symbols() in guix, I'm not sure
>>> how
>>> to investigate that. For now though, what do you think of using
>>> libunwind?
>>
>> OK, but it should only be included on platforms that require it:
>
>Oh sure thing!
>
>>
>>  ;; Untested…
>>  (inputs
>>   `(…
>>     ,@(match (%current-system)
>>         ((or "aarch64-linux" "armhf-linux" …)
>>          `(("libunwind" ,libunwind)))
>>         (_ `()))
>>     …))
>>
>> Could you test that?
>
>OK, the following patch works for me (tested building for armhf and
>aarch64 on a rockpro64). I've also added a "FIXME" comment to mention
>the issue so we can remove/keep it when we have a good understanding of
>what's going on.

Great, thanks for working on it, I had totally forgotten about it, because I fixed it in my systems by not running tests. There's also a bug report I sent to bug-guix I think. Adding libunwind should work. I remember testing it once, but it was just too long and I forgot about it ^^"

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

* [bug#40556] [PATCH] gnu: dovecot: Add libunwind input.
  2020-04-11 16:53   ` Pierre Langlois
  2020-04-11 17:56     ` Julien Lepiller
@ 2020-04-16 16:24     ` Ludovic Courtès
  2020-04-16 17:13       ` Pierre Langlois
  1 sibling, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2020-04-16 16:24 UTC (permalink / raw)
  To: Pierre Langlois; +Cc: Tobias Geerinckx-Rice, 40556

Hi,

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

> +       ;; FIXME: The 'test-backtrace' tests fail on arm when using glibc's
> +       ;; backtrace_symbol() function so fallback to using libunwind.
> +       ,@(match (or (%current-target-system) (%current-system))
> +           ((or "aarch64-linux" "armhf-linux")
> +            `(("libunwind" ,libunwind)))
> +           (_ '()))

This isn’t quite correct because ‘%current-target-system’ returns a
triplet, like “arm-linux-gnueabihf”.

Use ‘target-arm?’ instead.

TIA!

Ludo’.

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

* [bug#40556] [PATCH] gnu: dovecot: Add libunwind input.
  2020-04-16 16:24     ` Ludovic Courtès
@ 2020-04-16 17:13       ` Pierre Langlois
  2020-04-16 17:41         ` Pierre Langlois
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre Langlois @ 2020-04-16 17:13 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Pierre Langlois, Tobias Geerinckx-Rice, 40556

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

Hi Ludo!

Ludovic Courtès writes:

> Hi,
>
> Pierre Langlois <pierre.langlois@gmx.com> skribis:
>
>> +       ;; FIXME: The 'test-backtrace' tests fail on arm when using glibc's
>> +       ;; backtrace_symbol() function so fallback to using libunwind.
>> +       ,@(match (or (%current-target-system) (%current-system))
>> +           ((or "aarch64-linux" "armhf-linux")
>> +            `(("libunwind" ,libunwind)))
>> +           (_ '()))
>
> This isn’t quite correct because ‘%current-target-system’ returns a
> triplet, like “arm-linux-gnueabihf”.

Oups, I didn't realize the cross-compilation target was different.

>
> Use ‘target-arm?’ instead.

Yep, that works really nicely, it's much clearer.

I've tested on x86_64, arm and aarch64 natively. I'll try
cross-compiling with --target=arm-linux-gnueabihf and
--target=aarch64-linux-gnu as well but that'll take a little longer.

Thanks!
Pierre


[-- Attachment #2: 0001-gnu-dovecot-Add-libunwind-input-for-arm.patch --]
[-- Type: text/x-patch, Size: 1921 bytes --]

From d56005a2d839e36cd9f718041d8634f34cf2177a Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Sat, 11 Apr 2020 16:34:01 +0100
Subject: [PATCH] gnu: dovecot: Add libunwind input for arm.

* gnu/packages/mail.scm (dovecot)[inputs]: Add libunwind when targetting arm.
---
 gnu/packages/mail.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 0a88c20a6e..8d55d157e5 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -24,7 +24,7 @@
 ;;; Copyright © 2017 Kyle Meyer <kyle@kyleam.com>
 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017, 2018 Rene Saavedra <pacoon@protonmail.com>
-;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2018, 2019, 2020 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
@@ -89,6 +89,7 @@
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libidn)
   #:use-module (gnu packages libunistring)
+  #:use-module (gnu packages libunwind)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lsof)
   #:use-module (gnu packages lua)
@@ -1435,6 +1436,11 @@ facilities for checking incoming mail.")
     (inputs
      `(("bzip2" ,bzip2)
        ("libsodium" ,libsodium)         ; extra password algorithms
+       ;; FIXME: The 'test-backtrace' tests fail on arm when using glibc's
+       ;; backtrace_symbol() function so fallback to using libunwind.
+       ,@(if (target-arm?)
+          `(("libunwind" ,libunwind))
+          '())
        ("linux-pam" ,linux-pam)
        ("lz4" ,lz4)
        ("openssl" ,openssl)
-- 
2.26.1


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

* [bug#40556] [PATCH] gnu: dovecot: Add libunwind input.
  2020-04-16 17:13       ` Pierre Langlois
@ 2020-04-16 17:41         ` Pierre Langlois
  2020-04-17  8:20           ` bug#40556: " Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre Langlois @ 2020-04-16 17:41 UTC (permalink / raw)
  To: Pierre Langlois; +Cc: Ludovic Courtès, Tobias Geerinckx-Rice, 40556


Pierre Langlois writes:

> Hi Ludo!
>
> Ludovic Courtès writes:
>
>> Hi,
>>
>> Pierre Langlois <pierre.langlois@gmx.com> skribis:
>>
>>> +       ;; FIXME: The 'test-backtrace' tests fail on arm when using glibc's
>>> +       ;; backtrace_symbol() function so fallback to using libunwind.
>>> +       ,@(match (or (%current-target-system) (%current-system))
>>> +           ((or "aarch64-linux" "armhf-linux")
>>> +            `(("libunwind" ,libunwind)))
>>> +           (_ '()))
>>
>> This isn’t quite correct because ‘%current-target-system’ returns a
>> triplet, like “arm-linux-gnueabihf”.
>
> Oups, I didn't realize the cross-compilation target was different.
>
>>
>> Use ‘target-arm?’ instead.
>
> Yep, that works really nicely, it's much clearer.
>
> I've tested on x86_64, arm and aarch64 natively. I'll try
> cross-compiling with --target=arm-linux-gnueabihf and
> --target=aarch64-linux-gnu as well but that'll take a little longer.

Right, it seems dovecot isn't yet cross-compilable, but cross-compiling
libunwind works just fine. With dovecot I get a failure trying to
compile perl natively, as openssl's native-input I believe.

```
$ ./pre-inst-env guix build --target=aarch64-linux-gnu openssl
...
phase `install' succeeded after 21.6 seconds
starting phase `remove-extra-references'
Backtrace:
          14 (primitive-load "/gnu/store/p51mz7mawiixjly3579bfyfv4hx…")
In ice-9/eval.scm:
   191:35 13 (_ _)
In ice-9/boot-9.scm:
    829:9 12 (catch _ _ #<procedure 7ffff3bba518 at /gnu/store/w3jl…> …)
In srfi/srfi-1.scm:
   863:16 11 (every1 #<procedure 7ffff2d50cc0 at /gnu/store/w3jlc8p…> …)
In /gnu/store/w3jlc8pk8416m7h677r5vq92b66h8cqd-module-import/guix/build/gnu-build-system.scm:
   839:30 10 (_ _)
In ice-9/eval.scm:
    619:8  9 (_ #(#(#(#(#(#(#<directory (guile-user)…>) …) …) …) …) …))
In ice-9/boot-9.scm:
    841:4  8 (with-throw-handler _ _ _)
In ice-9/ports.scm:
   445:17  7 (call-with-input-file _ _ #:binary _ #:encoding _ # _)
In /gnu/store/w3jlc8pk8416m7h677r5vq92b66h8cqd-module-import/guix/build/utils.scm:
   739:26  6 (_ _)
   765:26  5 (_ #<input: /gnu/store/kbsn60lnf6vyim3b511qvnadlldmjv1…> …)
In srfi/srfi-1.scm:
   466:18  4 (fold #<procedure 7ffff3b98790 at /gnu/store/w3jlc8pk8…> …)
In ice-9/eval.scm:
   202:51  3 (_ #(#(#(#(#(#(#<directory (guile-user)…> …)) …) …) …) …))
    163:9  2 (_ #(#(#(#(#(#(#<directory (guile-user)…> …)) …) …) …) …))
In unknown file:
           1 (string-append "incpth='" #f "/include'\n")
In ice-9/boot-9.scm:
   752:25  0 (dispatch-exception _ _ _)

ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
In procedure string-append: Wrong type (expecting string): #f
builder for `/gnu/store/50wrwqkvryprlghiqnx3aq8w7ss8mak6-perl-5.30.0.drv' failed with exit code 1
build of /gnu/store/50wrwqkvryprlghiqnx3aq8w7ss8mak6-perl-5.30.0.drv failed
View build log at '/var/log/guix/drvs/50/wrwqkvryprlghiqnx3aq8w7ss8mak6-perl-5.30.0.drv.bz2'.
guix build: error: build of `/gnu/store/50wrwqkvryprlghiqnx3aq8w7ss8mak6-perl-5.30.0.drv' failed
```

But, I think perl has been fixed on core-updates, so we should be good
for this!

Thanks,
Pierre

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

* bug#40556: [PATCH] gnu: dovecot: Add libunwind input.
  2020-04-16 17:41         ` Pierre Langlois
@ 2020-04-17  8:20           ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2020-04-17  8:20 UTC (permalink / raw)
  To: Pierre Langlois; +Cc: Tobias Geerinckx-Rice, 40556-done

Hi Pierre,

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

> Right, it seems dovecot isn't yet cross-compilable, but cross-compiling
> libunwind works just fine. With dovecot I get a failure trying to
> compile perl natively, as openssl's native-input I believe.

Not your fault, and it’s fixed on core-updates as you write.

I’ve applied the patch, thank you!

Ludo’.

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

end of thread, other threads:[~2020-04-17  8:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-11 15:42 [bug#40556] [PATCH] gnu: dovecot: Add libunwind input Pierre Langlois
2020-04-11 16:17 ` Tobias Geerinckx-Rice via Guix-patches via
2020-04-11 16:53   ` Pierre Langlois
2020-04-11 17:56     ` Julien Lepiller
2020-04-16 16:24     ` Ludovic Courtès
2020-04-16 17:13       ` Pierre Langlois
2020-04-16 17:41         ` Pierre Langlois
2020-04-17  8:20           ` bug#40556: " Ludovic Courtès

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