Skip to content

Commit 5f5e9bd

Browse files
committed
Makefile: Generate full Cilium version in worktree
Previously when using a git worktree for building Cilium, the Makefile would fail to detect that the local tree is a worktree, and therefore skip over the step where the sha and timestamp are included in the ciliumVersion variable which is subsequently built into each binary. This can make it difficult to track and understand which version of the code is running during development from a git worktree. Rather than depending on the existence of .git/HEAD, rely only on .git (which for a worktree is a file containing the path to the true git root). Signed-off-by: Joe Stringer <joe@cilium.io>
1 parent 1ab79eb commit 5f5e9bd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Makefile.defs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ GOLANGCILINT_VERSION = $(shell golangci-lint version --short 2>/dev/null)
138138
VERSION = $(shell cat $(dir $(lastword $(MAKEFILE_LIST)))/VERSION)
139139
VERSION_MAJOR = $(shell cat $(dir $(lastword $(MAKEFILE_LIST)))/VERSION | cut -d. -f1)
140140
# Use git only if in a Git repo
141-
ifneq ($(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/.git/HEAD),)
141+
ifneq ($(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/.git),)
142142
GIT_VERSION = $(shell git show -s --format='format:%h %aI')
143143
else
144144
GIT_VERSION = $(shell cat 2>/dev/null $(ROOT_DIR)/GIT_VERSION)

0 commit comments

Comments
 (0)