From unknown Sat Aug 16 15:55:13 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#20239 <20239@debbugs.gnu.org> To: bug#20239 <20239@debbugs.gnu.org> Subject: Status: [wishlist] Add build hook to build for other platforms using qemu Reply-To: bug#20239 <20239@debbugs.gnu.org> Date: Sat, 16 Aug 2025 22:55:13 +0000 retitle 20239 [wishlist] Add build hook to build for other platforms using = qemu reassign 20239 guix submitter 20239 Mark H Weaver severity 20239 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 31 17:36:53 2015 Received: (at submit) by debbugs.gnu.org; 31 Mar 2015 21:36:54 +0000 Received: from localhost ([127.0.0.1]:41510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yd3q9-0000E9-GG for submit@debbugs.gnu.org; Tue, 31 Mar 2015 17:36:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33071) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yd3q7-0000Dv-4P for submit@debbugs.gnu.org; Tue, 31 Mar 2015 17:36:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yd3q1-0001tW-BV for submit@debbugs.gnu.org; Tue, 31 Mar 2015 17:36:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yd3q1-0001tR-8l for submit@debbugs.gnu.org; Tue, 31 Mar 2015 17:36:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yd3q0-0003ql-Iv for bug-guix@gnu.org; Tue, 31 Mar 2015 17:36:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yd3px-0001st-FO for bug-guix@gnu.org; Tue, 31 Mar 2015 17:36:44 -0400 Received: from world.peace.net ([50.252.239.5]:37577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yd3px-0001sl-Bs for bug-guix@gnu.org; Tue, 31 Mar 2015 17:36:41 -0400 Received: from [10.1.10.78] (helo=jojen) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Yd3pq-0003uz-9F; Tue, 31 Mar 2015 17:36:34 -0400 From: Mark H Weaver To: bug-guix@gnu.org Subject: [wishlist] Add build hook to build for other platforms using qemu Date: Tue, 31 Mar 2015 17:37:07 -0400 Message-ID: <87619gdf24.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) It would be great if we had a build hook to enable guix-daemon to natively build packages for any system supported by qemu, by running the build processes within qemu. Mark From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 11 13:36:50 2015 Received: (at 20239) by debbugs.gnu.org; 11 Sep 2015 17:36:50 +0000 Received: from localhost ([127.0.0.1]:57278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZaSFm-00009d-Cy for submit@debbugs.gnu.org; Fri, 11 Sep 2015 13:36:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47372) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZaSFk-00009W-Js for 20239@debbugs.gnu.org; Fri, 11 Sep 2015 13:36:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaSFf-0002KJ-EP for 20239@debbugs.gnu.org; Fri, 11 Sep 2015 13:36:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaSFf-0002KE-A1 for 20239@debbugs.gnu.org; Fri, 11 Sep 2015 13:36:43 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:50716 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ZaSFe-0006ye-Qe for 20239@debbugs.gnu.org; Fri, 11 Sep 2015 13:36:43 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: 20239@debbugs.gnu.org Subject: Re: bug#20239: [wishlist] Add build hook to build for other platforms using qemu References: <87619gdf24.fsf@netris.org> Date: Fri, 11 Sep 2015 19:36:41 +0200 In-Reply-To: <87619gdf24.fsf@netris.org> (Mark H. Weaver's message of "Tue, 31 Mar 2015 17:37:07 -0400") Message-ID: <87zj0samdy.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 20239 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) Mark H Weaver skribis: > It would be great if we had a build hook to enable guix-daemon to > natively build packages for any system supported by qemu, by running the > build processes within qemu. The interested hacker can look at (guix scripts offload) for an example of such a build hook. Build hooks are started by the daemon; they receive build requests on stdin, which they can accept, reject, or postpone. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 23 19:17:07 2017 Received: (at 20239) by debbugs.gnu.org; 23 Mar 2017 23:17:07 +0000 Received: from localhost ([127.0.0.1]:41509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crByc-0004ut-Vv for submit@debbugs.gnu.org; Thu, 23 Mar 2017 19:17:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36857) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crByc-0004uL-EG for 20239@debbugs.gnu.org; Thu, 23 Mar 2017 19:17:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1crByU-0003Eu-2x for 20239@debbugs.gnu.org; Thu, 23 Mar 2017 19:17:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crByT-0003Eq-VN; Thu, 23 Mar 2017 19:16:57 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:45168 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1crByT-0001gk-At; Thu, 23 Mar 2017 19:16:57 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Mark H Weaver Subject: Re: bug#20239: [wishlist] Add build hook to build for other platforms using qemu References: <87619gdf24.fsf@netris.org> Date: Fri, 24 Mar 2017 00:16:54 +0100 In-Reply-To: <87619gdf24.fsf@netris.org> (Mark H. Weaver's message of "Tue, 31 Mar 2015 17:37:07 -0400") Message-ID: <87y3vvziqh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 20239 Cc: 20239@debbugs.gnu.org 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: -5.0 (-----) Mark H Weaver skribis: > It would be great if we had a build hook to enable guix-daemon to > natively build packages for any system supported by qemu, by running the > build processes within qemu. QEMU has a =E2=80=98qemu-binfmt-conf.sh=E2=80=99 script that installs binfm= t_misc handlers for all the architecture-specific ELF variants. Once you=E2=80=99= ve run this script, you can transparently run, say, ARM executables (the kernel takes care of invoking =E2=80=98qemu-arm=E2=80=99 for you). Without this, =E2=80=98qemu-arm=E2=80=99 & co. do not follow =E2=80=98execv= e=E2=80=99 syscalls, so binfmt_misc is probably the only way to achieve what we want. It actually works. For instance, here I=E2=80=99m mimicking on my x86_64 machine what a .drv file for ARM describes: env -i TMPDIR=3D/tmp out=3D$PWD debug=3D$PWD "/gnu/store/mrq1big4g3icywwg= 8f6jd2cahq79wc6h-guile-2.0.14/bin/guile" --no-auto-compile -L "/gnu/store/k= k5w5almhpx7g696vb9si8ham2r0z88l-module-import" -C "/gnu/store/80cdsxvx97c89= slkajrkrdd9hw9p3smb-module-import-compiled" "/gnu/store/9667pad1s8ympbr8z0y= r65qj061gzr19-coreutils-8.26-guile-builder" (Here I=E2=80=99m using the ARM Guile, but for a slight speedup I could act= ually use the native Guile.) Then we just need to tell the daemon to not complain (=E2=80=9Cbut I=E2=80= =99m an 'x86_64-linux'=E2=80=9D). Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 28 12:04:39 2017 Received: (at 20239) by debbugs.gnu.org; 28 Mar 2017 16:04:40 +0000 Received: from localhost ([127.0.0.1]:49558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cstbr-0005uv-Jd for submit@debbugs.gnu.org; Tue, 28 Mar 2017 12:04:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:32870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cstbp-0005ui-SD for 20239@debbugs.gnu.org; Tue, 28 Mar 2017 12:04:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cstbg-0005Lg-GT for 20239@debbugs.gnu.org; Tue, 28 Mar 2017 12:04:32 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cstbg-0005Lc-CS; Tue, 28 Mar 2017 12:04:28 -0400 Received: from [193.50.110.98] (port=54844 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cstbf-0000nv-MI; Tue, 28 Mar 2017 12:04:28 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Mark H Weaver Subject: Re: bug#20239: [wishlist] Add build hook to build for other platforms using qemu References: <87619gdf24.fsf@netris.org> <87y3vvziqh.fsf@gnu.org> Date: Tue, 28 Mar 2017 18:04:25 +0200 In-Reply-To: <87y3vvziqh.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 24 Mar 2017 00:16:54 +0100") Message-ID: <87tw6d1j7a.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 20239 Cc: 20239@debbugs.gnu.org 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: -5.0 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > Mark H Weaver skribis: > >> It would be great if we had a build hook to enable guix-daemon to >> natively build packages for any system supported by qemu, by running the >> build processes within qemu. > > QEMU has a =E2=80=98qemu-binfmt-conf.sh=E2=80=99 script that installs bin= fmt_misc > handlers for all the architecture-specific ELF variants. Once you=E2=80= =99ve > run this script, you can transparently run, say, ARM executables (the > kernel takes care of invoking =E2=80=98qemu-arm=E2=80=99 for you). [...] > Then we just need to tell the daemon to not complain (=E2=80=9Cbut I=E2= =80=99m an > 'x86_64-linux'=E2=80=9D). The attached patch does that. However, there=E2=80=99s an added complication: the file name of the qemu-* executables registered in binfmt_misc are apparently resolved relative to the root directory of the process that does =E2=80=98execve=E2=80=99. So we would need to add a guix-daemon --chroot-directory=3DDIR argument for each element in the closure of QEMU. Not great. Thoughts? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index 9b7bb5391..bca75a4f9 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -1672,15 +1672,6 @@ void DerivationGoal::startBuilder() f.exceptions(boost::io::all_error_bits ^ boost::io::too_many_args_bit); startNest(nest, lvlInfo, f % showPaths(missingPaths) % curRound % nrRounds); - /* Right platform? */ - if (!canBuildLocally(drv.platform)) { - if (settings.printBuildTrace) - printMsg(lvlError, format("@ unsupported-platform %1% %2%") % drvPath % drv.platform); - throw Error( - format("a `%1%' is required to build `%3%', but I am a `%2%'") - % drv.platform % settings.thisSystem % drvPath); - } - /* Note: built-in builders are *not* running in a chroot environment so that we can easily implement them in Guile without having it as a derivation input (they are running under a separate build user, @@ -2305,6 +2296,18 @@ void DerivationGoal::runChild() execve(drv.builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data()); + int error = errno; + + /* Right platform? */ + if (error == ENOEXEC && !canBuildLocally(drv.platform)) { + if (settings.printBuildTrace) + printMsg(lvlError, format("@ unsupported-platform %1% %2%") % drvPath % drv.platform); + throw Error( + format("a `%1%' is required to build `%3%', but I am a `%2%'") + % drv.platform % settings.thisSystem % drvPath); + } + + errno = error; throw SysError(format("executing `%1%'") % drv.builder); } catch (std::exception & e) { --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 11:14:52 2018 Received: (at 20239) by debbugs.gnu.org; 9 Jan 2018 16:14:52 +0000 Received: from localhost ([127.0.0.1]:43333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYwY8-0000Z0-7d for submit@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYwY6-0000YO-Eu for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYwY0-0006gc-4p for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYwXv-0006aj-2b; Tue, 09 Jan 2018 11:14:39 -0500 Received: from [193.50.110.243] (port=49566 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eYwXu-0000x3-N6; Tue, 09 Jan 2018 11:14:38 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 20239@debbugs.gnu.org Subject: [PATCH 0/4] Transparent emulation with QEMU and binfmt_misc Date: Tue, 9 Jan 2018 17:14:23 +0100 Message-Id: <20180109161427.28836-1-ludo@gnu.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <87tw6d1j7a.fsf@gnu.org> References: <87tw6d1j7a.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 20239 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -5.0 (-----) 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 11:14:52 2018 Received: (at 20239) by debbugs.gnu.org; 9 Jan 2018 16:14:53 +0000 Received: from localhost ([127.0.0.1]:43335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYwY8-0000Z3-I4 for submit@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYwY6-0000YP-Ev for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYwY0-0006gj-6w for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYwXx-0006eI-KT; Tue, 09 Jan 2018 11:14:41 -0500 Received: from [193.50.110.243] (port=49566 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eYwXx-0000x3-9A; Tue, 09 Jan 2018 11:14:41 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 20239@debbugs.gnu.org Subject: [PATCH 3/4] services: qemu-binfmt: Extend guix-daemon with extra chroot directories. Date: Tue, 9 Jan 2018 17:14:26 +0100 Message-Id: <20180109161427.28836-4-ludo@gnu.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180109161427.28836-1-ludo@gnu.org> References: <87tw6d1j7a.fsf@gnu.org> <20180109161427.28836-1-ludo@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 20239 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -5.0 (-----) Fixes . * gnu/services/virtualization.scm ()[guix-support?]: New field. (qemu-binfmt-guix-chroot): New procedure. (qemu-binfmt-service-type)[extensions]: Add GUIX-SERVICE-TYPE. * doc/guix.texi (Virtualization Services): Document 'guix-support?'. --- doc/guix.texi | 29 +++++++++++++++++++++++++++++ gnu/services/virtualization.scm | 16 ++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 5c836ae96..85d95c4da 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17698,6 +17698,35 @@ This is the configuration for the @code{qemu-binfmt} service. The list of emulated QEMU platforms. Each item must be a @dfn{platform object} as returned by @code{lookup-qemu-platforms} (see below). +@item @code{guix-support?} (default: @code{#f}) +When it is true, QEMU and all its dependencies are added to the build +environment of @command{guix-daemon} (@pxref{Invoking guix-daemon, +@code{--chroot-directory} option}). This allows the @code{binfmt_misc} +handlers to be used within the build environment, which in turn means +that you can transparently build programs for another architecture. + +For example, let's suppose you're on an x86_64 machine and you have this +service: + +@example +(service qemu-binfmt-service-type + (qemu-binfmt-configuration + (platforms (lookup-qemu-platforms "arm")) + (qemu-support? #t))) +@end example + +You can run: + +@example +guix build -s armhf-linux inkscape +@end example + +@noindent +and it will build Inkscape for ARMv7 @emph{as if it were a native +build}, transparently using QEMU to emulate the ARMv7 CPU. Pretty handy +if you'd like to test a package build for an architecture you don't have +access to! + @item @code{qemu} (default: @code{qemu}) The QEMU package to use. @end table diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index ac6afe043..f716de622 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -662,7 +662,9 @@ potential infinite waits blocking libvirt.")) (qemu qemu-binfmt-configuration-qemu (default qemu)) (platforms qemu-binfmt-configuration-platforms - (default '()))) ;safest default + (default '())) ;safest default + (guix-support? qemu-binfmt-configuration-guix-support? + (default #f))) (define (qemu-platform->binfmt qemu platform) "Return a gexp that evaluates to a binfmt string for PLATFORM, using the @@ -724,6 +726,14 @@ given QEMU package." '#$(map qemu-platform-name platforms)) #f))))))) +(define qemu-binfmt-guix-chroot + (match-lambda + ;; Add QEMU and its dependencies to the guix-daemon chroot so that our + ;; binfmt_misc handlers work in the chroot (otherwise 'execve' would fail + ;; with ENOENT.) + (($ qemu platforms guix?) + (if guix? (list qemu) '())))) + (define qemu-binfmt-service-type ;; TODO: Make a separate binfmt_misc service out of this? (service-type (name 'qemu-binfmt) @@ -731,7 +741,9 @@ given QEMU package." (list (service-extension file-system-service-type (const (list %binfmt-file-system))) (service-extension shepherd-root-service-type - qemu-binfmt-shepherd-services))) + qemu-binfmt-shepherd-services) + (service-extension guix-service-type + qemu-binfmt-guix-chroot))) (default-value (qemu-binfmt-configuration)) (description "This service supports transparent emulation of binaries -- 2.15.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 11:14:54 2018 Received: (at 20239) by debbugs.gnu.org; 9 Jan 2018 16:14:54 +0000 Received: from localhost ([127.0.0.1]:43337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYwY9-0000ZM-V7 for submit@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36023) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYwY6-0000YQ-FZ for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYwY0-0006gn-6l for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYwXw-0006dN-UI; Tue, 09 Jan 2018 11:14:40 -0500 Received: from [193.50.110.243] (port=49566 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eYwXw-0000x3-Fm; Tue, 09 Jan 2018 11:14:40 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 20239@debbugs.gnu.org Subject: [PATCH 2/4] services: guix: Add 'chroot-directories' field. Date: Tue, 9 Jan 2018 17:14:25 +0100 Message-Id: <20180109161427.28836-3-ludo@gnu.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180109161427.28836-1-ludo@gnu.org> References: <87tw6d1j7a.fsf@gnu.org> <20180109161427.28836-1-ludo@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 20239 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -5.0 (-----) * gnu/services/base.scm ()[chroot-directories]: New field. (guix-shepherd-service): Honor it. (references-file): New procedure. (guix-service-type)[compose, extend]: New fields. --- gnu/services/base.scm | 64 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 11 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 7c20232a6..8e30bcd34 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1434,6 +1434,8 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) (default #t)) (substitute-urls guix-configuration-substitute-urls ;list of strings (default %default-substitute-urls)) + (chroot-directories guix-configuration-chroot-directories ;list of file-like/strings + (default '())) (max-silent-time guix-configuration-max-silent-time ;integer (default 0)) (timeout guix-configuration-timeout ;integer @@ -1457,23 +1459,35 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) (match-record config (guix build-group build-accounts authorize-key? authorized-keys use-substitutes? substitute-urls max-silent-time timeout - log-compression extra-options log-file http-proxy tmpdir) + log-compression extra-options log-file http-proxy tmpdir + chroot-directories) (list (shepherd-service (documentation "Run the Guix daemon.") (provision '(guix-daemon)) (requirement '(user-processes)) + (modules '((srfi srfi-1))) (start #~(make-forkexec-constructor - (list #$(file-append guix "/bin/guix-daemon") - "--build-users-group" #$build-group - "--max-silent-time" #$(number->string max-silent-time) - "--timeout" #$(number->string timeout) - "--log-compression" #$(symbol->string log-compression) - #$@(if use-substitutes? - '() - '("--no-substitutes")) - "--substitute-urls" #$(string-join substitute-urls) - #$@extra-options) + (cons* #$(file-append guix "/bin/guix-daemon") + "--build-users-group" #$build-group + "--max-silent-time" #$(number->string max-silent-time) + "--timeout" #$(number->string timeout) + "--log-compression" #$(symbol->string log-compression) + #$@(if use-substitutes? + '() + '("--no-substitutes")) + "--substitute-urls" #$(string-join substitute-urls) + #$@extra-options + + ;; Add CHROOT-DIRECTORIES and all their dependencies (if + ;; these are store items) to the chroot. + (append-map (lambda (file) + (append-map (lambda (directory) + (list "--chroot-directory" + directory)) + (call-with-input-file file + read))) + '#$(map references-file chroot-directories))) #:environment-variables (list #$@(if http-proxy @@ -1514,6 +1528,24 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) #$@(map (cut hydra-key-authorization <> guix) keys)) #~#f)))) +(define* (references-file item #:optional (name "references")) + "Return a file that contains the list of references of ITEM." + (if (struct? item) ;lowerable object + (computed-file name + (with-imported-modules (source-module-closure + '((guix build store-copy))) + #~(begin + (use-modules (guix build store-copy)) + + (call-with-output-file #$output + (lambda (port) + (write (call-with-input-file "graph" + read-reference-graph) + port))))) + #:options `(#:local-build? #f + #:references-graphs (("graph" ,item)))) + (plain-file name "()"))) + (define guix-service-type (service-type (name 'guix) @@ -1523,6 +1555,16 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) (service-extension activation-service-type guix-activation) (service-extension profile-service-type (compose list guix-configuration-guix)))) + + ;; Extensions can specify extra directories to add to the build chroot. + (compose concatenate) + (extend (lambda (config directories) + (guix-configuration + (inherit config) + (chroot-directories + (append (guix-configuration-chroot-directories config) + directories))))) + (default-value (guix-configuration)) (description "Run the build daemon of GNU@tie{}Guix, aka. @command{guix-daemon}."))) -- 2.15.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 11:14:54 2018 Received: (at 20239) by debbugs.gnu.org; 9 Jan 2018 16:14:54 +0000 Received: from localhost ([127.0.0.1]:43339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYwYA-0000ZO-8F for submit@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36025) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYwY6-0000YR-I1 for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYwY0-0006hI-KV for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYwXy-0006f5-CX; Tue, 09 Jan 2018 11:14:42 -0500 Received: from [193.50.110.243] (port=49566 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eYwXx-0000x3-Ve; Tue, 09 Jan 2018 11:14:42 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 20239@debbugs.gnu.org Subject: [PATCH 4/4] daemon: Always try to execute the builder regardless of the platform. Date: Tue, 9 Jan 2018 17:14:27 +0100 Message-Id: <20180109161427.28836-5-ludo@gnu.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180109161427.28836-1-ludo@gnu.org> References: <87tw6d1j7a.fsf@gnu.org> <20180109161427.28836-1-ludo@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 20239 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -5.0 (-----) * nix/libstore/build.cc (runChild): Move platform check after 'execve' call. Check specifically for ENOEXEC. --- nix/libstore/build.cc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index 275d6a5f7..34647e677 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -1682,15 +1682,6 @@ void DerivationGoal::startBuilder() f.exceptions(boost::io::all_error_bits ^ boost::io::too_many_args_bit); startNest(nest, lvlInfo, f % showPaths(missingPaths) % curRound % nrRounds); - /* Right platform? */ - if (!canBuildLocally(drv.platform)) { - if (settings.printBuildTrace) - printMsg(lvlError, format("@ unsupported-platform %1% %2%") % drvPath % drv.platform); - throw Error( - format("a `%1%' is required to build `%3%', but I am a `%2%'") - % drv.platform % settings.thisSystem % drvPath); - } - /* Note: built-in builders are *not* running in a chroot environment so that we can easily implement them in Guile without having it as a derivation input (they are running under a separate build user, @@ -2311,6 +2302,20 @@ void DerivationGoal::runChild() execve(drv.builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data()); + int error = errno; + + /* Right platform? Check this after we've tried 'execve' to allow for + transparent emulation of different platforms with binfmt_misc + handlers that invoke QEMU. */ + if (error == ENOEXEC && !canBuildLocally(drv.platform)) { + if (settings.printBuildTrace) + printMsg(lvlError, format("@ unsupported-platform %1% %2%") % drvPath % drv.platform); + throw Error( + format("a `%1%' is required to build `%3%', but I am a `%2%'") + % drv.platform % settings.thisSystem % drvPath); + } + + errno = error; throw SysError(format("executing `%1%'") % drv.builder); } catch (std::exception & e) { -- 2.15.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 11:14:55 2018 Received: (at 20239) by debbugs.gnu.org; 9 Jan 2018 16:14:55 +0000 Received: from localhost ([127.0.0.1]:43341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYwYA-0000ZV-Fj for submit@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYwY7-0000YU-Ox for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYwY0-0006gv-AY for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 11:14:46 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYwXw-0006cP-4V; Tue, 09 Jan 2018 11:14:40 -0500 Received: from [193.50.110.243] (port=49566 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eYwXv-0000x3-DE; Tue, 09 Jan 2018 11:14:39 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 20239@debbugs.gnu.org Subject: [PATCH 1/4] services: Add qemu-binfmt. Date: Tue, 9 Jan 2018 17:14:24 +0100 Message-Id: <20180109161427.28836-2-ludo@gnu.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180109161427.28836-1-ludo@gnu.org> References: <87tw6d1j7a.fsf@gnu.org> <20180109161427.28836-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 20239 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -5.0 (-----) * gnu/services/virtualization.scm (): New record type. (bv): New macro. (%i386, %i486, %alpha, %arm, %armeb, %sparc, %sparc32plus) (%ppc, %ppc64, %ppc64le, %m68k, %mips, %mipsel, %mipsn32el) (%mips64, %mips64el, %sh4, %sh4eb, %s390x, %aarch64, %hppa) (%qemu-platforms): New variables. (lookup-qemu-platforms): New procedure. (): New record type. (qemu-platform->binfmt): New procedures. (%binfmt-mount-point, %binfmt-register-file, %binfmt-file-system) (qemu-binfmt-service-type): New variables. (qemu-binfmt-shepherd-services): New procedures. * doc/guix.texi (Virtualization Services): Add "Transparent Emulation with QEMU" heading. --- doc/guix.texi | 59 +++++++++- gnu/services/virtualization.scm | 249 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 306 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index e9ee5127a..5c836ae96 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16956,8 +16956,10 @@ an absolute path can be specified here. @node Virtualization Services @subsubsection Virtualization services + The @code{(gnu services virtualization)} module provides services for -the libvirt and virtlog daemons. +the libvirt and virtlog daemons, as well as other virtualization-related +services. @subsubheading Libvirt daemon @code{libvirtd} is the server side daemon component of the libvirt @@ -17660,6 +17662,61 @@ Defaults to @samp{3} @end deftypevr +@subsubheading Transparent Emulation with QEMU + +@cindex emulation +@cindex @code{binfmt_misc} +@code{qemu-binfmt-service-type} provides support for transparent +emulation of program binaries built for different architectures---e.g., +it allows you to transparently execute an ARMv7 program on an x86_64 +machine. It achieves this by combining the @uref{https://www.qemu.org, +QEMU} emulator and the @code{binfmt_misc} feature of the kernel Linux. + +@defvr {Scheme Variable} qemu-binfmt-service-type +This is the type of the QEMU/binfmt service for transparent emulation. +Its value must be a @code{qemu-binfmt-configuration} object, which +specifies the QEMU package to use as well as the architecture we want to +emulated: + +@example +(service qemu-binfmt-service-type + (qemu-binfmt-configuration + (platforms (lookup-qemu-platforms "arm" "aarch64")))) +@end example + +In this example, we enable transparent emulation for the ARM and aarch64 +platforms. Running @code{herd stop qemu-binfmt} turns it off, and +running @code{herd start qemu-binfmt} turns it back on (@pxref{Invoking +herd, the @command{herd} command,, shepherd, The GNU Shepherd Manual}). +@end defvr + +@deftp {Data Type} qemu-binfmt-configuration +This is the configuration for the @code{qemu-binfmt} service. + +@table @asis +@item @code{platforms} (default: @code{'()}) +The list of emulated QEMU platforms. Each item must be a @dfn{platform +object} as returned by @code{lookup-qemu-platforms} (see below). + +@item @code{qemu} (default: @code{qemu}) +The QEMU package to use. +@end table +@end deftp + +@deffn {Scheme Procedure} lookup-qemu-platforms @var{platforms}@dots{} +Return the list of QEMU platform objects corresponding to +@var{platforms}@dots{}. @var{platforms} must be a list of strings +corresponding to platform names, such as @code{"arm"}, @code{"sparc"}, +@code{"mips64el"}, and so on. +@end deffn + +@deffn {Scheme Procedure} qemu-platform? @var{obj} +Return true if @var{obj} is a platform object. +@end deffn + +@deffn {Scheme Procedure} qemu-platform-name @var{platform} +Return the name of @var{platform}---a string such as @code{"arm"}. +@end deffn @node Version Control Services @subsubsection Version Control Services diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index 845cdb07b..ac6afe043 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ryan Moe +;;; Copyright © 2018 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,16 +24,29 @@ #:use-module (gnu services dbus) #:use-module (gnu services shepherd) #:use-module (gnu system shadow) + #:use-module (gnu system file-systems) #:use-module (gnu packages admin) #:use-module (gnu packages virtualization) #:use-module (guix records) #:use-module (guix gexp) #:use-module (guix packages) + #:use-module (srfi srfi-9) + #:use-module (srfi srfi-26) + #:use-module (rnrs bytevectors) #:use-module (ice-9 match) #:export (libvirt-configuration libvirt-service-type - virtlog-service-type)) + virtlog-service-type + + %qemu-platforms + lookup-qemu-platforms + qemu-platform? + qemu-platform-name + + qemu-binfmt-configuration + qemu-binfmt-configuration? + qemu-binfmt-service-type)) (define (uglify-field-name field-name) (let ((str (symbol->string field-name))) @@ -490,3 +504,236 @@ potential infinite waits blocking libvirt.")) (generate-documentation `((libvirt-configuration ,libvirt-configuration-fields)) 'libvirt-configuration)) + + +;;; +;;; Transparent QEMU emulation via binfmt_misc. +;;; + +;; Platforms that QEMU can emulate. +(define-record-type + (qemu-platform name family magic mask) + qemu-platform? + (name qemu-platform-name) ;string + (family qemu-platform-family) ;string + (magic qemu-platform-magic) ;bytevector + (mask qemu-platform-mask)) ;bytevector + +(define-syntax bv + (lambda (s) + "Expand the given string into a bytevector." + (syntax-case s () + ((_ str) + (string? (syntax->datum #'str)) + (let ((bv (u8-list->bytevector + (map char->integer + (string->list (syntax->datum #'str)))))) + bv))))) + +;;; The platform descriptions below are taken from +;;; 'scripts/qemu-binfmt-conf.sh' in QEMU. + +(define %i386 + (qemu-platform "i386" "i386" + (bv "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00") + (bv "\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"))) + +(define %i486 + (qemu-platform "i486" "i386" + (bv "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00") + (bv "\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"))) + +(define %alpha + (qemu-platform "alpha" "alpha" + (bv "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90") + (bv "\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"))) + +(define %arm + (qemu-platform "arm" "arm" + (bv "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"))) + +(define %armeb + (qemu-platform "armeb" "arm" + (bv "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +(define %sparc + (qemu-platform "sparc" "sparc" + (bv "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02") + (bv "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +(define %sparc32plus + (qemu-platform "sparc32plus" "sparc" + (bv "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x12") + (bv "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +(define %ppc + (qemu-platform "ppc" "ppc" + (bv "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +(define %ppc64 + (qemu-platform "ppc64" "ppc" + (bv "\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +(define %ppc64le + (qemu-platform "ppc64le" "ppcle" + (bv "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00"))) + +(define %m68k + (qemu-platform "m68k" "m68k" + (bv "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04") + (bv "\xff\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +;; XXX: We could use the other endianness on a MIPS host. +(define %mips + (qemu-platform "mips" "mips" + (bv "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +(define %mipsel + (qemu-platform "mipsel" "mips" + (bv "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"))) + +(define %mipsn32 + (qemu-platform "mipsn32" "mips" + (bv "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +(define %mipsn32el + (qemu-platform "mipsn32el" "mips" + (bv "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"))) + +(define %mips64 + (qemu-platform "mips64" "mips" + (bv "\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +(define %mips64el + (qemu-platform "mips64el" "mips" + (bv "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"))) + +(define %sh4 + (qemu-platform "sh4" "sh4" + (bv "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00") + (bv "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"))) + +(define %sh4eb + (qemu-platform "sh4eb" "sh4" + (bv "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a") + (bv "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +(define %s390x + (qemu-platform "s390x" "s390x" + (bv "\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16") + (bv "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +(define %aarch64 + (qemu-platform "aarch64" "arm" + (bv "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"))) + +(define %hppa + (qemu-platform "hppa" "hppa" + (bv "\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x0f") + (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))) + +(define %qemu-platforms + (list %i386 %i486 %alpha %arm %sparc32plus %ppc %ppc64 %ppc64le %m68k + %mips %mipsel %mipsn32 %mipsn32el %mips64 %mips64el + %sh4 %sh4eb %s390x %aarch64 %hppa)) + +(define (lookup-qemu-platforms . names) + "Return the list of QEMU platforms that match NAMES--a list of names such as +\"arm\", \"hppa\", etc." + (filter (lambda (platform) + (member (qemu-platform-name platform) names)) + %qemu-platforms)) + +(define-record-type* + qemu-binfmt-configuration make-qemu-binfmt-configuration + qemu-binfmt-configuration? + (qemu qemu-binfmt-configuration-qemu + (default qemu)) + (platforms qemu-binfmt-configuration-platforms + (default '()))) ;safest default + +(define (qemu-platform->binfmt qemu platform) + "Return a gexp that evaluates to a binfmt string for PLATFORM, using the +given QEMU package." + (define (bytevector->ascii-string bv) + (list->string (map integer->char + (bytevector->u8-list bv)))) + + (match platform + (($ name family magic mask) + ;; See 'Documentation/binfmt_misc.txt' in the kernel. + #~(string-append ":qemu-" #$name ":M::" + #$(bytevector->ascii-string magic) + ":" #$(bytevector->ascii-string mask) + ":" #$(file-append qemu "/bin/qemu-" name) + ":" ;FLAGS go here + )))) + +(define %binfmt-mount-point + "/proc/sys/fs/binfmt_misc") + +(define %binfmt-register-file + (string-append %binfmt-mount-point "/register")) + +(define %binfmt-file-system + (file-system + (mount-point %binfmt-mount-point) + (type "binfmt_misc") + (device "binfmt_misc") + (title 'device))) + +(define qemu-binfmt-shepherd-services + (match-lambda + (($ qemu platforms) + (list (shepherd-service + (provision '(qemu-binfmt)) + (documentation "Install binfmt_misc handlers for QEMU.") + (requirement '(file-system-/proc/sys/fs/binfmt_misc)) + (start #~(lambda () + ;; Register the handlers for all of PLATFORMS. + (call-with-output-file #$%binfmt-register-file + (lambda (port) + (for-each (lambda (str) + (display str port)) + (list + #$@(map (cut qemu-platform->binfmt qemu + <>) + platforms))))) + #t)) + (stop #~(lambda (_) + ;; Unregister the handlers. + (for-each (lambda (name) + (let ((file (string-append + #$%binfmt-mount-point + "/qemu-" name))) + (call-with-output-file file + (lambda (port) + (display "-1" port))))) + '#$(map qemu-platform-name platforms)) + #f))))))) + +(define qemu-binfmt-service-type + ;; TODO: Make a separate binfmt_misc service out of this? + (service-type (name 'qemu-binfmt) + (extensions + (list (service-extension file-system-service-type + (const (list %binfmt-file-system))) + (service-extension shepherd-root-service-type + qemu-binfmt-shepherd-services))) + (default-value (qemu-binfmt-configuration)) + (description + "This service supports transparent emulation of binaries +compiled for other architectures using QEMU and the @code{binfmt_misc} +functionality of the kernel Linux."))) -- 2.15.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 15:34:20 2018 Received: (at 20239) by debbugs.gnu.org; 9 Jan 2018 20:34:20 +0000 Received: from localhost ([127.0.0.1]:49963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZ0bE-0000JY-BC for submit@debbugs.gnu.org; Tue, 09 Jan 2018 15:34:20 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:36570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZ0bC-0000JQ-MM for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 15:34:19 -0500 Received: from localhost (178.113.224.152.wireless.dyn.drei.com [178.113.224.152]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 8147B33601CF; Tue, 9 Jan 2018 21:34:16 +0100 (CET) Date: Tue, 9 Jan 2018 21:34:13 +0100 From: Danny Milosavljevic To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: bug#20239: [PATCH 4/4] daemon: Always try to execute the builder regardless of the platform. Message-ID: <20180109213413.57ff4697@scratchpost.org> In-Reply-To: <20180109161427.28836-5-ludo@gnu.org> References: <87tw6d1j7a.fsf@gnu.org> <20180109161427.28836-1-ludo@gnu.org> <20180109161427.28836-5-ludo@gnu.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20239 Cc: 20239@debbugs.gnu.org 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: -0.7 (/) > + > + errno = error; > throw SysError(format("executing `%1%'") % drv.builder); Indentation off. Otherwise LGTM! From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 15:41:51 2018 Received: (at 20239) by debbugs.gnu.org; 9 Jan 2018 20:41:51 +0000 Received: from localhost ([127.0.0.1]:49974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZ0iV-0000Tz-AC for submit@debbugs.gnu.org; Tue, 09 Jan 2018 15:41:51 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:37204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZ0iU-0000Tr-5f for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 15:41:50 -0500 Received: from localhost (178.113.224.152.wireless.dyn.drei.com [178.113.224.152]) by dd26836.kasserver.com (Postfix) with ESMTPSA id EE8AB33600F4; Tue, 9 Jan 2018 21:41:48 +0100 (CET) Date: Tue, 9 Jan 2018 21:41:46 +0100 From: Danny Milosavljevic To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: bug#20239: [PATCH 1/4] services: Add qemu-binfmt. Message-ID: <20180109214146.2a70891e@scratchpost.org> In-Reply-To: <20180109161427.28836-2-ludo@gnu.org> References: <87tw6d1j7a.fsf@gnu.org> <20180109161427.28836-1-ludo@gnu.org> <20180109161427.28836-2-ludo@gnu.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: LGTM! [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.145.193 listed in list.dnswl.org] 2.1 BODY_SINGLE_WORD Message body is only one word (no spaces) X-Debbugs-Envelope-To: 20239 Cc: 20239@debbugs.gnu.org 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: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: LGTM! [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.145.193 listed in list.dnswl.org] 2.1 BODY_SINGLE_WORD Message body is only one word (no spaces) LGTM! From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 15:43:51 2018 Received: (at 20239) by debbugs.gnu.org; 9 Jan 2018 20:43:51 +0000 Received: from localhost ([127.0.0.1]:49978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZ0kR-0000Wt-MO for submit@debbugs.gnu.org; Tue, 09 Jan 2018 15:43:51 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:37394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZ0kQ-0000Wl-7B for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 15:43:50 -0500 Received: from localhost (178.113.224.152.wireless.dyn.drei.com [178.113.224.152]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 07F8A336068C; Tue, 9 Jan 2018 21:43:48 +0100 (CET) Date: Tue, 9 Jan 2018 21:43:47 +0100 From: Danny Milosavljevic To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: bug#20239: [PATCH 3/4] services: qemu-binfmt: Extend guix-daemon with extra chroot directories. Message-ID: <20180109214347.67c9edd7@scratchpost.org> In-Reply-To: <20180109161427.28836-4-ludo@gnu.org> References: <87tw6d1j7a.fsf@gnu.org> <20180109161427.28836-1-ludo@gnu.org> <20180109161427.28836-4-ludo@gnu.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: LGTM! [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.145.193 listed in list.dnswl.org] 2.1 BODY_SINGLE_WORD Message body is only one word (no spaces) X-Debbugs-Envelope-To: 20239 Cc: 20239@debbugs.gnu.org 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: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: LGTM! [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.145.193 listed in list.dnswl.org] 2.1 BODY_SINGLE_WORD Message body is only one word (no spaces) LGTM! From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 15:48:27 2018 Received: (at 20239) by debbugs.gnu.org; 9 Jan 2018 20:48:27 +0000 Received: from localhost ([127.0.0.1]:49982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZ0ot-0000dk-8B for submit@debbugs.gnu.org; Tue, 09 Jan 2018 15:48:27 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:37712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZ0or-0000dc-Sc for 20239@debbugs.gnu.org; Tue, 09 Jan 2018 15:48:26 -0500 Received: from localhost (178.113.224.152.wireless.dyn.drei.com [178.113.224.152]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 93127336059A; Tue, 9 Jan 2018 21:48:24 +0100 (CET) Date: Tue, 9 Jan 2018 21:48:21 +0100 From: Danny Milosavljevic To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: bug#20239: [PATCH 2/4] services: guix: Add 'chroot-directories' field. Message-ID: <20180109214821.5d051555@scratchpost.org> In-Reply-To: <20180109161427.28836-3-ludo@gnu.org> References: <87tw6d1j7a.fsf@gnu.org> <20180109161427.28836-1-ludo@gnu.org> <20180109161427.28836-3-ludo@gnu.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: LGTM! [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.145.193 listed in list.dnswl.org] 2.1 BODY_SINGLE_WORD Message body is only one word (no spaces) X-Debbugs-Envelope-To: 20239 Cc: 20239@debbugs.gnu.org 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: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: LGTM! [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.145.193 listed in list.dnswl.org] 2.1 BODY_SINGLE_WORD Message body is only one word (no spaces) LGTM! From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 11 08:46:20 2018 Received: (at 20239-done) by debbugs.gnu.org; 11 Jan 2018 13:46:20 +0000 Received: from localhost ([127.0.0.1]:51763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZdBT-0006dy-Pq for submit@debbugs.gnu.org; Thu, 11 Jan 2018 08:46:20 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:60762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZdBR-0006do-QL for 20239-done@debbugs.gnu.org; Thu, 11 Jan 2018 08:46:18 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C045A103EC for <20239-done@debbugs.gnu.org>; Thu, 11 Jan 2018 14:46:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2c9CR4BhkHsR for <20239-done@debbugs.gnu.org>; Thu, 11 Jan 2018 14:46:15 +0100 (CET) Received: from ribbon (unknown [193.50.110.92]) by hera.aquilenet.fr (Postfix) with ESMTPSA id CA547101CE for <20239-done@debbugs.gnu.org>; Thu, 11 Jan 2018 14:46:15 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: 20239-done@debbugs.gnu.org Subject: Re: bug#20239: [PATCH 1/4] services: Add qemu-binfmt. References: <87tw6d1j7a.fsf@gnu.org> <20180109161427.28836-1-ludo@gnu.org> <20180109161427.28836-2-ludo@gnu.org> Date: Thu, 11 Jan 2018 14:46:15 +0100 In-Reply-To: <20180109161427.28836-2-ludo@gnu.org> ("Ludovic \=\?utf-8\?Q\?Cou\?\= \=\?utf-8\?Q\?rt\=C3\=A8s\=22's\?\= message of "Tue, 9 Jan 2018 17:14:24 +0100") Message-ID: <87wp0o8q54.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20239-done 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: 1.0 (+) Hello, Ludovic Court=C3=A8s skribis: > * gnu/services/virtualization.scm (): New record type. > (bv): New macro. > (%i386, %i486, %alpha, %arm, %armeb, %sparc, %sparc32plus) > (%ppc, %ppc64, %ppc64le, %m68k, %mips, %mipsel, %mipsn32el) > (%mips64, %mips64el, %sh4, %sh4eb, %s390x, %aarch64, %hppa) > (%qemu-platforms): New variables. > (lookup-qemu-platforms): New procedure. > (): New record type. > (qemu-platform->binfmt): New procedures. > (%binfmt-mount-point, %binfmt-register-file, %binfmt-file-system) > (qemu-binfmt-service-type): New variables. > (qemu-binfmt-shepherd-services): New procedures. > * doc/guix.texi (Virtualization Services): Add "Transparent Emulation > with QEMU" heading. I fixed a couple of bugs here: - open the =E2=80=9C=E2=80=A6/register=E2=80=9D file once for each platfo= rm instead of once for all; - hex-encode all the characters in the magic and mask fields of binfmt_misc (before that binfmt_misc would ignore everything after the first NUL). I also added cross-references under the description of --system in the manual, and a note about the =E2=80=98F=E2=80=99 flag of binfmt_misc. Pushed now! Thanks, Ludo=E2=80=99. From unknown Sat Aug 16 15:55:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 09 Feb 2018 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator