GNU bug report logs - #57766
[PATCH] build-system: go: Respect #:imported-modules when cross-compiling.

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: Maxime Devos <maximedevos@HIDDEN>; Keywords: patch; dated Tue, 13 Sep 2022 11:02:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

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


Received: (at submit) by debbugs.gnu.org; 13 Sep 2022 11:01:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 13 07:01:24 2022
Received: from localhost ([127.0.0.1]:48996 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oY3fQ-00088z-Fv
	for submit <at> debbugs.gnu.org; Tue, 13 Sep 2022 07:01:24 -0400
Received: from lists.gnu.org ([209.51.188.17]:35772)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1oY3fL-00088n-5S
 for submit <at> debbugs.gnu.org; Tue, 13 Sep 2022 07:01:23 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:36996)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <maximedevos@HIDDEN>)
 id 1oY3fK-0007YH-Ew
 for guix-patches@HIDDEN; Tue, 13 Sep 2022 07:01:18 -0400
Received: from albert.telenet-ops.be ([2a02:1800:110:4::f00:1a]:58500)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <maximedevos@HIDDEN>)
 id 1oY3fI-0002Zu-0q
 for guix-patches@HIDDEN; Tue, 13 Sep 2022 07:01:18 -0400
Received: from localhost.localdomain ([188.188.237.141])
 by albert.telenet-ops.be with bizsmtp
 id KP172800R33jvW406P19Yh; Tue, 13 Sep 2022 13:01:10 +0200
From: Maxime Devos <maximedevos@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] build-system: go: Respect #:imported-modules when
 cross-compiling.
Date: Tue, 13 Sep 2022 13:01:05 +0200
Message-Id: <20220913110105.10443-1-maximedevos@HIDDEN>
X-Mailer: git-send-email 2.37.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1663066870; bh=G3GJJuYdzc0c5BMqPBL8gMYIs2zJ4HVbNMhkAQmSQ9E=;
 h=From:To:Cc:Subject:Date;
 b=i4iutcy3u8JdGPcarYxDLarGTT4KTD5MLRWJpH83puFCxRUM86sc7wDrnvZSc5+xC
 FfNxNUx6QYTCDXQ6GiYQFMqqHJUOgeQr6epgZOa0QICjZ23MP0uoRK1i/7QjOfrb0E
 TM5lIAEPaTJGJ5qoz2D72khmo5D88twKD0v5GifJbuWXvtLBOvAcuAiWn8mEhEVL76
 nbrZlwOCrHQbkUj6Czb09hZb3Cpo2MqNB3VvZyFjcWy1cUJD9t1eBm5EoOrkkxwmiE
 cObpZTXnfUYeb+qb+9pVlX17JXCsQDcBPi6AB8juAJi+OZVZiBecixkS7hEGZ+rKsY
 mCkX2SC0AKQUg==
Received-SPF: pass client-ip=2a02:1800:110:4::f00:1a;
 envelope-from=maximedevos@HIDDEN; helo=albert.telenet-ops.be
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: submit
Cc: Maxime Devos <maximedevos@HIDDEN>
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 (--)

Previously, #:imported-modules was ignored, causing cross-compilation
failures.  This bug seems seems to have been introduced in
e37dcf63dcea0817ffd74722ee5ff2d103aa2157.

After this commit, there remain other cross-compilation problems,
e.g. <https://issues.guix.gnu.org/51981> fixes one of them.

* guix/build-system/go.scm (go-cross-build)[builder]: Wrapp in
with-imported-modules.
---
 guix/build-system/go.scm | 67 ++++++++++++++++++++--------------------
 1 file changed, 34 insertions(+), 33 deletions(-)

diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index 5e0e5bbad3..4b3b67b08f 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -240,45 +240,46 @@ (define* (go-cross-build name
                          (substitutable? #t))
   "Cross-build NAME using GO, where TARGET is a GNU triplet and with INPUTS."
   (define builder
-    #~(begin
-        (use-modules #$@(sexp->gexp modules))
+    (with-imported-modules imported-modules
+      #~(begin
+          (use-modules #$@(sexp->gexp modules))
 
-        (define %build-host-inputs
-          #+(input-tuples->gexp build-inputs))
+          (define %build-host-inputs
+            #+(input-tuples->gexp build-inputs))
 
-        (define %build-target-inputs
-          (append #$(input-tuples->gexp host-inputs)
+          (define %build-target-inputs
+            (append #$(input-tuples->gexp host-inputs)
               #+(input-tuples->gexp target-inputs)))
 
-        (define %build-inputs
-          (append %build-host-inputs %build-target-inputs))
+          (define %build-inputs
+            (append %build-host-inputs %build-target-inputs))
 
-        (define %outputs
-          #$(outputs->gexp outputs))
+          (define %outputs
+            #$(outputs->gexp outputs))
 
-        (go-build #:name #$name
-                  #:source #+source
-                  #:system #$system
-                  #:phases #$phases
-                  #:outputs %outputs
-                  #:target #$target
-                  #:goarch #$goarch
-                  #:goos #$goos
-                  #:inputs %build-target-inputs
-                  #:native-inputs %build-host-inputs
-                  #:search-paths '#$(map search-path-specification->sexp
-                                         search-paths)
-                  #:native-search-paths '#$(map
-                                            search-path-specification->sexp
-                                            native-search-paths)
-                  #:install-source? #$install-source?
-                  #:import-path #$import-path
-                  #:unpack-path #$unpack-path
-                  #:build-flags #$build-flags
-                  #:tests? #$tests?
-                  #:make-dynamic-linker-cache? #f ;cross-compiling
-                  #:allow-go-reference? #$allow-go-reference?
-                  #:inputs %build-inputs)))
+          (go-build #:name #$name
+                    #:source #+source
+                    #:system #$system
+                    #:phases #$phases
+                    #:outputs %outputs
+                    #:target #$target
+                    #:goarch #$goarch
+                    #:goos #$goos
+                    #:inputs %build-target-inputs
+                    #:native-inputs %build-host-inputs
+                    #:search-paths '#$(map search-path-specification->sexp
+                                           search-paths)
+                    #:native-search-paths '#$(map
+                                              search-path-specification->sexp
+                                              native-search-paths)
+                    #:install-source? #$install-source?
+                    #:import-path #$import-path
+                    #:unpack-path #$unpack-path
+                    #:build-flags #$build-flags
+                    #:tests? #$tests?
+                    #:make-dynamic-linker-cache? #f ;cross-compiling
+                    #:allow-go-reference? #$allow-go-reference?
+                    #:inputs %build-inputs))))
 
   (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
                                                   system #:graft? #f)))

base-commit: a44e08337d15b3f254a35d0311663c2bbd501852
prerequisite-patch-id: 0caac311875ee39cb48573657ebb960e90da6dfb
prerequisite-patch-id: 418285493d89ebf102175902d9b09a0174e88190
prerequisite-patch-id: 3c39eb839d9d3ff3fca6cd98621a5d5c411b7af4
prerequisite-patch-id: 8d5662e874c469f5ee496ef5181cf2d0a30ad1d8
prerequisite-patch-id: 26513c3b3b86963df718ee41d14a25d1cc6a8f3f
prerequisite-patch-id: 2b2497e2edec0afc48ebadd6f09f0c661c466127
prerequisite-patch-id: 2712efb97bf33985fd0658e4dd8e936dc08be5fe
prerequisite-patch-id: 9d2409b480a8bff0fef029b4b095922d4957e06f
prerequisite-patch-id: 51a32abca3efec1ba67ead59b8694c5ea3129ad3
prerequisite-patch-id: 7d55e3b39eb8803f058857d4412796b3f5dc0856
-- 
2.37.3





Acknowledgement sent to Maxime Devos <maximedevos@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#57766; 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: Tue, 13 Sep 2022 11:15:02 UTC

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