GNU bug report logs - #47908
Cross building disk image for ARM Asus C201 fails

Previous Next

Package: guix;

Reported by: Martin <smartin <at> disroot.org>

Date: Tue, 20 Apr 2021 11:38:01 UTC

Severity: normal

To reply to this bug, email your comments to 47908 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#47908; Package guix. (Tue, 20 Apr 2021 11:38:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Martin <smartin <at> disroot.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Tue, 20 Apr 2021 11:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Martin <smartin <at> disroot.org>
To: bug-guix <at> gnu.org
Subject: Cross building disk image for ARM Asus C201 fails
Date: Tue, 20 Apr 2021 11:37:49 +0000
Hello,
I'm trying to create a disk image for an Asus C201 chromebook using the 
command 'guix system image test.scm' where test.scm based on 
https://github.com/guix-mirror/guix/blob/master/gnu/system/examples/asus-c201.tmpl 
but unfortunately this operation fails on my x86 dev machine (guix 53ed3e4):

---
 yaml-0.2.5.tar.gz  595KiB                                  4.0MiB/s 
00:00 [##################] 100.0%
 zstd-1.4.4.tar.xz  1.3MiB                                  2.9MiB/s 
00:00 [##################] 100.0%
building /gnu/store/ifnczywhsw1x5wijrv60myv309g7vqg0-libyaml-0.2.5.drv...
building 
/gnu/store/fi24bh8iqrwqby2224n602vd0x2gvz81-python-minimal-3.8.2.drv...
building 
/gnu/store/z2diqxmpr8zkiyk2d5vma4flwvd3bzk6-vboot-utils-R63-10032.B.drv...
- 'patch-hard-coded-paths' phasebuilder for 
`/gnu/store/z2diqxmpr8zkiyk2d5vma4flwvd3bzk6-vboot-utils-R63-10032.B.drv' 
failed with exit code 1
build of 
/gnu/store/z2diqxmpr8zkiyk2d5vma4flwvd3bzk6-vboot-utils-R63-10032.B.drv 
failed
View build log at 
'/var/log/guix/drvs/z2/diqxmpr8zkiyk2d5vma4flwvd3bzk6-vboot-utils-R63-10032.B.drv.bz2'.
guix system: error: build of 
`/gnu/store/z2diqxmpr8zkiyk2d5vma4flwvd3bzk6-vboot-utils-R63-10032.B.drv' 
failed
---

the logs:
---
vboot-utils-R63-10032.B-checkout/vboot_host.pc.in
phase `unpack' succeeded after 1.1 seconds
starting phase `patch-hard-coded-paths'
Backtrace:
          16 (primitive-load "/gnu/store/3px9vwr51v82zhh7bzi8wcmiaw3…")
In ice-9/eval.scm:
   191:35 15 (_ #f)
In guix/build/gnu-build-system.scm:
    838:2 14 (gnu-build #:source _ #:outputs _ #:inputs _ #:phases . #)
In ice-9/boot-9.scm:
  1736:10 13 (with-exception-handler _ _ #:unwind? _ # _)
In srfi/srfi-1.scm:
   857:16 12 (every1 #<procedure 7ffff5f6d120 at guix/build/gnu-bui…> …)
In guix/build/gnu-build-system.scm:
   847:30 11 (_ _)
In ice-9/eval.scm:
    619:8 10 (_ #(#(#(#<directory (guile-user) 7ffff6bb9f00>) # #) …))
In ice-9/boot-9.scm:
  1736:10  9 (with-exception-handler _ _ #:unwind? _ # _)
In ice-9/ports.scm:
   445:17  8 (call-with-input-file _ _ #:binary _ #:encoding _ # _)
In guix/build/utils.scm:
   741:26  7 (_ _)
   767:26  6 (_ #<input: tests/bitmaps/TestBmpBlock.py 15> #<input-o…>)
In srfi/srfi-1.scm:
   460:18  5 (fold #<procedure 7ffff6a7c040 at guix/build/utils.scm…> …)
In ice-9/eval.scm:
   202:51  4 (_ #(#(#(#(#(#(#<directory (guile-user)…> …)) …) …) …) …))
    163:9  3 (_ #(#(#(#(#(#(#<directory (guile-user)…> …)) …) …) …) …))
In unknown file:
           2 (string-append #f "/bin/cmp")
In ice-9/boot-9.scm:
  1669:16  1 (raise-exception _ #:continuable? _)
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
In procedure string-append: Wrong type (expecting string): #f
---

Any ideas how to fix it or do you know some alternative approaches how 
to install GuixSD on Asus C201?

Thanks,
Martin




Information forwarded to bug-guix <at> gnu.org:
bug#47908; Package guix. (Tue, 20 Apr 2021 19:24:02 GMT) Full text and rfc822 format available.

Message #8 received at 47908 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Martin <smartin <at> disroot.org>, 47908 <at> debbugs.gnu.org
Subject: Re: bug#47908: Cross building disk image for ARM Asus C201 fails
Date: Tue, 20 Apr 2021 21:23:17 +0200
[Message part 1 (text/plain, inline)]
Martin via Bug reports for GNU Guix schreef op di 20-04-2021 om 11:37 [+0000]:
> Hello,
> I'm trying to create a disk image for an Asus C201 chromebook using the 
> command 'guix system image test.scm' where test.scm based on 
> https://github.com/guix-mirror/guix/blob/master/gnu/system/examples/asus-c201.tmpl 
> but unfortunately this operation fails on my x86 dev machine (guix 53ed3e4):
> 
> ---
> [...]
> View build log at 
> '/var/log/guix/drvs/z2/diqxmpr8zkiyk2d5vma4flwvd3bzk6-vboot-utils-R63-10032.B.drv.bz2'.
> guix system: error: build of 
> `/gnu/store/z2diqxmpr8zkiyk2d5vma4flwvd3bzk6-vboot-utils-R63-10032.B.drv' 
> failed
> ---
> 
> the logs:
> [...]
> In unknown file:
>             2 (string-append #f "/bin/cmp")
> In ice-9/boot-9.scm:
>    1669:16  1 (raise-exception _ #:continuable? _)
>    1669:16  0 (raise-exception _ #:continuable? _)
> 
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> In procedure string-append: Wrong type (expecting string): #f
> ---

> Any ideas how to fix it

Some issues I see in the definition of the "vboot-utils" package:

    (arguments
     `(#:make-flags (list "CC=gcc"
                          ;; On ARM, we must pass "HOST_ARCH=arm" so that the

The "CC=gcc" should be ,(string-append "CC=" (cc-for-target)), such that the
cross-compiler is used.  (cc-for-target) also works when not cross-compiling.

                    (lambda* (#:key inputs outputs #:allow-other-keys)
                      (let ((coreutils (assoc-ref inputs "coreutils"))
                            (diffutils (assoc-ref inputs "diffutils")))
                    [...]
                        (substitute* "tests/bitmaps/TestBmpBlock.py"
                          (("/usr/bin/cmp") (string-append diffutils "/bin/cmp")))

"diffutils" should be looked up in 'native-inputs', not 'inputs', as "cmp" is run
when building the package.  (And not when this package is actually used at run-time).

So that should be

                    (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
                      (let ((coreutils (assoc-ref inputs "coreutils"))
                            (diffutils (assoc-
ref (or native-inputs inputs) "diffutils")))
                    [...]
                        (substitute* "tests/bitmaps/TestBmpBlock.py"
                          (("/usr/bin/cmp") (string-append
diffutils "/bin/cmp")))

p.s.  I began replacing "CC=gcc" with ,(string-append "CC=" (cc-for-target)) where it seemed
necessary in the patch series at <https://issues.guix.gnu.org/47693>

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#47908; Package guix. (Fri, 05 Nov 2021 09:25:02 GMT) Full text and rfc822 format available.

Message #11 received at 47908 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: "47908 <at> debbugs.gnu.org" <47908 <at> debbugs.gnu.org>
Subject: Re: Cross building disk image for ARM Asus C201 fails
Date: Fri, 05 Nov 2021 09:24:11 +0000
[Message part 1 (text/plain, inline)]
Hi Martin & Maxime,

I've tested if the system image builds after merging patches for the
vboot-utils package.

$ guix system build -s armhf-linux test.scm

Unfortunately I don't own the ARM Asus C201 Chromebook so I can't test the live system.

Could you Martin test please? I used commit 7af3b822178782d6598865e1d6a780a756dd0cb3.

Petr
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#47908; Package guix. (Fri, 05 Nov 2021 10:00:02 GMT) Full text and rfc822 format available.

Message #14 received at 47908 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: phodina <phodina <at> protonmail.com>, "47908 <at> debbugs.gnu.org"
 <47908 <at> debbugs.gnu.org>
Subject: Re: bug#47908: Cross building disk image for ARM Asus C201 fails
Date: Fri, 05 Nov 2021 10:59:14 +0100
phodina via Bug reports for GNU Guix schreef op vr 05-11-2021 om 09:24
[+0000]:
> Hi Martin & Maxime,
> 
> I've tested if the system image builds after merging patches for the
> vboot-utils package.
> 
> $ guix system build -s armhf-linux test.scm

That's an emulated build (with QEMU), not a cross-build.
To cross-build, something like

$ guix system build --target=arm-linux-gnueabihf test.scm

is necessary. Emulated builds function rather differently
from cross-builds (the former mostly looks like native compilation to
guix), so the former command isn't a good test.

Greetings,
Maxime


-- 
not hacking on guix for a while, only occassionally looking at IRC logs
and bug reports.  E-mails are unsigned until backup is located.






Information forwarded to bug-guix <at> gnu.org:
bug#47908; Package guix. (Fri, 05 Nov 2021 18:18:01 GMT) Full text and rfc822 format available.

Message #17 received at 47908 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: "47908 <at> debbugs.gnu.org" <47908 <at> debbugs.gnu.org>
Subject: Re: bug#47908: Cross building disk image for ARM Asus C201 fails
Date: Fri, 05 Nov 2021 18:17:23 +0000
Hi Maxime,

On Friday, November 5th, 2021 at 10:59 AM, Maxime Devos <maximedevos <at> telenet.be> wrote:

> phodina via Bug reports for GNU Guix schreef op vr 05-11-2021 om 09:24
>
> [+0000]:
>
> > Hi Martin & Maxime,
> >
> > I've tested if the system image builds after merging patches for the
> >
> > vboot-utils package.
> >
> > $ guix system build -s armhf-linux test.scm
>
> That's an emulated build (with QEMU), not a cross-build.
>
> To cross-build, something like
>
> $ guix system build --target=arm-linux-gnueabihf test.scm
>
> is necessary. Emulated builds function rather differently
>
> from cross-builds (the former mostly looks like native compilation to
>
> guix), so the former command isn't a good test.
>
> Greetings,
>
> Maxime
>

Thanks for highlighting the fact. I've intended to run the cross-compilation as you said not run "native" build in QEMU.

The command in full:

[env]$ ./pre-inst-env guix system build --target=arm-linux-gnueabihf gnu/system/examples/asus-c201.tmpl

Then again the build is successful but without the hardware I can't verify it boots successfully.

Petr




This bug report was last modified 3 years and 25 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.