build-system/go: Respect #:imported-modules when cross-compiling.
Previously, #:imported-modules was ignored, causing cross-compilation
failures. This bug seems seems to have been introduced in
e37dcf63dc
.
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]: Wrap in
with-imported-modules.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
1cf39c41cf
commit
9e4d8c7518
1 changed files with 34 additions and 33 deletions
|
@ -240,45 +240,46 @@ commit hash and its date rather than a proper release tag."
|
||||||
(substitutable? #t))
|
(substitutable? #t))
|
||||||
"Cross-build NAME using GO, where TARGET is a GNU triplet and with INPUTS."
|
"Cross-build NAME using GO, where TARGET is a GNU triplet and with INPUTS."
|
||||||
(define builder
|
(define builder
|
||||||
#~(begin
|
(with-imported-modules imported-modules
|
||||||
(use-modules #$@(sexp->gexp modules))
|
#~(begin
|
||||||
|
(use-modules #$@(sexp->gexp modules))
|
||||||
|
|
||||||
(define %build-host-inputs
|
(define %build-host-inputs
|
||||||
#+(input-tuples->gexp build-inputs))
|
#+(input-tuples->gexp build-inputs))
|
||||||
|
|
||||||
(define %build-target-inputs
|
(define %build-target-inputs
|
||||||
(append #$(input-tuples->gexp host-inputs)
|
(append #$(input-tuples->gexp host-inputs)
|
||||||
#+(input-tuples->gexp target-inputs)))
|
#+(input-tuples->gexp target-inputs)))
|
||||||
|
|
||||||
(define %build-inputs
|
(define %build-inputs
|
||||||
(append %build-host-inputs %build-target-inputs))
|
(append %build-host-inputs %build-target-inputs))
|
||||||
|
|
||||||
(define %outputs
|
(define %outputs
|
||||||
#$(outputs->gexp outputs))
|
#$(outputs->gexp outputs))
|
||||||
|
|
||||||
(go-build #:name #$name
|
(go-build #:name #$name
|
||||||
#:source #+source
|
#:source #+source
|
||||||
#:system #$system
|
#:system #$system
|
||||||
#:phases #$phases
|
#:phases #$phases
|
||||||
#:outputs %outputs
|
#:outputs %outputs
|
||||||
#:target #$target
|
#:target #$target
|
||||||
#:goarch #$goarch
|
#:goarch #$goarch
|
||||||
#:goos #$goos
|
#:goos #$goos
|
||||||
#:inputs %build-target-inputs
|
#:inputs %build-target-inputs
|
||||||
#:native-inputs %build-host-inputs
|
#:native-inputs %build-host-inputs
|
||||||
#:search-paths '#$(map search-path-specification->sexp
|
#:search-paths '#$(map search-path-specification->sexp
|
||||||
search-paths)
|
search-paths)
|
||||||
#:native-search-paths '#$(map
|
#:native-search-paths '#$(map
|
||||||
search-path-specification->sexp
|
search-path-specification->sexp
|
||||||
native-search-paths)
|
native-search-paths)
|
||||||
#:install-source? #$install-source?
|
#:install-source? #$install-source?
|
||||||
#:import-path #$import-path
|
#:import-path #$import-path
|
||||||
#:unpack-path #$unpack-path
|
#:unpack-path #$unpack-path
|
||||||
#:build-flags #$build-flags
|
#:build-flags #$build-flags
|
||||||
#:tests? #$tests?
|
#:tests? #$tests?
|
||||||
#:make-dynamic-linker-cache? #f ;cross-compiling
|
#:make-dynamic-linker-cache? #f ;cross-compiling
|
||||||
#:allow-go-reference? #$allow-go-reference?
|
#:allow-go-reference? #$allow-go-reference?
|
||||||
#:inputs %build-inputs)))
|
#:inputs %build-inputs))))
|
||||||
|
|
||||||
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
|
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
|
||||||
system #:graft? #f)))
|
system #:graft? #f)))
|
||||||
|
|
Reference in a new issue