Makefile: explicitly specify Git hash length
Explicitly specify the Git hash length to use, to ensure consistent version info regardless of version of Git or platform to build on.
This commit is contained in:
parent
e8ae0c3cf2
commit
dc6d5d9b8e
4
Makefile
4
Makefile
@ -10,14 +10,14 @@ RELEASE_CYCLE := alpha
|
|||||||
# _GIT_DESCRIPTION_OR_TAG is either something like '16-123abc' (when we're 16
|
# _GIT_DESCRIPTION_OR_TAG is either something like '16-123abc' (when we're 16
|
||||||
# commits since the last tag) or it's something like `v3.0-beta2` (when exactly
|
# commits since the last tag) or it's something like `v3.0-beta2` (when exactly
|
||||||
# on a tagged version).
|
# on a tagged version).
|
||||||
_GIT_DESCRIPTION_OR_TAG := $(subst v${VERSION}-,,$(shell git describe --tag --dirty --always))
|
_GIT_DESCRIPTION_OR_TAG := $(subst v${VERSION}-,,$(shell git describe --tag --dirty --always --abbrev=9))
|
||||||
# In the above cases, GITHASH is either `16-123abc` (in the same case above) or
|
# In the above cases, GITHASH is either `16-123abc` (in the same case above) or
|
||||||
# `123abc` (when the tag matches the current commit exactly) or `dirty` (when
|
# `123abc` (when the tag matches the current commit exactly) or `dirty` (when
|
||||||
# the tag matches the current commit exactly, and there are subsequent
|
# the tag matches the current commit exactly, and there are subsequent
|
||||||
# uncommitted changes). This is done to prevent repetition of the same tag
|
# uncommitted changes). This is done to prevent repetition of the same tag
|
||||||
# in the "extended version" of Flamenco, which combines ${VERSION} and
|
# in the "extended version" of Flamenco, which combines ${VERSION} and
|
||||||
# ${GITHASH}.
|
# ${GITHASH}.
|
||||||
GITHASH := $(subst v${VERSION},$(shell git rev-parse --short HEAD),${_GIT_DESCRIPTION_OR_TAG})
|
GITHASH := $(subst v${VERSION},$(shell git rev-parse --short=9 HEAD),${_GIT_DESCRIPTION_OR_TAG})
|
||||||
|
|
||||||
LDFLAGS := ${LDFLAGS} -X ${PKG}/internal/appinfo.ApplicationVersion=${VERSION} \
|
LDFLAGS := ${LDFLAGS} -X ${PKG}/internal/appinfo.ApplicationVersion=${VERSION} \
|
||||||
-X ${PKG}/internal/appinfo.ApplicationGitHash=${GITHASH} \
|
-X ${PKG}/internal/appinfo.ApplicationGitHash=${GITHASH} \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user