Cross building disk image for ARM Asus C201 fails

  • Open
  • quality assurance status badge
Details
3 participants
  • Maxime Devos
  • phodina
  • Martin
Owner
unassigned
Submitted by
Martin
Severity
normal
M
M
Martin wrote on 20 Apr 2021 13:37
(address . bug-guix@gnu.org)
96121f63-a710-0364-0408-b61907f8e5f5@disroot.org
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
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
M
M
Maxime Devos wrote on 20 Apr 2021 21:23
5b3bf4b60ea3f5e4522981a0111d8743b8602e34.camel@telenet.be
Martin via Bug reports for GNU Guix schreef op di 20-04-2021 om 11:37 [+0000]:
Toggle quote (29 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYH8qJhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ugxAP9E8H5qSbN+yUBa/fplw0QlJzYB
EyVge8VkdeeztH12kAEAlUMM322SS9nusAPbgqgmtL5muzJXii8QMtqbKxXwMgg=
=KuQ7
-----END PGP SIGNATURE-----


P
P
phodina wrote on 5 Nov 2021 10:24
Re: Cross building disk image for ARM Asus C201 fails
(name . 47908@debbugs.gnu.org)(address . 47908@debbugs.gnu.org)
RmLwuWzKAHGnwhHkjR801JTERhi18lgIW6gIM7k8mqlz5LXUYyZ6qw5KuaTkY96UUBZ_Ou6HfdpscfT9A77_vBYlhMqdheTeBIMCHfngH1Q=@protonmail.com
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
Attachment: file
M
M
Maxime Devos wrote on 5 Nov 2021 10:59
Re: bug#47908: Cross building disk image for ARM Asus C201 fails
2fad6ddd72d0d63ef42846ee21b9408958377e6a.camel@telenet.be
phodina via Bug reports for GNU Guix schreef op vr 05-11-2021 om 09:24
[+0000]:
Toggle quote (7 lines)
> 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.
P
P
phodina wrote on 5 Nov 2021 19:17
(name . Maxime Devos)(address . maximedevos@telenet.be)(name . 47908@debbugs.gnu.org)(address . 47908@debbugs.gnu.org)
aSyhVqgcKC33_AkB1m9N_TFdROi1SaBil_XX4_Qr-0Pq1oYmr-f0_1DhRB4f3ea3wv7UCdyPbbTnBJ9UUPydwBQFkBGam-mFZWntVkFNLKc=@protonmail.com
Hi Maxime,

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

Toggle quote (29 lines)
> 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
?