You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GOARCH=arm go run github.com/gokrazy/tools/cmd/gokr-packer
github.com/gokrazy/hello
Since GOARCH will be used by go run, the resulting gokr-packer executable will not run on and amd64 machine for instance.
I would like to be able to use go run github.com/gokrazy/tools/cmd/gokr-packer, so that the gokr-packer version can be managed by go.mod using a tools.go file:
Currently build variables like GOARM, GOOS and GOARCH are simply forwarded from the current environment with some default values:
tools/cmd/gokr-packer/gotool.go
Lines 15 to 28 in 7f0229b
However this does not play well with
go run
:Since
GOARCH
will be used bygo run
, the resultinggokr-packer
executable will not run on and amd64 machine for instance.I would like to be able to use
go run github.com/gokrazy/tools/cmd/gokr-packer
, so that thegokr-packer
version can be managed bygo.mod
using atools.go
file:Here are the possible solutions to this problem, that I thought of:
GOKR_GOARCH= go run ...
for instance (which would override `GOARCH)go run .../gokr-packer -buildenv=env
withenv
being a file like:What do you think would be the most elegant way to fix this issue ?
I can then try to craft a PR.
The text was updated successfully, but these errors were encountered: