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>2022-11-01 14:54:43 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-11-03 13:53:00 +0300
commitea8cb42485b404c8d46bf51b2764e058bff7982b (patch)
treec7df33d8dfe041eab24e4c22c68ed0994638b1cf
parent0e67646e4201dd6399cdc8a7232961f1aa318337 (diff)
ci: Don't install Git when building binaries
Our CI job that builds Gitaly's binaries will build and install a Git distribution when not instructed to use bundled Git binaries. While we indeed want to build the Git distribution so that we can cache it, installing it into `/usr/local` is entirely unnecessary. Furthermore, we're about to convert the build to run as an unprivileged user who cannot install into `/usr/local`, and thus the build would break. Expose a new build target `build-git` that allows us to easily build the Git distribution without installing it and convert the CI job to use it instead of the old `git` target.
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--Makefile8
2 files changed, 7 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 43983a524..9bbbf6ccf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -149,7 +149,7 @@ build:
policy: pull-push
script:
- go version
- - make -j$(nproc) build $(pwd)/_build/tools/protoc $(test "${GIT_VERSION}" = "default" && echo "build-bundled-git" || echo "git")
+ - make -j$(nproc) build $(pwd)/_build/tools/protoc $(test "${GIT_VERSION}" = default && echo build-bundled-git || echo build-git)
- _support/test-boot . ${TEST_BOOT_ARGS}
parallel:
matrix:
diff --git a/Makefile b/Makefile
index bd66f8d4e..85be210f0 100644
--- a/Makefile
+++ b/Makefile
@@ -538,9 +538,13 @@ upgrade-module:
# This target is deprecated and will eventually be removed.
git: install-git
+.PHONY: build-git
+## Build Git distribution.
+build-git: ${DEPENDENCY_DIR}/git-distribution/git
+
.PHONY: install-git
-## Install Git.
-install-git: ${DEPENDENCY_DIR}/git-distribution/Makefile
+## Install Git distribution.
+install-git: build-git
${Q}env -u PROFILE -u MAKEFLAGS -u GIT_VERSION ${MAKE} -C "${DEPENDENCY_DIR}/git-distribution" -j$(shell nproc) prefix=${GIT_PREFIX} ${GIT_BUILD_OPTIONS} install
.PHONY: libgit2