Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-11-18 14:05:18 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-11-30 15:24:45 +0300
commita818370993ae6fe9785b5116dac23611eb9361f9 (patch)
tree66e74892c586cb36e893581ce49783ed7e5fc89b /Makefile
parent60d1b61f3afc26a7f17d9a0c90567ea03addf293 (diff)
git: Implement support for bundled Git binaries
Now that we can build bundled Git binaries, this commit introduces support into the Git command factory to support them. If a new option "git.use_bundled_binaries" is set to `true`, then we automatically derive the Git binary's path from the binary directory of Gitaly. Note that we must go through some hoops though given that the bundled binaries have a "gitaly-" prefix. While it's not much of a problem when executing Git directly, some Git commands require it to find auxiliary helper binaries like "git-remote-http" or "git-receive-pack". To support these cases, we thus create a temporary directory and symlink all binaries Git expects to be present into it. By pointing GIT_EXEC_PATH at this directory, we can thus trick Git into picking the correct set of binaries. This new bundled mode will required configuration changes by admins.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1a0869b1c..a8bba2be8 100644
--- a/Makefile
+++ b/Makefile
@@ -242,7 +242,6 @@ export GOCACHE ?= ${BUILD_DIR}/cache
export GOPROXY ?= https://proxy.golang.org
export PATH := ${BUILD_DIR}/bin:${PATH}
export PKG_CONFIG_PATH := ${LIBGIT2_INSTALL_DIR}/lib/pkgconfig
-export GITALY_TESTING_GIT_BINARY ?= ${GIT_INSTALL_DIR}/bin/git
# Allow the linker flag -D_THREAD_SAFE as libgit2 is compiled with it on FreeBSD
export CGO_LDFLAGS_ALLOW = -D_THREAD_SAFE
@@ -312,16 +311,24 @@ build: $(patsubst %,${BUILD_DIR}/bin/gitaly-%,${GIT_EXECUTABLES})
install: $(patsubst %,${INSTALL_DEST_DIR}/gitaly-%,${GIT_EXECUTABLES})
+prepare-tests: $(patsubst %,${BUILD_DIR}/bin/gitaly-%,${GIT_EXECUTABLES})
+
${BUILD_DIR}/bin/gitaly-%: ${GIT_SOURCE_DIR}/% | ${BUILD_DIR}/bin
${Q}install $< $@
${INSTALL_DEST_DIR}/gitaly-%: ${BUILD_DIR}/bin/gitaly-%
${Q}mkdir -p $(@D)
${Q}install $< $@
+
+export GITALY_TESTING_BUNDLED_GIT_PATH ?= ${BUILD_DIR}/bin
+else
+prepare-tests: git
+
+export GITALY_TESTING_GIT_BINARY ?= ${GIT_INSTALL_DIR}/bin/git
endif
.PHONY: prepare-tests
-prepare-tests: git libgit2 prepare-test-repos ${SOURCE_DIR}/.ruby-bundle
+prepare-tests: libgit2 prepare-test-repos ${SOURCE_DIR}/.ruby-bundle
.PHONY: prepare-test-repos
prepare-test-repos: ${TEST_REPO} ${TEST_REPO_GIT}