From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Offloading to a VM Date: Mon, 05 Sep 2016 22:28:12 +0200 Message-ID: <87shtew0pv.fsf@gnu.org> References: <87bn0pp58b.fsf@gnu.org> <877fb12cf7.fsf_-_@gnu.org> <87r3974txx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh0VA-0001Sx-16 for guix-devel@gnu.org; Mon, 05 Sep 2016 16:28:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bh0V5-00023v-RV for guix-devel@gnu.org; Mon, 05 Sep 2016 16:28:18 -0400 In-Reply-To: (David Craven's message of "Sat, 3 Sep 2016 16:27:52 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: David Craven Cc: guix-devel David Craven skribis: >> The =E2=80=9Cbuild hook=E2=80=9D is the mechanism by which the daemon as= ks an external >> program whether it can build a derivation for some system. > >> Our (guix scripts offload) is such a program; it replies positively if >> there=E2=80=99s a machine that matches the target system. > >> What I was suggesting is to have another build hook that would reply >> positively as long as the target system can be emulated by QEMU. > > So I thought about this some more. guix offload uses guix build to > build a derivation which again uses a different nix-daemon to build > it. I'm not sure that guix offload can help us here. Above, I was not suggesting to use =E2=80=98guix offload=E2=80=99. Instead= , I was suggesting to write a new =E2=80=9Cbuild hook=E2=80=9D that would run qemu-= arm, mentioning (guix scripts offload) as an example of a build hook. > If it is possible to build a derivation using only qemu-arm instead of > qemu-system-arm - which I'm still not convinced - I think it's the > nix-daemon that would have to support this. In build.cc it sets up a > chroot and then executes the builder. I think it's that builder that > needs to be run with qemu-arm. But I don't think it's going to be as > easy as that =3D) guix-daemon can be extended via this =E2=80=9Cbuild hook=E2=80=9D mechanism= . What I=E2=80=99m proposing is to extend guix-daemon via an external build hook, which means that guix-daemon itself can remain unchanged. A derivation is essentially the file name of a =E2=80=9Cbuilder=E2=80=9D al= ong with its argv and the needed dependencies. For a given derivation, the hook would roughly run: qemu-arm /gnu/store/=E2=80=A6-builder arg1 arg2 =E2=80=A6 Hope this clarifies things! Ludo=E2=80=99.