From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:41463) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igGke-0000SW-Es for guix-patches@gnu.org; Sat, 14 Dec 2019 18:23:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igGkc-0002Zj-LO for guix-patches@gnu.org; Sat, 14 Dec 2019 18:23:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igGkc-0002Ot-D2 for guix-patches@gnu.org; Sat, 14 Dec 2019 18:23:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1igEY5-0002ZY-Uj for guix-patches@gnu.org; Sat, 14 Dec 2019 16:02:01 -0500 Subject: [bug#38612] Pass system and target arguments to gexp->file. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:49892) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEXN-0001lz-MK for guix-patches@gnu.org; Sat, 14 Dec 2019 16:01:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igEXM-0005Ic-Cw for guix-patches@gnu.org; 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 ) id 1igEXM-0005ES-2F for guix-patches@gnu.org; Sat, 14 Dec 2019 16:01:16 -0500 Received: by mail-wm1-x330.google.com with SMTP id d73so2491173wmd.1 for ; Sat, 14 Dec 2019 13:01:15 -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 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Dec 2019 09:21:41 -0800 (PST) From: Mathieu Othacehe Date: Sat, 14 Dec 2019 18:21:40 +0100 Message-ID: <87a77ug6vv.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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: 38612@debbugs.gnu.org --=-=-= 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 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 ;;; Copyright =C2=A9 2018 Cl=C3=A9ment Lassieur ;;; Copyright =C2=A9 2018 Jan Nieuwenhuizen +;;; Copyright =C2=A9 2019 Mathieu Othacehe ;;; ;;; 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 (($ 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 @@ -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 --=-=-=--