fix: use override GOFLAGS changes from 480defab689610550ee3d346e31441a2bb881fcb but keep trimpath usage as is
(cherry picked from commit 48b2f1273af310934d0e2334ce5460712e706200)
Adin Schmahmann committed
Sep 9, 2020 at 13:48 UTC
fe1df47128b2612dd4be967236bbdc3973b35fcc
1 file changed
+4
-3
mk/golang.mk
+4
-3
@@ -6,12 +6,13 @@ export GO111MODULE=on
6
# pre-definitions
7
GOCC ?= go
8
GOTAGS ?=
9
-unexport GOFLAGS
10
-GOFLAGS ?=
9
GOTFLAGS ?=
10
11
+# Unexport GOFLAGS so we only apply it where we actually want it.
12
+unexport GOFLAGS
13
+# Override so we can combine with the user's go flags.
14
# Try to make building as reproducible as possible by stripping the go path.
14
-GOFLAGS += "-asmflags=all='-trimpath=$(GOPATH)'" "-gcflags=all='-trimpath=$(GOPATH)'"
15
+override GOFLAGS += "-asmflags=all='-trimpath=$(GOPATH)'" "-gcflags=all='-trimpath=$(GOPATH)'"
16
17
ifeq ($(tarball-is),1)
18
GOFLAGS += -mod=vendor