From d025ce03f012afa4971c98dc34752c078912daa7 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 2 May 2022 18:03:59 +0200 Subject: [PATCH 1/2] CI: emergency fix for broken go get go get is deprecated, we should use go install instead. Also for some reason go get -u golang.org/x/tools/cmd/goimports is broken at the moment, thus failing CI jobs where we have to install this. Switching to go install seems to fix it. Signed-off-by: Paul Holzinger --- Makefile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 99a4e6f1ee..07160df6d6 100644 --- a/Makefile +++ b/Makefile @@ -173,9 +173,8 @@ endif # Necessary for nested-$(MAKE) calls and docs/remote-docs.sh export GOOS GOARCH CGO_ENABLED BINSFX SRCBINDIR -define go-get - env GO111MODULE=off \ - $(GO) get -u ${1} +define go-install + $(GO) install ${1}@latest endef # Need to use CGO for mDNS resolution, but cross builds need CGO disabled @@ -860,7 +859,7 @@ install.tools: .install.goimports .install.gitvalidation .install.md2man .instal .install.goimports: .gopathok if [ ! -x "$(GOBIN)/goimports" ]; then \ - $(call go-get,golang.org/x/tools/cmd/goimports); \ + $(call go-install,golang.org/x/tools/cmd/goimports); \ fi touch .install.goimports @@ -873,7 +872,7 @@ install.tools: .install.goimports .install.gitvalidation .install.md2man .instal .PHONY: .install.gitvalidation .install.gitvalidation: .gopathok if [ ! -x "$(GOBIN)/git-validation" ]; then \ - $(call go-get,github.com/vbatts/git-validation); \ + $(call go-install,github.com/vbatts/git-validation); \ fi .PHONY: .install.golangci-lint @@ -893,7 +892,7 @@ install.tools: .install.goimports .install.gitvalidation .install.md2man .instal .PHONY: .install.md2man .install.md2man: .gopathok if [ ! -x "$(GOMD2MAN)" ]; then \ - $(call go-get,github.com/cpuguy83/go-md2man); \ + $(call go-install,github.com/cpuguy83/go-md2man); \ fi # $BUILD_TAGS variable is used in hack/golangci-lint.sh From 65b2bb9ef5f0a10caadf51b02a6e82b9814a12cc Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Tue, 3 May 2022 13:38:30 -0400 Subject: [PATCH 2/2] CI: Fix installing 'latest' tooling at runtime Thanks to @Luap99 for the fix. Signed-off-by: Chris Evich --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 07160df6d6..570dc07d0c 100644 --- a/Makefile +++ b/Makefile @@ -174,7 +174,7 @@ endif export GOOS GOARCH CGO_ENABLED BINSFX SRCBINDIR define go-install - $(GO) install ${1}@latest + $(GO) install ${1} endef # Need to use CGO for mDNS resolution, but cross builds need CGO disabled @@ -859,7 +859,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); \ + $(call go-install,golang.org/x/tools/cmd/goimports@v0.1.10); \ fi touch .install.goimports @@ -872,7 +872,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); \ + $(call go-install,github.com/vbatts/git-validation@v1.1.0); \ fi .PHONY: .install.golangci-lint @@ -892,7 +892,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); \ + $(call go-install,github.com/cpuguy83/go-md2man@v2.0.2); \ fi # $BUILD_TAGS variable is used in hack/golangci-lint.sh