From fee2d8f552d34d7a7e69b5a82ba2f83fd06f8cbf Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Thu, 24 May 2018 12:01:26 -0700 Subject: Attempt to resolve symlinked CURDIR in Makefile Summary: See upstream bug https://github.com/golang/go/issues/24359 Test Plan: Run `make` from a symlink targetting the blubber directory under `GOPATH` and verify that `blubber --version` outputs the version and commit. Reviewers: thcipriani, #release-engineering-team Reviewed By: thcipriani, #release-engineering-team Tags: #release-engineering-team Differential Revision: https://phabricator.wikimedia.org/D1061 --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 9a73549..c054f42 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,16 @@ RELEASE_DIR ?= ./_release TARGETS ?= darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le windows/amd64 plan9/amd64 PACKAGE := phabricator.wikimedia.org/source/blubber +REAL_CURDIR := $(shell readlink "$(CURDIR)" || echo "$(CURDIR)") GO_LDFLAGS := \ -X $(PACKAGE)/meta.Version=$(shell cat VERSION) \ -X $(PACKAGE)/meta.GitCommit=$(shell git rev-parse --short HEAD) install: + # workaround bug in case CURDIR is a symlink + # see https://github.com/golang/go/issues/24359 + cd "$(REAL_CURDIR)" && \ go install -v -ldflags "$(GO_LDFLAGS)" release: -- cgit v1.2.1