From 11d3cf26977538b1ee20ea331e0f14e995d7f550 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Wed, 13 Apr 2022 17:13:45 -0700 Subject: Makefile, podman.spec.rpkg: rm GOBIN and GOPATH Remove GOPATH setting as since Go 1.9 it defaults to $HOME/go (for earlier versions it had to be specified explicitly). Remove GOPATH-related code from the spec, using relative paths when compiling packages, and enable Go modules, simplifying the spec. Remove support for multiple paths in GOPATH (which is rarely used and doesn't really work with modules). Remove setting GOBIN, rely on $GOPATH/bin instead. In case GOBIN is explicitly set (which is highly unlikely), forcefully ignore by unsetting it. Remove GOBIN from tools invocation since we added GOPATH/bin to PATH. Signed-off-by: Kir Kolyshkin --- Makefile | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8932214e4..ff3e69087 100644 --- a/Makefile +++ b/Makefile @@ -120,20 +120,10 @@ RELEASE_NUMBER = $(shell echo "$(RELEASE_VERSION)" | sed -e 's/^v\(.*\)/\1/') # If non-empty, logs all output from server during remote system testing PODMAN_SERVER_LOG ?= -# If GOPATH not specified, use one in the local directory -ifeq ($(GOPATH),) -export GOPATH := $(HOME)/go -unexport GOBIN -endif -FIRST_GOPATH := $(firstword $(subst :, ,$(GOPATH))) - -GOBIN := $(shell $(GO) env GOBIN) -ifeq ($(GOBIN),) -GOBIN := $(FIRST_GOPATH)/bin -endif - +# Ensure GOBIN is not set so the default (`go env GOPATH`/bin) is used. +override undefine GOBIN # This must never include the 'hack' directory -export PATH := $(PATH):$(GOBIN) +export PATH := $(shell $(GO) env GOPATH)/bin:$(PATH) GOMD2MAN ?= $(shell command -v go-md2man || echo './test/tools/build/go-md2man') @@ -522,7 +512,7 @@ run-docker-py-tests: .PHONY: localunit localunit: test/goecho/goecho test/version/version rm -rf ${COVERAGE_PATH} && mkdir -p ${COVERAGE_PATH} - UNIT=1 $(GOBIN)/ginkgo \ + UNIT=1 ginkgo \ -r \ $(TESTFLAGS) \ --skipPackage test/e2e,pkg/apparmor,pkg/bindings,hack,pkg/machine/e2e \ @@ -541,8 +531,8 @@ test: localunit localintegration remoteintegration localsystem remotesystem ## .PHONY: ginkgo-run ginkgo-run: - ACK_GINKGO_RC=true $(GOBIN)/ginkgo version - ACK_GINKGO_RC=true $(GOBIN)/ginkgo -v $(TESTFLAGS) -tags "$(TAGS)" $(GINKGOTIMEOUT) -cover -flakeAttempts 3 -progress -trace -noColor -nodes 3 -debug test/e2e/. $(HACK) + ACK_GINKGO_RC=true ginkgo version + ACK_GINKGO_RC=true ginkgo -v $(TESTFLAGS) -tags "$(TAGS)" $(GINKGOTIMEOUT) -cover -flakeAttempts 3 -progress -trace -noColor -nodes 3 -debug test/e2e/. $(HACK) .PHONY: ginkgo ginkgo: @@ -560,7 +550,7 @@ remoteintegration: test-binaries ginkgo-remote .PHONY: localbenchmarks localbenchmarks: test-binaries - PATH=$(PATH):$(shell pwd)/hack ACK_GINKGO_RC=true $(GOBIN)/ginkgo \ + PATH=$(PATH):$(shell pwd)/hack ACK_GINKGO_RC=true ginkgo \ -focus "Podman Benchmark Suite" \ -tags "$(BUILDTAGS) benchmarks" -noColor \ -noisySkippings=false -noisyPendings=false \ @@ -854,13 +844,11 @@ install.tools: .install.ginkgo .install.golangci-lint .install.bats ## Install n .PHONY: .install.ginkgo .install.ginkgo: - if [ ! -x "$(GOBIN)/ginkgo" ]; then \ - $(GO) install $(BUILDFLAGS) ./vendor/github.com/onsi/ginkgo/ginkgo ; \ - fi + $(GO) install $(BUILDFLAGS) ./vendor/github.com/onsi/ginkgo/ginkgo .PHONY: .install.golangci-lint .install.golangci-lint: - VERSION=1.45.2 GOBIN=$(GOBIN) ./hack/install_golangci.sh + VERSION=1.45.2 ./hack/install_golangci.sh .PHONY: .install.md2man .install.md2man: -- cgit v1.2.3-54-g00ecf