From 9166894c696582ee37893ce92a694ba227744fa0 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 3 May 2022 18:34:38 +0200 Subject: vendor test dependencies instead of installing via network We can vendor the test dependencies such as go-md2man, git-validation and goimports. This allows us to always install the same version as specified in go.mod. Also we do not rely on a network connection for this. The advantage with this method is that dependabot will also update the dependencies for us and we do not have to hardcode versions in the Makefile. Signed-off-by: Paul Holzinger --- Makefile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index caa991b14..8cb6fed08 100644 --- a/Makefile +++ b/Makefile @@ -174,10 +174,6 @@ endif # Necessary for nested-$(MAKE) calls and docs/remote-docs.sh export GOOS GOARCH CGO_ENABLED BINSFX SRCBINDIR -define go-install - $(GO) install ${1}@latest -endef - # Need to use CGO for mDNS resolution, but cross builds need CGO disabled # See https://github.com/golang/go/issues/12524 for details DARWIN_GCO := 0 @@ -864,7 +860,7 @@ install.tools: .install.goimports .install.gitvalidation .install.md2man .instal .install.goimports: .gopathok if [ ! -x "$(GOBIN)/goimports" ]; then \ - $(call go-install,golang.org/x/tools/cmd/goimports); \ + $(GO) install ./vendor/golang.org/x/tools/cmd/goimports ; \ fi touch .install.goimports @@ -877,7 +873,7 @@ install.tools: .install.goimports .install.gitvalidation .install.md2man .instal .PHONY: .install.gitvalidation .install.gitvalidation: .gopathok if [ ! -x "$(GOBIN)/git-validation" ]; then \ - $(call go-install,github.com/vbatts/git-validation); \ + $(GO) install ./vendor/github.com/vbatts/git-validation ; \ fi .PHONY: .install.golangci-lint @@ -897,7 +893,7 @@ install.tools: .install.goimports .install.gitvalidation .install.md2man .instal .PHONY: .install.md2man .install.md2man: .gopathok if [ ! -x "$(GOMD2MAN)" ]; then \ - $(call go-install,github.com/cpuguy83/go-md2man); \ + $(GO) install ./vendor/github.com/cpuguy83/go-md2man/v2 ; \ fi # $BUILD_TAGS variable is used in hack/golangci-lint.sh -- cgit v1.2.3-54-g00ecf