From 4a6b4d36ad494d1ab66f45d7be887990161d9918 Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Thu, 1 Feb 2024 11:27:26 -0700 Subject: [PATCH] Makefile: handle $GOPATH with a trailing slash When a $GOPATH contains a trailing slash, the current check for string equality between the repo root and the computed path does not pass, even though it should. Passing both sides of the check through `abspath` makes this check more robust. Signed-off-by: Steve Kuznetsov --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b43f76940c..06eae3f99c 100644 --- a/Makefile +++ b/Makefile @@ -76,7 +76,7 @@ DOCKER_BUILDKIT=1 export ACK_GINKGO_DEPRECATIONS := 1.16.4 # Set --output-base for conversion-gen if we are not within GOPATH -ifneq ($(abspath $(REPO_ROOT)),$(shell go env GOPATH)/src/sigs.k8s.io/cluster-api-provider-aws) +ifneq ($(abspath $(REPO_ROOT)),$(abspath $(shell go env GOPATH)/src/sigs.k8s.io/cluster-api-provider-aws)) GEN_OUTPUT_BASE := --output-base=$(REPO_ROOT) else export GOPATH := $(shell go env GOPATH)