diff mbox series

[bug#40556] gnu: dovecot: Add libunwind input.

Message ID 87y2qvs6ar.fsf@gmx.com
State Accepted
Headers show
Series [bug#40556] gnu: dovecot: Add libunwind input. | 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 April 16, 2020, 5:13 p.m. UTC
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

Comments

Pierre Langlois April 16, 2020, 5:41 p.m. UTC | #1
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
Ludovic Courtès April 17, 2020, 8:20 a.m. UTC | #2
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’.
diff mbox series

Patch

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