From debbugs-submit-bounces@debbugs.gnu.org Sun May 17 06:01:19 2020 Received: (at submit) by debbugs.gnu.org; 17 May 2020 10:01:19 +0000 Received: from localhost ([127.0.0.1]:42318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaG6g-0000KA-VB for submit@debbugs.gnu.org; Sun, 17 May 2020 06:01:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:42068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaG6g-0000K3-AY for submit@debbugs.gnu.org; Sun, 17 May 2020 06:01:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaG6g-0003xZ-20 for guix-patches@gnu.org; Sun, 17 May 2020 06:01:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56738) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaG6f-0003K5-NW; Sun, 17 May 2020 06:01:17 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=59138 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jaG6a-0002Wj-6I; Sun, 17 May 2020 06:01:13 -0400 From: Jan Nieuwenhuizen To: guix-patches@gnu.org Subject: [PATCH 0/3] Use native qemu to build vm-image. Organization: AvatarAcademy.nl X-Url: http://AvatarAcademy.nl Date: Sun, 17 May 2020 12:01:10 +0200 Message-ID: <87mu66q3rt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 (g= nu 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=3Di586-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(-) --=20 2.26.0 --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com