From d81ef278daf620fb455f7e094388b7e2664ac396 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Wed, 20 Nov 2019 06:43:40 +0100 Subject: [PATCH] Update Makefile to make use of -trimpath build option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This option makes go build/install removes the absolute paths within the produced executable, enabling more reproducible builds. See ¹ for more details. ¹: https://golang.org/doc/go1.13?ref=hvper.com#go-command --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b5eb7de..a27d139 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ .PHONY: lint build test jaillover race coverage install acceptance deps docker GOCMD=go -GOBUILD=$(GOCMD) build +GOBUILD=$(GOCMD) build -trimpath +GOINSTALL=$(GOCMD) install -trimpath GOGET=$(GOCMD) get GOTEST=$(GOCMD) test GOTOOL=$(GOCMD) tool @@ -39,7 +40,7 @@ coverage: test race $(GOTOOL) cover -html=$(TMP_DIR)/c.out -o $(OUTPUT_DIR)/coverage.html install: build - CGO_ENABLED=0 go install ./... + CGO_ENABLED=0 $(GOINSTALL) ./... acceptance: install make -C ./spec/test