unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#51981] (no subject)
@ 2021-11-19 19:59 Collin J. Doering
  2021-11-19 20:37 ` [bug#51981] [PATCH 1/1] build: Fix cross compilation for go-build-system Collin J. Doering
  2022-05-14  7:23 ` [bug#51981] [PATCH 0/1] Fix cross-compilation of packages that use go-build-system Maxime Devos
  0 siblings, 2 replies; 3+ messages in thread
From: Collin J. Doering @ 2021-11-19 19:59 UTC (permalink / raw)
  To: 51981

Hi all,

This patch resolves an issue I discovered when attempting to cross-compile packages that use the go-build-system.

Namely, prior to this patch, running 'guix build --target=arm-unknown-linux-gnueabihf <go-package>' where '<go-package>' is some package that uses to go-build-system (for example, 'fzf'), would result in the following error in the build log:

--8<---------------cut here---------------start------------->8---
go install: cannot install cross-compiled binaries when GOBIN is set
Building 'github.com/junegunn/fzf' failed.
Here are the results of `go env`:
GO111MODULE="off"
GOARCH="arm"
GOBIN="/gnu/store/8xcs9vna6zyl814j78raynccm7mqqk0h-fzf-0.25.0/bin"
GOCACHE="/tmp/go-cache"
GOENV="/homeless-shelter/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/tmp/guix-build-fzf-0.25.0.drv-0"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/gnu/store/y5rwacd5l4q26pxis28wsmswj2603hkw-go-1.14.15"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/gnu/store/y5rwacd5l4q26pxis28wsmswj2603hkw-go-1.14.15/pkg/tool/linux_amd64"
GCCGO="gccgo"
GOARM="7"
AR="ar"
CC="/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/bin/gcc"
CXX="g++"
CGO_ENABLED="0"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -marm -fmessage-length=0 -fdebug-prefix-map=/tmp/guix-build-fzf-0.25.0.drv-0/go-build219362912=/tmp/go-build -gno-record-gcc-switches"
command "go" "install" "-v" "-x" "-ldflags=-s -w" "github.com/junegunn/fzf" failed with status 1
--8<---------------cut here---------------end--------------->8---

The important bit is the first line, which indicates that 'GOBIN' cannot be set when cross-compiling. This has been the case in go from what I can tell for numerous years (atleast 2019).

This patch removes the setting of 'GOBIN' and adjusts the go-build-systems build function to us 'go build' instead of 'go install'.

Collin J. Doering (1):
  build: Fix cross compilation for go-build-system

 guix/build/go-build-system.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

-- 
2.33.1

-- 
Collin J. Doering

http://rekahsoft.ca
http://blog.rekahsoft.ca
http://git.rekahsoft.ca




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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19 19:59 [bug#51981] (no subject) Collin J. Doering
2021-11-19 20:37 ` [bug#51981] [PATCH 1/1] build: Fix cross compilation for go-build-system Collin J. Doering
2022-05-14  7:23 ` [bug#51981] [PATCH 0/1] Fix cross-compilation of packages that use go-build-system Maxime Devos

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