diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm index 4c1a732107..757e63afe9 100644 --- a/guix/build-system/go.scm +++ b/guix/build-system/go.scm @@ -163,8 +163,8 @@ (define* (go-build store name inputs (tests? #t) (allow-go-reference? #f) (system (%current-system)) - (goarch (first (go-target (%current-system)))) - (goos (last (go-target (%current-system)))) + (goarch #f) + (goos #f) (guile #f) (imported-modules %go-build-system-modules) (modules '((guix build go-build-system) diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index 645d2fe680..4768ee8562 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -152,8 +152,10 @@ (define* (setup-go-environment #:key inputs outputs goos goarch #:allow-other-ke ;; Make sure we're building for the correct architecture and OS targets ;; that Guix targets. - (setenv "GOARCH" goarch) - (setenv "GOOS" goos) + (setenv "GOARCH" (or goarch + (getenv "GOHOSTARCH"))) + (setenv "GOOS" (or goos + (getenv "GOHOSTOS"))) (match goarch ("arm" (setenv "GOARM" "7"))