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

Previous Next

Package: guix-patches;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Tue, 13 Sep 2022 11:02:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57766 in the body.
You can then email your comments to 57766 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#57766; Package guix-patches. (Tue, 13 Sep 2022 11:02:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxime Devos <maximedevos <at> telenet.be>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 13 Sep 2022 11:02:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: guix-patches <at> gnu.org
Cc: Maxime Devos <maximedevos <at> telenet.be>
Subject: [PATCH] build-system: go: Respect #:imported-modules when
 cross-compiling.
Date: Tue, 13 Sep 2022 13:01:05 +0200
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





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sat, 24 Sep 2022 14:18:02 GMT) Full text and rfc822 format available.

Notification sent to Maxime Devos <maximedevos <at> telenet.be>:
bug acknowledged by developer. (Sat, 24 Sep 2022 14:18:02 GMT) Full text and rfc822 format available.

Message #10 received at 57766-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 57766-done <at> debbugs.gnu.org
Subject: Re: bug#57766: [PATCH] build-system: go: Respect #:imported-modules
 when cross-compiling.
Date: Sat, 24 Sep 2022 16:17:25 +0200
Hi,

Maxime Devos <maximedevos <at> telenet.be> skribis:

> 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.

Good catch!  Applied, thanks.

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 23 Oct 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 178 days ago.

Previous Next


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