unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#57766] [PATCH] build-system: go: Respect #:imported-modules when cross-compiling.
@ 2022-09-13 11:01 Maxime Devos
  2022-09-24 14:17 ` bug#57766: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Maxime Devos @ 2022-09-13 11:01 UTC (permalink / raw)
  To: 57766; +Cc: Maxime Devos

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





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#57766: [PATCH] build-system: go: Respect #:imported-modules when cross-compiling.
  2022-09-13 11:01 [bug#57766] [PATCH] build-system: go: Respect #:imported-modules when cross-compiling Maxime Devos
@ 2022-09-24 14:17 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2022-09-24 14:17 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 57766-done

Hi,

Maxime Devos <maximedevos@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’.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-24 14:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 11:01 [bug#57766] [PATCH] build-system: go: Respect #:imported-modules when cross-compiling Maxime Devos
2022-09-24 14:17 ` bug#57766: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).