GNU bug report logs - #38612
Pass system and target arguments to gexp->file.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Mathieu Othacehe <m.othacehe@HIDDEN>; dated Sat, 14 Dec 2019 21:02:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 38612 <at> debbugs.gnu.org:


Received: (at 38612) by debbugs.gnu.org; 26 Dec 2019 18:54:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 26 13:54:55 2019
Received: from localhost ([127.0.0.1]:56248 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ikYHf-0000ed-0i
	for submit <at> debbugs.gnu.org; Thu, 26 Dec 2019 13:54:55 -0500
Received: from mail-wm1-f53.google.com ([209.85.128.53]:32960)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1ikYHd-0000eQ-HW
 for 38612 <at> debbugs.gnu.org; Thu, 26 Dec 2019 13:54:54 -0500
Received: by mail-wm1-f53.google.com with SMTP id d139so5543178wmd.0
 for <38612 <at> debbugs.gnu.org>; Thu, 26 Dec 2019 10:54:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version:content-transfer-encoding;
 bh=nTIMpZdSvulpIXgdGkPVjlcEVlhFWm6lX9EjxduaYxM=;
 b=rdQe5Q2Q9z+trQ+yXCTVJ4mCDnvg4EszwxZCaYT6AjO1oawQFZGW4WDYZHn/io5o4q
 H5MMA+hrXi0sJmIYrIKGbkeaSYDF3fEqTJytVrzQFGwvXhT7JUAuSMfmHZDB1Yj0bYPW
 Kv9Pc8nGTB3XjuaCmIX1ZjvCWStUV9RYuuDpK/rt9206xW4ImF51Fz2+Il4CQWuhiqYP
 Y8CfzGkpBWCycNZ2Xn+M9CGvjXSrTG64jJvaY/jrsstKfFgaQWHcnh5FZM6teK87ah+z
 NlP19ekJbQSWrsgEeVcOZAmRrCQB5ZYmn82OXsrrPCq4WA8+aLJZ14fbfEoA9FfGs/ke
 VsFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version:content-transfer-encoding;
 bh=nTIMpZdSvulpIXgdGkPVjlcEVlhFWm6lX9EjxduaYxM=;
 b=DD8h2vc4tEC3PSvXEeKJA81Z7Oo4QLSQZDgEUdAjgkbO36eOZGIutRTEjudnRTmyPI
 0axzPBiFs2L29ZUBiTDhj6Jl4/bDPVD+ki0Tbq70ds2ZI0br7knp+WI3G9HVpGBh1aKE
 k/5iPHia9+7ECEYccklM6vPuoVJAo4ZDfhA+obTd5g66zvp0cYco0mg4XU5Gq7Y8a/56
 0pqwr6Nk6lYVSS5M8UfEDgqyGcwQatnXzpiggZ6VN3K/f93+8hAR6TkxOiOxpsaaObOh
 5UsJ1sjcAbp6HS/zl+ZBRJ8qadRe4bLgTqnmz0nB/woBkHz53HCUDrupTB91Bv4QGahS
 R8vg==
X-Gm-Message-State: APjAAAVuo9QLij8PFoCzj9AiwvdeI4K2QbEeDFIKC65pfd9mAhvdMw5k
 wRbxLTByktgapYLgbX0XkcgkE1qz
X-Google-Smtp-Source: APXvYqy3YFv/IXNQivSDytkC9VWwaQKl6mMmN+8ccqcHEImarTHGLB1M1EmXi9nCWDCVX7OOKLw6Dg==
X-Received: by 2002:a05:600c:211:: with SMTP id
 17mr15206353wmi.60.1577386487306; 
 Thu, 26 Dec 2019 10:54:47 -0800 (PST)
Received: from cervin ([2a01:cb18:832e:5f00:a14b:cea0:a27:c884])
 by smtp.gmail.com with ESMTPSA id y6sm31264308wrl.17.2019.12.26.10.54.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 26 Dec 2019 10:54:46 -0800 (PST)
References: <87a77ug6vv.fsf@HIDDEN> <8736dl8wxq.fsf@HIDDEN>
 <87d0cipt6z.fsf@HIDDEN> <87r20t7r0j.fsf@HIDDEN>
 <87imm468rr.fsf@HIDDEN> <87d0cbhsk1.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 27.0.50
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#38612] Pass system and target arguments to gexp->file.
In-reply-to: <87d0cbhsk1.fsf@HIDDEN>
Date: Thu, 26 Dec 2019 19:54:45 +0100
Message-ID: <87mubej4sq.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 38612
Cc: 38612 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


Hey,

> In general, in monadic code, we should refer to (current-system) and
> (current-target-system), not to the SRFI-39 parameters.

Ok!

> By default, =E2=80=98gexp->file=E2=80=99 now uses the current system and =
target, so this
> change shouldn=E2=80=99t be necessary if you just want to use those.  Am I
> missing something?

Well turns out that gexp->file takes #f as default target (as
gexp->script and lower-object).

Using %current-target-system as default target argument (as gexp->sexp)
makes those two patches useless.

Would you have any objection to use %current-target-system as default
target argument in gexp->file and lower-object?

Thanks,

Mathieu




Information forwarded to guix-patches@HIDDEN:
bug#38612; Package guix-patches. Full text available.

Message received at 38612 <at> debbugs.gnu.org:


