From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:40572) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilqbn-0001X4-PO for guix-patches@gnu.org; Mon, 30 Dec 2019 03:41:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ilqbm-0007L3-J0 for guix-patches@gnu.org; Mon, 30 Dec 2019 03:41:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ilqbm-0007Kz-Ff for guix-patches@gnu.org; Mon, 30 Dec 2019 03:41:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ilqbm-0005uu-DA for guix-patches@gnu.org; Mon, 30 Dec 2019 03:41:02 -0500 Subject: [bug#38612] Pass system and target arguments to gexp->file. Resent-Message-ID: References: <87a77ug6vv.fsf@gmail.com> <8736dl8wxq.fsf@gmail.com> <87d0cipt6z.fsf@gnu.org> <87r20t7r0j.fsf@gmail.com> <87imm468rr.fsf@gmail.com> <87d0cbhsk1.fsf@gnu.org> <87mubej4sq.fsf@gmail.com> <87a77dhce4.fsf@gnu.org> <878smvtr1b.fsf@gmail.com> <87k16e92t7.fsf@gnu.org> From: Mathieu Othacehe In-reply-to: <87k16e92t7.fsf@gnu.org> Date: Mon, 30 Dec 2019 09:40:00 +0100 Message-ID: <87eewm6wbj.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 38612@debbugs.gnu.org Hey, > Uh, it=E2=80=99s =E2=80=9Cthe right thing=E2=80=9D but it=E2=80=99s getti= ng ugly. :-/ > > If we take a step back, what=E2=80=99s the minimal change that would solv= e the > problem you=E2=80=99re looking at? > > Apologies for the back-and-forth, it=E2=80=99s a tricky area! I'm glad I can have your support on this topic :) Here's a small recap of the situation. As you may know I'm trying to get "guix system build install.scm --target=3Dxxx" to work. My board needs specific initrd kernel modules to boot. As target is not passed to lower-object in system-derivation procedure of (gnu services), raw-initrd will try to locate those (arm specific) modules in the host x86 kernel, where they do not exist, and fail. The same thing happens for operating-system-boot-parameters-file which contains a gexp->file call. Now, while this problem is quite specific, we need to find a generic solution to those target issues. Forcing the user of (guix gexp) to pass a target argument implies the use of monadic style to read %current-target-system safely. On the other hand, defaulting to the current target inside (guix gexp) as proposed in my patch is kinda ugly as you noticed :p Could %current-target-system be set outside of the monadic context so that we can access it from wherever we want? That would also solve the issue I have with canonical-package procedure[1], that read %current-target-system outside of the monadic context, where is is always #f. Thanks for your help, Mathieu [1]: https://lists.gnu.org/archive/html/guix-devel/2019-12/msg00353.html