File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ GOPATH ?= $(shell go env GOPATH)
1414GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin
1515GO ?= $(shell which go)
1616
17+ # Ensure bingo-managed tools are always built for the host platform,
18+ # even when GOOS/GOARCH are set for cross-compilation of other targets.
19+ GOHOSTOS ?= $(shell $(GO) env GOHOSTOS)
20+ GOHOSTARCH ?= $(shell $(GO) env GOHOSTARCH)
21+ GOHOSTARM ?= $(shell $(GO) env GOHOSTARM)
22+
1723# Below generated variables ensure that every time a tool under each variable is invoked, the correct version
1824# will be used; reinstalling only if needed.
1925# For example for {{ with (index .MainPackages 0) }}{{ .Name }}{{ end }} variable:
@@ -32,7 +38,7 @@ $({{ $p.EnvVarName }}):{{- range $p.Versions }} $(BINGO_DIR)/{{ .ModFile }}{{- e
3238 @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
3339{{- range $p.Versions }}
3440 @echo "(re)installing $(GOBIN)/{{ $p.Name }}-{{ .Version }}"
35- @cd $(BINGO_DIR) && GOWORK=off {{ range $p.BuildEnvVars }}{{ . }} {{ end }}$(GO) build {{ range $p.BuildFlags }}{{ . }} {{ end }}-mod=mod -modfile={{ .ModFile }} -o=$(GOBIN)/{{ $p.Name }}-{{ .Version }} "{{ $p.PackagePath }}"
41+ @cd $(BINGO_DIR) && GOWORK=off GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) GOARM=$(GOHOSTARM) {{ range $p.BuildEnvVars }}{{ . }} {{ end }}$(GO) build {{ range $p.BuildFlags }}{{ . }} {{ end }}-mod=mod -modfile={{ .ModFile }} -o=$(GOBIN)/{{ $p.Name }}-{{ .Version }} "{{ $p.PackagePath }}"
3642{{- end }}
3743{{ end}}
3844` ,
You can’t perform that action at this time.
0 commit comments