Subject: [PATCH 0/4] Transparent emulation with QEMU and binfmt_misc

From: Ludovic Courtès <[email-masked]>
Date: Tue, 9 Jan 2018 17:14:23 +0100

Hello!

I’ve finally implemented what we had discussed earlier: binfmt_misc
handlers that invoke QEMU to run code built for “foreign” architectures,
and an extension to the guix-daemon service that automatically adds
--chroot-directory flags for QEMU and all of its dependencies (as
returned by “guix gc -R $(guix build qemu)”.)  Pretty nice!

That adds a lot of stuff to the chroot, 87 store items currently.  I
believe it does not harm reproducibility though: these are unguessable
file names so it’s unlikely that a build process will use one of these
87 store items without having declared it as an input.  It’s still best
to avoid using it on our build farm though, to be sure.

Another issue is the extent to which QEMU faithfully emulates CPUs in
practice.  I have no idea, though I suspect Spectre attacks don’t work
in QEMU.  :-)  I think we’ll have to play with this and use ‘guix
challenge’ to see whether we get the same output as bare metal builds.

Note: for the real patch set, I’ll introduce a ‘guix’ package update in
the middle, without which we don’t get the ENOEXEC change in
‘guix-daemon’.

Feedback welcome!

Ludo’.

Ludovic Courtès (4):
  services: Add qemu-binfmt.
  services: guix: Add 'chroot-directories' field.
  services: qemu-binfmt: Extend guix-daemon with extra chroot
    directories.
  daemon: Always try to execute the builder regardless of the platform.

 doc/guix.texi                   |  88 +++++++++++++-
 gnu/services/base.scm           |  64 ++++++++--
 gnu/services/virtualization.scm | 261 +++++++++++++++++++++++++++++++++++++++-
 nix/libstore/build.cc           |  23 ++--
 4 files changed, 414 insertions(+), 22 deletions(-)

-- 
2.15.1