Closed twpayne closed 4 years ago
https://github.com/gokrazy/gokrazy/issues/14 is related
As per http://stackoverflow.com/a/25950604/712014, why are you setting GOBIN in the first place? Binaries should be installed to $GOPATH/bin by default anyway? :)
As per https://groups.google.com/g/golang-nuts/c/nyS0ESkKTlk, using go install
with GOBIN
when cross-compiling is intentionally unsupported.
It is desirable to not litter the user’s GOBIN
(or GOPATH/bin
etc.) when using gokrazy, so we should switch from go install
to go build
indeed.
This issue might be related to trying to use gokrazy from macOS. For sure, building gokrazy images on non-Linux systems is not yet supported and this is likely one issue that will need to fixed to enable that.
On my macOS system, I have:
When I run
I get the error:
I suspect that this is related to the use of
go install
atgotool.go:71
. I suspect that the cross-compiled binaries should be built withgo build
but rather than installing them, the built binaries should be copied from their output location (wherever that is) to their final location.go build
has an-o
option to specify the path of the output binary, but this obviously only works when building one binary at a time and is incompatible with gokrazy's use of./...
to build all binaries in a tree.