Received: (at 38612) by debbugs.gnu.org; 26 Dec 2019 18:19:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 26 13:19:17 2019
Received: from localhost ([127.0.0.1]:56236 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ikXjA-0008En-Q4
	for submit <at> debbugs.gnu.org; Thu, 26 Dec 2019 13:19:16 -0500
Received: from mail-wr1-f51.google.com ([209.85.221.51]:37143)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1ikXj8-0008EY-KW
 for 38612 <at> debbugs.gnu.org; Thu, 26 Dec 2019 13:19:14 -0500
Received: by mail-wr1-f51.google.com with SMTP id w15so11617672wru.4
 for <38612 <at> debbugs.gnu.org>; Thu, 26 Dec 2019 10:19:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=0W1EqEufFBQJLsuX6NMueDKKoYHlqm1NLnfylpFtJ68=;
 b=tFbVdTLkk1lunsaLVac3AyRRhfNSAKbiCndc3K/FRYqm6xCzbCG22MPNT9stFvwpHD
 ZohHf1VUFJnfbdgzjAUTA/rTgV/H0Q6g/TJ7bqlmKrEM3V62YJ1dUU4IMP236hQT4L2i
 t9HnYDdQezrnU/P825Gj/ZwhFdZPlPElOWJjmYyfzb6HUhlN/7BD1YzlY0z0gCO2eqbR
 ikTkoekxxJkUtwyR28TbjATnUvWzVBuEGI0MEGFHO9+osmwpfQwSK+dRGcAkdd+qS8Tc
 347M0fzXDMZreJ+rPLo2A+lWUEwmj5VMB5wR1FcEe557+BMhRtnfW6DdV8T6J+XhfB+n
 F2MQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=0W1EqEufFBQJLsuX6NMueDKKoYHlqm1NLnfylpFtJ68=;
 b=CzWNSF+a0KThWrGqOqpU+HuYX8kZ2UZqhOkCRtfKYJKSd4CzD1HJR8DqyoJVrP/uk4
 khz0E7q9TqlDp9oAUuL8C/+QrDEZNEUfOkrGC8GMHSCR6eugJ8Ef84r2EwyHnzesWdZQ
 jHuXrlyckKczLujEuN7oeI8dZtY+cykjRDxWpxrdRnYgGizItz2z+kWQhis6J9kRUE3t
 bOfFKVMtOJLOP7AVu1BDCMTXogHvlo9MDfHUdTrUM86t9I4ZfcQi1n0kc25lCwEhmLuD
 2FWmD/vanaQgbNID8BZqj1ZfHcjoi8Pu4nD/KIvJwTAK2FXkQbN1uOeF2OGaBLiggoDb
 /Jew==
X-Gm-Message-State: APjAAAWctm/aq05K27frf4VBi90+tv5BBAZnMHXQQZtJ/TEQn6BLdTz+
 hc3V4s2VS16ZndFwQqRV1+y4uGUX
X-Google-Smtp-Source: APXvYqwd9kBXVLb6DjSFbmA/WVZrEfsRk231YQhWMM6yhh4AJI7yexrZXTY6AjxS4UAZEeU7VLqqDg==
X-Received: by 2002:adf:c74f:: with SMTP id b15mr46105143wrh.272.1577384348633; 
 Thu, 26 Dec 2019 10:19:08 -0800 (PST)
Received: from cervin ([2a01:cb18:832e:5f00:a14b:cea0:a27:c884])
 by smtp.gmail.com with ESMTPSA id h8sm33406799wrx.63.2019.12.26.10.19.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 26 Dec 2019 10:19:08 -0800 (PST)
References: <87a77ug6vv.fsf@HIDDEN> <8736dl8wxq.fsf@HIDDEN>
 <87d0cipt6z.fsf@HIDDEN> <87r20t7r0j.fsf@HIDDEN> <87k16jhste.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 27.0.50
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#38612] Pass system and target arguments to gexp->file.
In-reply-to: <87k16jhste.fsf@HIDDEN>
Date: Thu, 26 Dec 2019 19:19:06 +0100
Message-ID: <87o8vvhrvp.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 38612
Cc: 38612 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


Hey Ludo,

> LGTM!
>
> Does it fix something for you?

Thanks for your review :) Yes, without this patch, all
operating-system-packages are built for host system instead of target,
when cross-compiling a Guix System.

Mathieu




Information forwarded to guix-patches@HIDDEN:
bug#38612; Package guix-patches. Full text available.

Message received at 38612 <at> debbugs.gnu.org:


Received: (at 38612) by debbugs.gnu.org; 26 Dec 2019 18:04:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 26 13:04:39 2019
Received: from localhost ([127.0.0.1]:56220 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ikXV0-0007nJ-SN
	for submit <at> debbugs.gnu.org; Thu, 26 Dec 2019 13:04:39 -0500
Received: from eggs.gnu.org ([209.51.188.92]:52427)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ikXUz-0007n0-VI
 for 38612 <at> debbugs.gnu.org; Thu, 26 Dec 2019 13:04:38 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46711)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1ikXUu-00065Q-JX; Thu, 26 Dec 2019 13:04:32 -0500
