summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Duvall <dduvall@wikimedia.org>2018-05-24 12:01:26 -0700
committerDan Duvall <dduvall@wikimedia.org>2018-05-24 12:34:11 -0700
commitfee2d8f552d34d7a7e69b5a82ba2f83fd06f8cbf (patch)
tree3da50e699336d2b48fa72e8c3dc8600605773e92
parentb0e3e7d8a55f1fd77625880853c156811ff007dc (diff)
downloadblubber-fee2d8f552d34d7a7e69b5a82ba2f83fd06f8cbf.tar.gz
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
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
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: