From fbeed52283ade4169e38fd87858d48496dfa7894 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 23 Apr 2020 17:32:10 -0700 Subject: [PATCH] Makefile: add -mod=vendor Since we carry vendor/ subdir, let's actually use it. Should speed up CI a bit, possibly also making it a tad more stable. This is actually implemented in go 1.14 already (i.e. it turns mod=vendor automatically if it sees vendor/ dir), but we still use go 1.13. Signed-off-by: Kir Kolyshkin --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0d11b8c01..99d068c05 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,10 @@ COMMIT_NO := $(shell git rev-parse HEAD 2> /dev/null || true) COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no),"$(COMMIT_NO)-dirty","$(COMMIT_NO)") VERSION := $(shell cat ./VERSION) -GO_BUILD := $(GO) build -buildmode=pie $(EXTRA_FLAGS) -tags "$(BUILDTAGS)" \ +# TODO: rm -mod=vendor once go 1.13 will be unsupported +GO_BUILD := $(GO) build -mod=vendor -buildmode=pie $(EXTRA_FLAGS) -tags "$(BUILDTAGS)" \ -ldflags "-X main.gitCommit=$(COMMIT) -X main.version=$(VERSION) $(EXTRA_LDFLAGS)" -GO_BUILD_STATIC := CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo osusergo" \ +GO_BUILD_STATIC := CGO_ENABLED=1 $(GO) build -mod=vendor $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo osusergo" \ -ldflags "-w -extldflags -static -X main.gitCommit=$(COMMIT) -X main.version=$(VERSION) $(EXTRA_LDFLAGS)" MAN_DIR := $(CURDIR)/man/man8