From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: Qemu binfmt on foreign distro Date: Thu, 21 Nov 2019 11:01:31 +0100 Message-ID: <87wobt1rb8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39491) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXjHS-0000f6-5X for guix-devel@gnu.org; Thu, 21 Nov 2019 05:01:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXjHN-0002iV-6f for guix-devel@gnu.org; Thu, 21 Nov 2019 05:01:42 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:45152) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iXjHM-0002iI-Uo for guix-devel@gnu.org; Thu, 21 Nov 2019 05:01:37 -0500 Received: by mail-wr1-x42c.google.com with SMTP id z10so3537003wrs.12 for ; Thu, 21 Nov 2019 02:01:36 -0800 (PST) Received: from meru (lfbn-ann-1-138-102.w86-200.abo.wanadoo.fr. [86.200.106.102]) by smtp.gmail.com with ESMTPSA id k4sm2477043wmk.26.2019.11.21.02.01.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 02:01:33 -0800 (PST) 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: guix-devel Hello, When running a guix build command with --system argument set to a foreign architecture, guix-daemon will use linux binfmt mechanism to emulate binary execution. On a Guix system, the qemu-binfmt-service-type service has to be installed, so that linux binfmt mechanism is hooked to QEMU. This service also adds a bunch of "--chroot-directory" arguments to guix-daemon command line, so that QEMU and all its dependencies are accessible from the guix-daemon chroot. On a foreign distro, one can install QEMU and setup the binfmt mechanism (installing binfmt-support and qemu-user-static packages on Ubuntu). However, without the proper --chroot-directory arguments passed to guix-daemon, all binaries execution relying on binfmt will throw ENOENT from within the guix-daemon. So I can see two solutions here: * Remove --system argument support for guix on foreign distributions (except when using this argument does not require binfmt support, 32 bits build on a 64 bits machine). * Provide some kind of script that generates the correct guix-daemon command line, enabling binfmt support on foreign distros. Anyhow, the current behaviour where guix build --system=... fails misteriously because of an ENOENT error on a foreign distro is not acceptable in my opinion. What do you think? Thanks, Mathieu