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
Toggle snippet (5 lines)
(system* #+(file-append (default-guile) "/bin/guile")
while the packages in USER-BUILDER will still be cross-built. However,
because the builder has
(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.
./pre-inst-env guix system vm-image --target=i586-pc-gnu --no-grafts \
now produces a pretty nice hurd VM :-)
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(-)
Jan Nieuwenhuizen <firstname.lastname@example.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com