Received: from [2a01:e35:2ffd:930:f25f:2121:7012:6c8e] (port=57256 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1ikXUt-0003GV-UQ; Thu, 26 Dec 2019 13:04:32 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Mathieu Othacehe <m.othacehe@HIDDEN>
Subject: Re: [bug#38612] Pass system and target arguments to gexp->file.
References: <87a77ug6vv.fsf@HIDDEN> <8736dl8wxq.fsf@HIDDEN>
 <87d0cipt6z.fsf@HIDDEN> <87r20t7r0j.fsf@HIDDEN>
 <87imm468rr.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 6 =?utf-8?Q?Niv=C3=B4se?= an 228 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Thu, 26 Dec 2019 19:04:30 +0100
In-Reply-To: <87imm468rr.fsf@HIDDEN> (Mathieu Othacehe's message of "Wed,
 25 Dec 2019 10:42:48 +0100")
Message-ID: <87d0cbhsk1.fsf@HIDDEN>
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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 38612
Cc: 38612 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello,

Mathieu Othacehe <m.othacehe@HIDDEN> skribis:

> From a05baf4f4328ce2ca6da6860f6e596cd7559a08a Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <m.othacehe@HIDDEN>
> Date: Tue, 24 Dec 2019 18:24:37 +0100
> Subject: [PATCH 1/2] system: operating-system-boot-parameters-file: Fix
>  cross-compilation.
>
> * gnu/system.scm (operating-system-boot-parameters-file): Add system and
> target arguments and pass them to gexp->file call,
> (operating-system-directory-base-entries): pass current system and target=
 to
> operating-system-boot-parameters-file procedure.
> ---
>  gnu/system.scm | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/system.scm b/gnu/system.scm
> index abdbb081e6..e7af7e7b47 100644
> --- a/gnu/system.scm
> +++ b/gnu/system.scm
> @@ -470,7 +470,10 @@ value of the SYSTEM-SERVICE-TYPE service."
>    (let ((locale (operating-system-locale-directory os)))
>      (mlet %store-monad ((kernel -> (operating-system-kernel os))
>                          (initrd -> (operating-system-initrd-file os))
> -                        (params    (operating-system-boot-parameters-fil=
e os)))
> +                        (params    (operating-system-boot-parameters-file
> +                                    os
> +                                    #:system (%current-system)
> +                                    #:target (%current-target-system))))

In general, in monadic code, we should refer to (current-system) and
(current-target-system), not to the SRFI-39 parameters.

> -(define* (operating-system-boot-parameters-file os
> -                                                #:key system-kernel-argu=
ments?)
> +(define* (operating-system-boot-parameters-file
> +          os
> +          #:key
> +          system-kernel-arguments?
> +          system
> +          target)
>     "Return a file that describes the boot parameters of OS.  The primary=
 use of
>  this file is the reconstruction of GRUB menu entries for old configurati=
ons.
>=20=20
> @@ -1085,7 +1092,9 @@ being stored into the \"parameters\" file)."
>                       (device
>                        #$(device->sexp (boot-parameters-store-device para=
ms)))
>                       (mount-point #$(boot-parameters-store-mount-point p=
arams))))
> -                 #:set-load-path? #f)))
> +                 #:set-load-path? #f
> +                 #:system system
> +                 #:target target)))

By default, =E2=80=98gexp->file=E2=80=99 now uses the current system and ta=
rget, so this
change shouldn=E2=80=99t be necessary if you just want to use those.  Am I
missing something?

The general guideline is that it would be good if only primitives
(monadic procedures in (guix gexp) as well as gexp compilers) would have
an explicit #:system and #:target parameter.

> From 0ce67afc4f33074e20824751c22ba01cf6a3e184 Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <m.othacehe@HIDDEN>
> Date: Wed, 25 Dec 2019 09:49:53 +0100
> Subject: [PATCH 2/2] services: Fix cross-compilation.
>
> * gnu/services.scm (system-derivation): Pass current system and target at=
 bind
> time to lower-object,
> (compute-boot-script): also pass current system and target at bind time to
> gexp->file.

[...]

>  (define (system-derivation mentries mextensions)
>    "Return as a monadic value the derivation of the 'system' directory
>  containing the given entries."
> -  (mlet %store-monad ((entries    mentries)
> +  (mlet %store-monad ((system (current-system))
> +                      (target (current-target-system))
> +                      (entries    mentries)
>                        (extensions (sequence %store-monad mextensions)))

Please alight the RHS of =E2=80=98mlet=E2=80=99 bindings.  :-)

>      (lower-object
>       (file-union "system"
> -                 (append entries (concatenate extensions))))))
> +                 (append entries (concatenate extensions)))
> +     system
> +     #:target target)))

I guess this is needed here because =E2=80=98lower-object=E2=80=99 has #:ta=
rget default
to #f.

> +  (mlet %store-monad ((system (current-system))
> +                      (target (current-target-system)))
> +    (gexp->file "boot"
> +                ;; Clean up and activate the system, then spawn shepherd.
> +                #~(begin #$@(reverse gexps))
> +                #:system system
> +                #:target target)))

This one is unnecessary now that =E2=80=98gexp->file=E2=80=99 honors the cu=
rrent system
and target, right?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38612; Package guix-patches. Full text available.

Message received at 38612 <at> debbugs.gnu.org:


Received: (at 38612) by debbugs.gnu.org; 26 Dec 2019 17:59:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 26 12:59:03 2019
Received: from localhost ([127.0.0.1]:56208 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ikXPb-0007Yi-Of
	for submit <at> debbugs.gnu.org; Thu, 26 Dec 2019 12:59:03 -0500
Received: from eggs.gnu.org ([209.51.188.92]:50734)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ikXPZ-0007Y5-H6
 for 38612 <at> debbugs.gnu.org; Thu, 26 Dec 2019 12:59:02 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46586)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1ikXPU-0003MF-AV; Thu, 26 Dec 2019 12:58:56 -0500
Received: from [2a01:e35:2ffd:930:f25f:2121:7012:6c8e] (port=57238 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1ikXPT-00069l-0y; Thu, 26 Dec 2019 12:58:55 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Mathieu Othacehe <m.othacehe@HIDDEN>
Subject: Re: [bug#38612] Pass system and target arguments to gexp->file.
References: <87a77ug6vv.fsf@HIDDEN> <8736dl8wxq.fsf@HIDDEN>
 <87d0cipt6z.fsf@HIDDEN> <87r20t7r0j.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 6 =?utf-8?Q?Niv=C3=B4se?= an 228 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Thu, 26 Dec 2019 18:58:53 +0100
In-Reply-To: <87r20t7r0j.fsf@HIDDEN> (Mathieu Othacehe's message of "Tue,
 24 Dec 2019 15:11:08 +0100")
Message-ID: <87k16jhste.fsf@HIDDEN>
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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 38612
Cc: 38612 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello,

Mathieu Othacehe <m.othacehe@HIDDEN> skribis:

> From c8b0e65d9b264bd484c7c6571c2ce3d68173b057 Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <m.othacehe@HIDDEN>
> Date: Tue, 24 Dec 2019 15:04:57 +0100
> Subject: [PATCH] profiles: Fix profile-derivation cross-compilation.
>
> * guix/store.scm (current-target-system): New exported monadic procedure.
> * guix/profiles.scm (profile-derivation): Set target at bind time using t=
he
> above procedure.

LGTM!

Does it fix something for you?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38612; Package guix-patches. Full text available.

Message received at 38612 <at> debbugs.gnu.org:


Received: (at 38612) by debbugs.gnu.org; 25 Dec 2019 09:42:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 25 04:42:59 2019
Received: from localhost ([127.0.0.1]:53296 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ik3By-0000Lq-WA
	for submit <at> debbugs.gnu.org; Wed, 25 Dec 2019 04:42:59 -0500
Received: from mail-wr1-f52.google.com ([209.85.221.52]:36858)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1ik3Bx-0000Ld-F7
 for 38612 <at> debbugs.gnu.org; Wed, 25 Dec 2019 04:42:58 -0500
Received: by mail-wr1-f52.google.com with SMTP id z3so21518786wru.3
 for <38612 <at> debbugs.gnu.org>; Wed, 25 Dec 2019 01:42:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=TwdAzxsNwH7+LENQg3nruwAWsqLTxKSBhLOY40Yobqk=;
 b=hNGc7M2fQTqvAupwSGdgqBImd39AwcRBGeaCb/y6hxsdI5F/tn36FFhADHiHJl+Sxj
 0bZYR2gTzzSb6SKXPgXkHpP4UKh89n/of5LEBiInN28QFcqyV60ETVWSmCxQ9hS5/31w
 RthX8eBva+1VuUHxvwEV+B4Xn1YCJVbZzcq9VHcWcbRdZbQQ6TJ4cITW9l5+I4UDNcjm
 p8PZlGI1dt/4zwDhfSvY94z6oCk/rA3fqSxpWymJKUuTMLNLvSCrFuHhjWNBuh85VCJA
 8maWt3ryIeLEOTnzUpswBKojTRAhPcACYuNEOvHZd2TXji3numl18aPiyIYg0Aq19iBy
 Yynw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=TwdAzxsNwH7+LENQg3nruwAWsqLTxKSBhLOY40Yobqk=;
 b=o31nBUE/LpPzXclQ+FxwNdf5Yobim3ot4KKMM7cvQg5N6uCTZat3PK5m3T+5Cleopm
 lQ2CJ+BD/lytHgq0kyY1YYHjeh/DJG5SAXZGz0uGaAqfa2PTtSrcXiR8slD3NBLaYdgK
 YnwWj8wNqvXqewSmBPwgYBkmtA5OoSAUjdbKoLHp+l7atgDYn9dZox3XwLJDtIsX0nOE
 0rt4uXI40IUQRTtCca2bbvzlxmNhCbHGuEVAxtnR9yoLxDDw+Cw0ektRwU5XrOuSRUK5
 1c+BbzZsrBI04WMDRnzx4eg4jigEwHZJ6DUR2Wf6Kywx//qe/ZSAyUv3Cp8l+uFq2qbx
 T1gw==
X-Gm-Message-State: APjAAAUa7+fnZkFRIIoHVwFSKh9iN8GK/KyyLnjRp578fSew9sNhhxsk
 wQsTmlDc+aDGNf3gjx2BIeBrvrZj
X-Google-Smtp-Source: APXvYqxX9xTRDgE0/tMk0H80OY7NXUE9xb6HZKiC+iM4YBYb+5vxghZpxSOL8b2Wp29DyKzfpHZYUw==
X-Received: by 2002:adf:cd0a:: with SMTP id w10mr38680022wrm.107.1577266971164; 
 Wed, 25 Dec 2019 01:42:51 -0800 (PST)
Received: from cervin ([2a01:cb18:832e:5f00:a14b:cea0:a27:c884])
 by smtp.gmail.com with ESMTPSA id n1sm26571131wrw.52.2019.12.25.01.42.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 25 Dec 2019 01:42:49 -0800 (PST)
References: <87a77ug6vv.fsf@HIDDEN> <8736dl8wxq.fsf@HIDDEN>
 <87d0cipt6z.fsf@HIDDEN> <87r20t7r0j.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.3
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#38612] Pass system and target arguments to gexp->file.
In-reply-to: <87r20t7r0j.fsf@HIDDEN>
Date: Wed, 25 Dec 2019 10:42:48 +0100
Message-ID: <87imm468rr.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 38612
Cc: 38612 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain


Hello,

Turns out two more patches in the same vein are needed in (gnu services)
and (gnu system). They are attached here.

Thanks,

Mathieu

--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-system-operating-system-boot-parameters-file-Fix-cro.patch

From a05baf4f4328ce2ca6da6860f6e596cd7559a08a Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@HIDDEN>
Date: Tue, 24 Dec 2019 18:24:37 +0100
Subject: [PATCH 1/2] system: operating-system-boot-parameters-file: Fix
 cross-compilation.

* gnu/system.scm (operating-system-boot-parameters-file): Add system and
target arguments and pass them to gexp->file call,
(operating-system-directory-base-entries): pass current system and target to
operating-system-boot-parameters-file procedure.
---
 gnu/system.scm | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index abdbb081e6..e7af7e7b47 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -470,7 +470,10 @@ value of the SYSTEM-SERVICE-TYPE service."
   (let ((locale (operating-system-locale-directory os)))
     (mlet %store-monad ((kernel -> (operating-system-kernel os))
                         (initrd -> (operating-system-initrd-file os))
-                        (params    (operating-system-boot-parameters-file os)))
+                        (params    (operating-system-boot-parameters-file
+                                    os
+                                    #:system (%current-system)
+                                    #:target (%current-target-system))))
       (return `(("kernel" ,kernel)
                 ("parameters" ,params)
                 ("initrd" ,initrd)
@@ -1048,8 +1051,12 @@ such as '--root' and '--load' to <boot-parameters>."
     (_
      device)))
 
-(define* (operating-system-boot-parameters-file os
-                                                #:key system-kernel-arguments?)
+(define* (operating-system-boot-parameters-file
+          os
+          #:key
+          system-kernel-arguments?
+          system
+          target)
    "Return a file that describes the boot parameters of OS.  The primary use of
 this file is the reconstruction of GRUB menu entries for old configurations.
 
@@ -1085,7 +1092,9 @@ being stored into the \"parameters\" file)."
                      (device
                       #$(device->sexp (boot-parameters-store-device params)))
                      (mount-point #$(boot-parameters-store-mount-point params))))
-                 #:set-load-path? #f)))
+                 #:set-load-path? #f
+                 #:system system
+                 #:target target)))
 
 (define-gexp-compiler (operating-system-compiler (os <operating-system>)
                                                  system target)
-- 
2.24.1


--=-=-=
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: inline;
 filename=0002-services-Fix-cross-compilation.patch
Content-Transfer-Encoding: quoted-printable

From 0ce67afc4f33074e20824751c22ba01cf6a3e184 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@HIDDEN>
Date: Wed, 25 Dec 2019 09:49:53 +0100
Subject: [PATCH 2/2] services: Fix cross-compilation.

* gnu/services.scm (system-derivation): Pass current system and target at b=
ind
time to lower-object,
(compute-boot-script): also pass current system and target at bind time to
gexp->file.
---
 gnu/services.scm | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index e7a3a95e43..e6f8ae0fb0 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2015, 2016, 2017, 2018, 2019 Ludovic Court=C3=A8s <lu=
do@HIDDEN>
 ;;; Copyright =C2=A9 2016 Chris Marusich <cmmarusich@HIDDEN>
+;;; Copyright =C2=A9 2019 Mathieu Othacehe <m.othacehe@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -321,11 +322,15 @@ This is a shorthand for (map (lambda (svc) ...) %base=
-services)."
 (define (system-derivation mentries mextensions)
   "Return as a monadic value the derivation of the 'system' directory
 containing the given entries."
-  (mlet %store-monad ((entries    mentries)
+  (mlet %store-monad ((system (current-system))
+                      (target (current-target-system))
+                      (entries    mentries)
                       (extensions (sequence %store-monad mextensions)))
     (lower-object
      (file-union "system"
-                 (append entries (concatenate extensions))))))
+                 (append entries (concatenate extensions)))
+     system
+     #:target target)))
=20
 (define system-service-type
   ;; This is the ultimate service type, the root of the service DAG.  The
@@ -346,9 +351,13 @@ system profile, boot script, and so on.")))
   ;; order.  That is, user extensions would come first, and extensions add=
ed
   ;; by 'essential-services' (e.g., running shepherd) are guaranteed to co=
me
   ;; last.
-  (gexp->file "boot"
-              ;; Clean up and activate the system, then spawn shepherd.
-              #~(begin #$@(reverse gexps))))
+  (mlet %store-monad ((system (current-system))
+                      (target (current-target-system)))
+    (gexp->file "boot"
+                ;; Clean up and activate the system, then spawn shepherd.
+                #~(begin #$@(reverse gexps))
+                #:system system
+                #:target target)))
=20
 (define (boot-script-entry mboot)
   "Return, as a monadic value, an entry for the boot script in the system
--=20
2.24.1


--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#38612; Package guix-patches. Full text available.

Message received at 38612 <at> debbugs.gnu.org:


Received: (at 38612) by debbugs.gnu.org; 24 Dec 2019 14:11:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 24 09:11:23 2019
Received: from localhost ([127.0.0.1]:52027 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ijkuB-0005ci-Dq
	for submit <at> debbugs.gnu.org; Tue, 24 Dec 2019 09:11:23 -0500
Received: from mail-wr1-f45.google.com ([209.85.221.45]:43871)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1ijku9-0005cS-1y
 for 38612 <at> debbugs.gnu.org; Tue, 24 Dec 2019 09:11:22 -0500
Received: by mail-wr1-f45.google.com with SMTP id d16so19906689wre.10
 for <38612 <at> debbugs.gnu.org>; Tue, 24 Dec 2019 06:11:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=USzQ/t+4sro1ZsP/siaQu0Gk3JDSrXPHRe2sR4TykYM=;
 b=fTclHS/UmLQE3KQi+y7cSrZu0v1YfmZ62//z9AJuFSsnx8KuuaHgDfs4sPOhAVSu91
 T9uuT1hOB/bU/ApEx7M/YlCG9stXJMAsoWImzbbGkaRjE0WvIzfbCi87UFGqPJjmJtlh
 oWO4SLf6FlvuJ92suaFjbP+xD9WDl7eZnt/kfNrikwwpganDkhmg4LpB7FZ8U/MN2+Ol
 20mVFQ0Dw7HnBJlnQK9FRTxQYfHGn4ENlfmePmR18IkmOu19CBFZrDYzufg25fMgflV5
 sznqI5cbAKSmdrH1uJmxqLfGGqN7FXYvrAQG6WsgE6mVR/ubJOOah6r7yUOIo13yHgTA
 McFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=USzQ/t+4sro1ZsP/siaQu0Gk3JDSrXPHRe2sR4TykYM=;
 b=rHxaoHWgZ329gokIYK2R3NDLvPbSEkT55E47zrKIo944NnpIup71i3F86tRBt/1B+4
 UGZ7C30HysPsDIJcInYiGVRcfoV6vEKm8wU6d2M18shQ+c46IXGKuGS+jRQyobqSOr1V
 pcDkQLiviDgV3n3HOS9s8XuHbaK/SxqZOzsR/7I9mGWMeaRUNUtR22g5+weN744xqVOg
 s0APFgJPrvboULoh1f/w88zukJfej/T2mhTz1spmENEkAl9RHwNdV7xzHNWxudnwI/E+
 VGOQ5tiyocvbx7FV5E+895RwwLWy3kz4fUzG0DuMxGW0yDHLgHi4aLu90+n/UZqhNQuD
 jigg==
X-Gm-Message-State: APjAAAXw1ufS19CHa0LzkTJBDhJ2uz+gyIhR9UpljAVxhZs42LaXf3CJ
 xFso9BOba19Ml5zgZGcMOHtcEplc
X-Google-Smtp-Source: APXvYqxYH5NgPVIwUdDU/pFaWC5kxp26mO3kN92vkXmi5GElbUOe1eY3bY4PAnRkc4hDH5ObRiqB0A==
X-Received: by 2002:adf:d184:: with SMTP id v4mr35494347wrc.76.1577196675070; 
 Tue, 24 Dec 2019 06:11:15 -0800 (PST)
Received: from cervin ([2a01:cb18:832e:5f00:a14b:cea0:a27:c884])
 by smtp.gmail.com with ESMTPSA id y6sm23922324wrl.17.2019.12.24.06.11.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 24 Dec 2019 06:11:14 -0800 (PST)
References: <87a77ug6vv.fsf@HIDDEN> <8736dl8wxq.fsf@HIDDEN>
 <87d0cipt6z.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.3
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#38612] Pass system and target arguments to gexp->file.
In-reply-to: <87d0cipt6z.fsf@HIDDEN>
Date: Tue, 24 Dec 2019 15:11:08 +0100
Message-ID: <87r20t7r0j.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 38612
Cc: 38612 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


Hello,

> trick ensures that we get the system that current at the time of the
> monadic bind, whereas your change get the system and target that are
> current at the time of the call.
>
> It=E2=80=99s a terrible pitfall, I know=E2=80=A6

Ok, then, I used the same trick to read %current-target-system at bind
time. With this trick, target is set to the value passed to the guix
system command (it is #f otherwise).

WDYT?

Mathieu

--=-=-=
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: inline;
 filename=0001-profiles-Fix-profile-derivation-cross-compilation.patch
Content-Transfer-Encoding: quoted-printable

From c8b0e65d9b264bd484c7c6571c2ce3d68173b057 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@HIDDEN>
Date: Tue, 24 Dec 2019 15:04:57 +0100
Subject: [PATCH] profiles: Fix profile-derivation cross-compilation.

* guix/store.scm (current-target-system): New exported monadic procedure.
* guix/profiles.scm (profile-derivation): Set target at bind time using the
above procedure.
---
 guix/profiles.scm | 4 ++++
 guix/store.scm    | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index 987bab4e7f..d20f06e7b3 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -9,6 +9,7 @@
 ;;; Copyright =C2=A9 2017 Huang Ying <huang.ying.caritas@HIDDEN>
 ;;; Copyright =C2=A9 2017 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright =C2=A9 2019 Kyle Meyer <kyle@HIDDEN>
+;;; Copyright =C2=A9 2019 Mathieu Othacehe <m.othacehe@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1459,6 +1460,9 @@ are cross-built for TARGET."
   (mlet* %store-monad ((system (if system
                                    (return system)
                                    (current-system)))
+                       (target (if target
+                                   (return target)
+                                   (current-target-system)))
                        (ok?    (if allow-collisions?
                                    (return #t)
                                    (check-for-collisions manifest system
diff --git a/guix/store.scm b/guix/store.scm
index cf25d347fc..f99fa581a8 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovi=
c Court=C3=A8s <ludo@HIDDEN>
 ;;; Copyright =C2=A9 2018 Jan Nieuwenhuizen <janneke@HIDDEN>
+;;; Copyright =C2=A9 2019 Mathieu Othacehe <m.othacehe@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -159,6 +160,7 @@
             %guile-for-build
             current-system
             set-current-system
+            current-target-system
             text-file
             interned-file
             interned-file-tree
@@ -1816,6 +1818,11 @@ the store."
   (lambda (state)
     (values (%current-system system) state)))
=20
+(define-inlinable (current-target-system)
+  ;; Consult the %CURRENT-TARGET-SYSTEM fluid at bind time.
+  (lambda (state)
+    (values (%current-target-system) state)))
+
 (define %guile-for-build
   ;; The derivation of the Guile to be used within the build environment,
   ;; when using 'gexp->derivation' and co.
--=20
2.24.1


--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#38612; Package guix-patches. Full text available.

Message received at 38612 <at> debbugs.gnu.org:


Received: (at 38612) by debbugs.gnu.org; 24 Dec 2019 14:08:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 24 09:08:32 2019
Received: from localhost ([127.0.0.1]:52022 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ijkrQ-0005YK-0B
	for submit <at> debbugs.gnu.org; Tue, 24 Dec 2019 09:08:32 -0500
Received: from mail-wm1-f48.google.com ([209.85.128.48]:40942)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1ijkrO-0005Y7-JM
 for 38612 <at> debbugs.gnu.org; Tue, 24 Dec 2019 09:08:31 -0500
Received: by mail-wm1-f48.google.com with SMTP id t14so2584803wmi.5
 for <38612 <at> debbugs.gnu.org>; Tue, 24 Dec 2019 06:08:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=0SpjvUYKR6gHntLndch14dHbofxntZBC38z2GgMEbRo=;
 b=D5O+8B1X1GWE9OUFo0rXTQELJll0sQbmP04ktIZqvWPTdtgTlgRs1aEkYVr31RKj+J
 NXq+JlwA9EETUMIizWUzB4o7ZbXunG7gBp4XH31sfL5/YazM4kLDTIfTn7b77Pw8X9HJ
 fWSJyc2rP2d3G93IHSLA/H/ab8BDat3NTWXFadDCXtFULddlide4ybHC+op37fya+xiq
 ak+54iTty+NSX2n1o+Tr0YuGNDTo9WFtGlOTZaA1zqRgr1bLxKjLbkQDOniEGeuQEXCD
 SkvfC9YvxNpsxWEC9S39fZ9xhnIQ4rioCCyoy7cu5RLrbtkDOl943rMCQ4UmUDLwcbsW
 rOkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=0SpjvUYKR6gHntLndch14dHbofxntZBC38z2GgMEbRo=;
 b=Ro33HkxyoYCEWsb04LuQGlk51B7H2qpMDyVCDjrKppWjF9E6+A1Of7q7O/nO5iBGZ+
 GzEQ1PseLfhpaxnV5GRSE5k6GoV/dmkbwV3SyYRQdi6HgtLzFeNyOvGz/SAtlh40tkWW
 eVlpBeX9DpKNI02mjbKRxJkFUdCRhhl/iJmXjU4/KPB2JrE1WyEyeJ/iOjWLcQE+bPoj
 g+NJJxYh2FBINODZy5APaqo8tuCKEOVUwI5mzSqNelCdta4VRH0HQUvSVgYu2bPaym+9
 GYWMYcR/HerToc+eyXYiL/vTSR4YRGmma5AQpZlS9Vtg6GSWqCcLSg9adMKxanlwUwma
 g2Ew==
X-Gm-Message-State: APjAAAXLE6LFKFgK2mFzIXNg2ygnUGEOgK1+4LI2F37+5viOcn1fsRd6
 +sWQPyrAzBnQc/lXKnKRiKhFROpH
X-Google-Smtp-Source: APXvYqxXXyYSZBvPgk5+6tg7syA8rPEAB6ZAVmIPSnq2/sjvmXLCOgrAJHOX1pXHu8e9Vo9Tk2ndlw==
X-Received: by 2002:a1c:407:: with SMTP id 7mr4357202wme.29.1577196504495;
 Tue, 24 Dec 2019 06:08:24 -0800 (PST)
Received: from cervin ([2a01:cb18:832e:5f00:a14b:cea0:a27:c884])
 by smtp.gmail.com with ESMTPSA id v188sm2799896wma.10.2019.12.24.06.08.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 24 Dec 2019 06:08:23 -0800 (PST)
References: <87a77ug6vv.fsf@HIDDEN> <87h81uptdl.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.3
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#38612] Pass system and target arguments to gexp->file.
In-reply-to: <87h81uptdl.fsf@HIDDEN>
Date: Tue, 24 Dec 2019 15:08:21 +0100
Message-ID: <87sgl97r56.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 38612
Cc: 38612 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


> Good catch, LGTM!

Pushed, thanks!

Mathieu




Information forwarded to guix-patches@HIDDEN:
bug#38612; Package guix-patches. Full text available.

Message received at 38612 <at> debbugs.gnu.org:


Received: (at 38612) by debbugs.gnu.org; 20 Dec 2019 21:45:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 20 16:45:35 2019
Received: from localhost ([127.0.0.1]:47332 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iiQ5X-0000z1-Er
	for submit <at> debbugs.gnu.org; Fri, 20 Dec 2019 16:45:35 -0500
Received: from eggs.gnu.org ([209.51.188.92]:40648)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1iiQ5V-0000yo-RC
 for 38612 <at> debbugs.gnu.org; Fri, 20 Dec 2019 16:45:34 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44386)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1iiQ5Q-00083P-Km; Fri, 20 Dec 2019 16:45:28 -0500
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59802 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1iiQ5O-0007Co-KA; Fri, 20 Dec 2019 16:45:27 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Mathieu Othacehe <m.othacehe@HIDDEN>
Subject: Re: [bug#38612] Pass system and target arguments to gexp->file.
References: <87a77ug6vv.fsf@HIDDEN> <8736dl8wxq.fsf@HIDDEN>
Date: Fri, 20 Dec 2019 22:45:24 +0100
In-Reply-To: <8736dl8wxq.fsf@HIDDEN> (Mathieu Othacehe's message of "Sun,
 15 Dec 2019 15:50:41 +0100")
Message-ID: <87d0cipt6z.fsf@HIDDEN>
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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 38612
Cc: 38612 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Mathieu Othacehe <m.othacehe@HIDDEN> skribis:

> --- a/guix/profiles.scm
> +++ b/guix/profiles.scm
> @@ -1438,7 +1438,8 @@ MANIFEST."
>                               (locales? #t)
>                               (allow-collisions? #f)
>                               (relative-symlinks? #f)
> -                             system target)
> +                             (system (%current-system))
> +                             (target (%current-target-system)))
>    "Return a derivation that builds a profile (aka. 'user environment') w=
ith
>  the given MANIFEST.  The profile includes additional derivations returne=
d by
>  the monadic procedures listed in HOOKS--such as an Info 'dir' file, etc.

AFAICS this change is unnecessary and even incorrect: the

  (mlet* %store-monad ((system (if system
                                   (return system)
                                   (current-system)))

trick ensures that we get the system that current at the time of the
monadic bind, whereas your change get the system and target that are
current at the time of the call.

It=E2=80=99s a terrible pitfall, I know=E2=80=A6

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38612; Package guix-patches. Full text available.

Message received at 38612 <at> debbugs.gnu.org:


Received: (at 38612) by debbugs.gnu.org; 20 Dec 2019 21:41:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 20 16:41:37 2019
Received: from localhost ([127.0.0.1]:47328 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iiQ1g-0000t6-US
	for submit <at> debbugs.gnu.org; Fri, 20 Dec 2019 16:41:37 -0500
Received: from eggs.gnu.org ([209.51.188.92]:37872)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1iiQ1f-0000su-HZ
 for 38612 <at> debbugs.gnu.org; Fri, 20 Dec 2019 16:41:36 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44129)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1iiQ1a-00010u-4j; Fri, 20 Dec 2019 16:41:30 -0500
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59798 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1iiQ1Z-0006xW-OS; Fri, 20 Dec 2019 16:41:29 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Mathieu Othacehe <m.othacehe@HIDDEN>
Subject: Re: [bug#38612] Pass system and target arguments to gexp->file.
References: <87a77ug6vv.fsf@HIDDEN>
Date: Fri, 20 Dec 2019 22:41:26 +0100
In-Reply-To: <87a77ug6vv.fsf@HIDDEN> (Mathieu Othacehe's message of "Sat,
 14 Dec 2019 18:21:40 +0100")
Message-ID: <87h81uptdl.fsf@HIDDEN>
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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 38612
Cc: 38612 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Mathieu Othacehe <m.othacehe@HIDDEN> skribis:

>>From 67c3982503c4d9ab4c77b5df295957abbe60dfeb Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <m.othacehe@HIDDEN>
> Date: Sat, 14 Dec 2019 17:52:53 +0100
> Subject: [PATCH] gexp: Add system and target support to gexp->file.
>
> * guix/gexp.scm (gexp->file): Add system and target arguments and pass th=
em to
> gexp->derivation and load-path-expression calls,
> (scheme-file-compiler): adapt accordingly to pass system and target argum=
ents.

Good catch, LGTM!

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#38612; Package guix-patches. Full text available.

Message received at 38612 <at> debbugs.gnu.org:


Received: (at 38612) by debbugs.gnu.org; 15 Dec 2019 14:50:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 15 09:50:51 2019
Received: from localhost ([127.0.0.1]:36065 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1igVER-0002Qy-Fu
	for submit <at> debbugs.gnu.org; Sun, 15 Dec 2019 09:50:51 -0500
Received: from mail-wr1-f53.google.com ([209.85.221.53]:40107)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1igVEP-0002Qj-Q8
 for 38612 <at> debbugs.gnu.org; Sun, 15 Dec 2019 09:50:50 -0500
Received: by mail-wr1-f53.google.com with SMTP id c14so4117364wrn.7
 for <38612 <at> debbugs.gnu.org>; Sun, 15 Dec 2019 06:50:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:subject:in-reply-to:date:message-id
 :mime-version; bh=Ay9jY6j1gjclwgVGdGTQPgzIh1DxXTFImcJMZSi+664=;
 b=DmidmqCGIJSC8nWPJsLoooK7TWVP21EdDmwclpMsImI8obSxhtXJLbR4K3Bh9ReyBs
 57zjlLiJ4BwyQitv/IN77QBt3yh/U6l6alhH6zjfb2PrBtcU3W9NOkcyQsg9MnKfWezQ
 WNKqqN4VIo2vYRn24o6fbfbHooHjQ2RwrZ0y+Yqkwa4OtR4G4o/4v2AOg9NxC06iLdVV
 OWFDdDU4wXLud8t4jHSBEJYdP7qRFY2J54q5M1xPJNBE3KVB7ktX5y7GEyLpfiB7QpyM
 qAo4cz1oO4E657SVTMAnpn+UpdztYgGAsaKFvgrW9XlYx6DoxCgKbWd+6NPB83fSaelr
 hJQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:subject
 :in-reply-to:date:message-id:mime-version;
 bh=Ay9jY6j1gjclwgVGdGTQPgzIh1DxXTFImcJMZSi+664=;
 b=n14+O/hxDceQ+DWv0gLHXcYsoLXbRfgVfSAVmcIqLqmgb++w5XWV+kMQ9yR4CZknHZ
 aYJnBZJSAzBkFG7XOOjQikyaLXbDvP1oAWcQ1bOEQ0YzJBVX3Bo0aqCR+Ogrcdlj6ga5
 qOm1Gqj6OHrvCLWleyj/EjhiWZoPUt0+KEdRX58iC64abq0bHUM0Qm/TiewhV0GRFtF2
 XhCmCC6DFyGBDbz/OQihR1pK9NIh7eOqwFX3XMOADCAvF5TIGdEHBtj+7vhwNP1yqDm5
 t/XHQCpG+UYgse++hpKHH7h+95gr856qezjjjGI8dz/G4zJHxfukcPrfTgIwRWFWSiiJ
 EGQg==
X-Gm-Message-State: APjAAAUAuUGAKwEygT2PFvwOVSgqdUTreMmpEn34AAKkWPOkSsZ8yNMq
 lni/YuffvXfsbyh0SWSKjhCVRIVn
X-Google-Smtp-Source: APXvYqw0tsxx669FQqQX+s3oCWyhbQG7ObDwh/wJLjjOefkPGOeR3Hm7LvMnfdJrJzlTGIoS7sIrHw==
X-Received: by 2002:a5d:6703:: with SMTP id o3mr26336094wru.235.1576421443914; 
 Sun, 15 Dec 2019 06:50:43 -0800 (PST)
Received: from cervin ([2a01:e0a:fa:a50:7432:4a59:232e:bf96])
 by smtp.gmail.com with ESMTPSA id c15sm17453784wrt.1.2019.12.15.06.50.42
 for <38612 <at> debbugs.gnu.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 15 Dec 2019 06:50:42 -0800 (PST)
References: <87a77ug6vv.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.3
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: 38612 <at> debbugs.gnu.org
Subject: Re: Pass system and target arguments to gexp->file.
In-reply-to: <87a77ug6vv.fsf@HIDDEN>
Date: Sun, 15 Dec 2019 15:50:41 +0100
Message-ID: <8736dl8wxq.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 38612
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain


In the same spirit, here's another patch to fix profile-derivation.

Mathieu

--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-profile-derivation-Use-current-system-and-target.patch

From 964f14a8bbd420f0f9207f1a666badaaaf625e3e Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@HIDDEN>
Date: Sat, 14 Dec 2019 18:39:59 +0100
Subject: [PATCH] profile-derivation: Use current system and target.

* guix/profiles.scm (profile-derivation): Use current system and target.
---
 guix/profiles.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index 616605151e..a328e40687 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1438,7 +1438,8 @@ MANIFEST."
                              (locales? #t)
                              (allow-collisions? #f)
                              (relative-symlinks? #f)
-                             system target)
+                             (system (%current-system))
+                             (target (%current-target-system)))
   "Return a derivation that builds a profile (aka. 'user environment') with
 the given MANIFEST.  The profile includes additional derivations returned by
 the monadic procedures listed in HOOKS--such as an Info 'dir' file, etc.
-- 
2.24.0


--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#38612; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Dec 2019 21:01:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 14 16:01:21 2019
Received: from localhost ([127.0.0.1]:35810 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1igEXR-0002YU-6c
	for submit <at> debbugs.gnu.org; Sat, 14 Dec 2019 16:01:21 -0500
Received: from lists.gnu.org ([209.51.188.17]:58488)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1igEXP-0002YM-C4
 for submit <at> debbugs.gnu.org; Sat, 14 Dec 2019 16:01:20 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:49892)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <m.othacehe@HIDDEN>) id 1igEXN-0001lz-MK
 for guix-patches@HIDDEN; Sat, 14 Dec 2019 16:01:18 -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,FREEMAIL_FROM,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <m.othacehe@HIDDEN>) id 1igEXM-0005Ic-Cw
 for guix-patches@HIDDEN; Sat, 14 Dec 2019 16:01:17 -0500
Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:51362)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <m.othacehe@HIDDEN>)
 id 1igEXM-0005ES-2F
 for guix-patches@HIDDEN; Sat, 14 Dec 2019 16:01:16 -0500
Received: by mail-wm1-x330.google.com with SMTP id d73so2491173wmd.1
 for <guix-patches@HIDDEN>; Sat, 14 Dec 2019 13:01:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=user-agent:from:to:subject:date:message-id:mime-version;
 bh=DaMSgNhyBN4dlpRJ0HnYuGqPqNXcIMlYOy9XGqybzlA=;
 b=pNFxh4dZ9nXBCbrkvWBEHoCCssEGn7L+xGGqAM2Y/rsfWkZCFz57xZwsq7h53pNfXm
 3rvI0MvWDVdSMvStbuprvuoJRY4aqz9Ru96tvpDnA9kiEiWMqtVzPry/IM2SDbDwTg+g
 zrI4rnJnYN8VArF6q4oRqUElp8yEilH8YzZ89LfGJAjBDAhiePzuvEI/aIrKL611D4cy
 H+TGLPnta93HId8mafZARKYtTaH1vLOssiSr/tGw9o4xJ/GHH7hFks804Q9UKWC0enfH
 rfOlLHaauJJxXdFNyKBhlq0M5F1MPZg8swIDhG0hyZGXQXWPPDNvR7h6ylvczNfKoYKe
 aViA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:user-agent:from:to:subject:date:message-id
 :mime-version;
 bh=DaMSgNhyBN4dlpRJ0HnYuGqPqNXcIMlYOy9XGqybzlA=;
 b=C3tw01nuK1z1HSIzMRNpDVmuq2gkZ4uJXWIusuT3nQvGoiZKQpJWwuG04//sObXgJZ
 mKcEuvLnFuw8k1+mSvd6jaL3g5la2/nYlXlK/F/ICldUPGiU1Hm3p/V3Jz3R6W29pCYf
 Y5g13ZNF+3SsLXynaUPW6EL2fTc5VAwe7746w3Wh0b6UWz45ZSMRUyrhwpJyFbk7jIfY
 FpltLwmqHQt9V1c8i7d7YJf388RTuTtzEBENKtMEeMgy2OqZ0X0q0hg1UGA0aXDmHnt7
 U5XBMJpA/qIHWURiiai3J8/cTkqokjRRD1Ft2+rVHNJDcmV4BaU5rYn/64SJaszZdGg/
 Be3w==
X-Gm-Message-State: APjAAAVr5Ep6DoWH1K3F1iuvoR412JzHxYh/g6bV+euw3kE/d6X9ED2r
 Z7i6Kc+YDhgKFKG1jfMHCRRAfEFk
X-Google-Smtp-Source: APXvYqznC312jfKoXLoG8kSeYBaO+gZfGDqtPaTtSr4RCdZy0Jq/OhbgyIQmXHGOnhnuRkfi75wQ/w==
X-Received: by 2002:a05:600c:2c44:: with SMTP id
 r4mr19760852wmg.140.1576344102974; 
 Sat, 14 Dec 2019 09:21:42 -0800 (PST)
Received: from cervin ([2a01:e0a:fa:a50:7432:4a59:232e:bf96])
 by smtp.gmail.com with ESMTPSA id r5sm14086937wrt.43.2019.12.14.09.21.41
 for <guix-patches@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 14 Dec 2019 09:21:41 -0800 (PST)
User-agent: mu4e 1.2.0; emacs 26.3
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: guix-patches@HIDDEN
Subject: Pass system and target arguments to gexp->file.
Date: Sat, 14 Dec 2019 18:21:40 +0100
Message-ID: <87a77ug6vv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2a00:1450:4864:20::330
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain


Hello,

The attached patch fixes issues encountered when cross-compiling a
system.  gexps passed to gexp->file were not honoring target argument.

Mathieu

--=-=-=
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: inline;
 filename=0001-gexp-Add-system-and-target-support-to-gexp-file.patch
Content-Transfer-Encoding: quoted-printable

From 67c3982503c4d9ab4c77b5df295957abbe60dfeb Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@HIDDEN>
Date: Sat, 14 Dec 2019 17:52:53 +0100
Subject: [PATCH] gexp: Add system and target support to gexp->file.

* guix/gexp.scm (gexp->file): Add system and target arguments and pass them=
 to
gexp->derivation and load-path-expression calls,
(scheme-file-compiler): adapt accordingly to pass system and target argumen=
ts.
---
 guix/gexp.scm | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/guix/gexp.scm b/guix/gexp.scm
index a96592ac76..ca436b5a66 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -2,6 +2,7 @@
 ;;; Copyright =C2=A9 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Court=C3=
=A8s <ludo@HIDDEN>
 ;;; Copyright =C2=A9 2018 Cl=C3=A9ment Lassieur <clement@HIDDEN>
 ;;; Copyright =C2=A9 2018 Jan Nieuwenhuizen <janneke@HIDDEN>
+;;; Copyright =C2=A9 2019 Mathieu Othacehe <m.othacehe@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -456,7 +457,10 @@ This is the declarative counterpart of 'gexp->file'."
   ;; Compile FILE by returning a derivation that builds the file.
   (match file
     (($ <scheme-file> name gexp splice?)
-     (gexp->file name gexp #:splice? splice?))))
+     (gexp->file name gexp
+                 #:splice? splice?
+                 #:system system
+                 #:target target))))
=20
 ;; Appending SUFFIX to BASE's output file name.
 (define-record-type <file-append>
@@ -1603,7 +1607,9 @@ imported modules in its search path.  Look up EXP's m=
odules in MODULE-PATH."
 (define* (gexp->file name exp #:key
                      (set-load-path? #t)
                      (module-path %load-path)
-                     (splice? #f))
+                     (splice? #f)
+                     (system (%current-system))
+                     target)
   "Return a derivation that builds a file NAME containing EXP.  When SPLIC=
E?
 is true, EXP is considered to be a list of expressions that will be splice=
d in
 the resulting file.
@@ -1626,10 +1632,14 @@ Lookup EXP's modules in MODULE-PATH."
                                                     exp
                                                     (gexp ((ungexp exp))))=
)))))
                         #:local-build? #t
-                        #:substitutable? #f)
+                        #:substitutable? #f
+                        #:system system
+                        #:target target)
       (mlet %store-monad ((set-load-path
                            (load-path-expression modules module-path
-                                                 #:extensions extensions)))
+                                                 #:extensions extensions
+                                                 #:system system
+                                                 #:target target)))
         (gexp->derivation name
                           (gexp
                            (call-with-output-file (ungexp output)
@@ -1642,7 +1652,9 @@ Lookup EXP's modules in MODULE-PATH."
                                                       (gexp ((ungexp exp))=
)))))))
                           #:module-path module-path
                           #:local-build? #t
-                          #:substitutable? #f))))
+                          #:substitutable? #f
+                          #:system system
+                          #:target target))))
=20
 (define* (text-file* name #:rest text)
   "Return as a monadic value a derivation that builds a text file containi=
ng
--=20
2.24.0


--=-=-=--




Acknowledgement sent to Mathieu Othacehe <m.othacehe@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#38612; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 26 Dec 2019 19:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.