Skip to content

Commit a5a90fd

Browse files
committed
Allow libgit2 build to be enforced
This can be useful on machines where libgit2 is installed due to other applications depending on it, but where the composition of this installation does not properly work with the controller. Reason the system version is still preferred, is because this lowers the barrier for drive-by contributors, as a working set of (Git) dependencies should only really be required if you are going to perform work in that domain. Signed-off-by: Hidde Beydals <[email protected]>
1 parent 981d91e commit a5a90fd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ CRD_OPTIONS ?= crd:crdVersions=v1
1818
# Repository root based on Git metadata
1919
REPOSITORY_ROOT := $(shell git rev-parse --show-toplevel)
2020

21-
# Dependency versions
21+
# Libgit2 version
2222
LIBGIT2_VERSION ?= 1.1.1
23+
24+
# Other dependency versions
2325
ENVTEST_BIN_VERSION ?= 1.19.2
2426
KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use -i $(ENVTEST_BIN_VERSION) -p path)
2527

@@ -31,6 +33,10 @@ LIBGIT2_PATH := $(REPOSITORY_ROOT)/hack/libgit2
3133
LIBGIT2_LIB_PATH := $(LIBGIT2_PATH)/lib
3234
LIBGIT2 := $(LIBGIT2_LIB_PATH)/libgit2.so.$(LIBGIT2_VERSION)
3335

36+
ifneq ($(LIBGIT2_VERSION),$(SYSTEM_LIBGIT2_VERSION))
37+
LIBGIT2_FORCE ?= 1
38+
endif
39+
3440
# API (doc) generation utilities
3541
CONTROLLER_GEN_VERSION ?= v0.5.0
3642
GEN_API_REF_DOCS_VERSION ?= 0.3.0
@@ -164,8 +170,7 @@ endif
164170
libgit2: $(LIBGIT2) ## Detect or download libgit2 library
165171

166172
$(LIBGIT2):
167-
ifeq ($(LIBGIT2_VERSION),$(SYSTEM_LIBGIT2_VERSION))
168-
else
173+
ifeq (1, $(LIBGIT2_FORCE))
169174
@{ \
170175
set -e; \
171176
mkdir -p $(LIBGIT2_PATH); \

0 commit comments

Comments
 (0)