1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-17 23:16:11 +08:00

fix: override GOFLAGS

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
This commit is contained in:
Steven Allen
2020-06-15 12:02:19 -07:00
committed by Adin Schmahmann
parent be171d5e3c
commit 480defab68

View File

@ -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