Skip to content

Commit

Permalink
fix: override GOFLAGS
Browse files Browse the repository at this point in the history
That way we can combine our GOFLAGS with the user specified ones.

This also switches to the new -trimpath build flag for reproducible builds.

fixes #7475
  • Loading branch information
Stebalien authored and aschmahmann committed Jul 20, 2020
1 parent be171d5 commit 480defa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mk/golang.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ export GO111MODULE=on
# pre-definitions
GOCC ?= go
GOTAGS ?=
unexport GOFLAGS
GOFLAGS ?=
GOTFLAGS ?=

# Unexport GOFLAGS so we only apply it where we actually want it.
unexport GOFLAGS
# Try to make building as reproducible as possible by stripping the go path.
GOFLAGS += "-asmflags=all='-trimpath=$(GOPATH)'" "-gcflags=all='-trimpath=$(GOPATH)'"
# Override so we can combine with the user's go flags.
override GOFLAGS += -trimpath

ifeq ($(tarball-is),1)
GOFLAGS += -mod=vendor
Expand Down

0 comments on commit 480defa

Please sign in to comment.