--- Begin Message ---
Subject: |
[PATCH 0/3] Use native qemu to build vm-image. |
Date: |
Sun, 17 May 2020 12:01:10 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hi!
Cross-building a vm-image used to be done using a cross-qemu, e.g, qemu-ARM.
That does not work for the Hurd, as there is no qemu-HURD.
This patch switches to cross building vm-images using a native qemu vm. If
there a reason for using qemu-TARGET we may want to make this switch
conditional for cross building to the Hurd?
There is a tricky aspect to this: the "user-builder" includes all the
cross-built packages for TARGET, but we need to hard the native qemu a
native #+LOADER, loading native #+LINUX and #+INITRD.
To accomplish this NATIVE/CROSS mixt, the builder is then run with a native
guile, like so
--8<---------------cut here---------------start------------->8---
(system* #+(file-append (default-guile) "/bin/guile")
"--no-auto-compile"
#$(preserve-target user-builder))
--8<---------------cut here---------------end--------------->8---
while the packages in USER-BUILDER will still be cross-built. However,
because the builder has
(with-extensions gcrypt-sqlite3&co
(use-modules (gnu store database))
...)
this makes the native guile "see" the cross-built .GO files. That would
"only" be a secondary problem except that loading (sqlite3) throws an
exception when dynamic-loading the .SO fails. Seeing it like this I am not so
sure anymore this is a bug, WDYT? ...so instead
...the problem is now avoided by removing the sqlite dependency when
cross-building by not registering closures and postponing the loading of (gnu
store database) and thus (sqlite3).
I have reset wip-hurd-vm onto these changes, so you can also look there.
Doing
./pre-inst-env guix system vm-image --target=i586-pc-gnu --no-grafts \
gnu/system/examples/bare-hurd.tmpl
now produces a pretty nice hurd VM :-)
Greetings,
Janneke
Jan (janneke) Nieuwenhuizen (3):
utils: Move 'reset-timestamps' out of database.
system: vm: Do not register-closures when cross-building.
system: vm: Build vm-image using native qemu.
gnu/bootloader/grub.scm | 4 +--
gnu/build/vm.scm | 3 ++-
gnu/system/vm.scm | 54 ++++++++++++++++++++++++++---------------
guix/store/database.scm | 41 +++----------------------------
guix/utils.scm | 41 ++++++++++++++++++++++++++++---
5 files changed, 79 insertions(+), 64 deletions(-)
--
2.26.0
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#41350: [PATCH 0/3] Use native qemu to build vm-image. |
Date: |
Thu, 29 Sep 2022 16:17:12 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) |
Hey Maxim,
Building 'vm-image' does not involve QEMU anymore so we can close this
one.
Thanks,
Mathieu
--- End Message ---