From bdfab6b283d17ee65c65e4e96d73be3b60b7ea1a Mon Sep 17 00:00:00 2001 From: Divya Rani Date: Tue, 9 Dec 2025 13:50:49 +0530 Subject: [PATCH] Introduce build target for Git's previous version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To begin deploying Gitaly’s Git version from master, we introduced the GIT_VERSION_MASTER and GIT_VERSION_PREV variables. Previously, we didn't add a build target for GIT_VERSION_PREV because we did not yet have a stable release other than 2.50. Now that both GIT_VERSION_MASTER and GIT_VERSION_PREV point to stable versions, we can safely remove 2.50 as the fallback option. --- Makefile | 24 ++++++++------------ internal/git/gitcmd/execution_environment.go | 2 +- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 3e345dc603..ba3e8f89bc 100644 --- a/Makefile +++ b/Makefile @@ -160,10 +160,6 @@ GIT_VERSION ?= GIT_VERSION_MASTER ?= 23466173824c0a0f835c0d790c2f38156ae6284a GIT_VERSION_PREV ?= 41d0310a83aba75a19585d8fbbf021938d8d2ace # -# GIT_VERSION_x_xx defines versions for each instance of bundled Git we ship. When a new -# major version is added, be sure to update GIT_PACKED_EXECUTABLES, the *-bundled-git targets, -# and add new targets under the "# These targets build specific releases of Git." section. -GIT_VERSION_2_50 ?= v2.50.1.gl1 # # OVERRIDE_GIT_VERSION allows you to specify a custom semver value to be reported by the # `git --version` command. This affects bundled and non-bundled Git, and can be used whenever @@ -172,9 +168,7 @@ GIT_VERSION_2_50 ?= v2.50.1.gl1 OVERRIDE_GIT_VERSION ?= ifeq (${GIT_VERSION:default=},) - # GIT_VERSION should be overridden to the default version of bundled Git. This is only - # necessary until https://gitlab.com/gitlab-org/gitaly/-/issues/6195 is complete. - override GIT_VERSION := ${GIT_VERSION_2_50} + override GIT_VERSION := ${GIT_VERSION_MASTER} # When GIT_VERSION is not explicitly set, we default to bundled Git. export WITH_BUNDLED_GIT = YesPlease else @@ -278,7 +272,7 @@ endif # Git binaries that are eventually embedded into the Gitaly binary. GIT_PACKED_EXECUTABLES = $(addprefix ${BUILD_DIR}/bin/gitaly-, $(addsuffix -master, ${GIT_EXECUTABLES})) \ - $(addprefix ${BUILD_DIR}/bin/gitaly-, $(addsuffix -v2.50, ${GIT_EXECUTABLES})) + $(addprefix ${BUILD_DIR}/bin/gitaly-, $(addsuffix -prev, ${GIT_EXECUTABLES})) # All executables provided by Gitaly. GITALY_EXECUTABLES = $(addprefix ${BUILD_DIR}/bin/,$(notdir $(shell find ${SOURCE_DIR}/cmd -mindepth 1 -maxdepth 1 -type d -print))) @@ -367,16 +361,16 @@ install: build .PHONY: build-bundled-git ## Build bundled Git binaries. -build-bundled-git: build-bundled-git-master build-bundled-git-v2.50 +build-bundled-git: build-bundled-git-master build-bundled-git-prev build-bundled-git-master: $(patsubst %,${BUILD_DIR}/bin/gitaly-%-master,${GIT_EXECUTABLES}) -build-bundled-git-v2.50: $(patsubst %,${BUILD_DIR}/bin/gitaly-%-v2.50,${GIT_EXECUTABLES}) +build-bundled-git-prev: $(patsubst %,${BUILD_DIR}/bin/gitaly-%-prev,${GIT_EXECUTABLES}) .PHONY: install-bundled-git ## Install bundled Git binaries. The target directory can be modified by ## setting PREFIX and DESTDIR. -install-bundled-git: install-bundled-git-master install-bundled-git-v2.50 +install-bundled-git: install-bundled-git-master install-bundled-git-prev install-bundled-git-master: $(patsubst %,${INSTALL_DEST_DIR}/gitaly-%-master,${GIT_EXECUTABLES}) -install-bundled-git-v2.50: $(patsubst %,${INSTALL_DEST_DIR}/gitaly-%-v2.50,${GIT_EXECUTABLES}) +install-bundled-git-prev: $(patsubst %,${INSTALL_DEST_DIR}/gitaly-%-prev,${GIT_EXECUTABLES}) ifdef WITH_BUNDLED_GIT build: build-bundled-git @@ -708,16 +702,16 @@ ${DEPENDENCY_DIR}/git-distribution/build/git: ${DEPENDENCY_DIR}/git-distribution ${Q}touch $@ # These targets build specific releases of Git. -${BUILD_DIR}/bin/gitaly-%-v2.50: override GIT_VERSION = ${GIT_VERSION_2_50} +${BUILD_DIR}/bin/gitaly-%-prev: override GIT_VERSION = ${GIT_VERSION_PREV} ${BUILD_DIR}/bin/gitaly-%-master: override GIT_VERSION = ${GIT_VERSION_MASTER} ifdef USE_MESON -${BUILD_DIR}/bin/gitaly-%-v2.50: ${DEPENDENCY_DIR}/git-v2.50/build/% | ${BUILD_DIR}/bin +${BUILD_DIR}/bin/gitaly-%-prev: ${DEPENDENCY_DIR}/git-prev/build/% | ${BUILD_DIR}/bin ${Q}install $< $@ ${BUILD_DIR}/bin/gitaly-%-master: ${DEPENDENCY_DIR}/git-master/build/% | ${BUILD_DIR}/bin ${Q}install $< $@ else -${BUILD_DIR}/bin/gitaly-%-v2.50: ${DEPENDENCY_DIR}/git-v2.50/% | ${BUILD_DIR}/bin +${BUILD_DIR}/bin/gitaly-%-prev: ${DEPENDENCY_DIR}/git-prev/% | ${BUILD_DIR}/bin ${Q}install $< $@ ${BUILD_DIR}/bin/gitaly-%-master: ${DEPENDENCY_DIR}/git-master/% | ${BUILD_DIR}/bin ${Q}install $< $@ diff --git a/internal/git/gitcmd/execution_environment.go b/internal/git/gitcmd/execution_environment.go index c2635d5866..6d38e21e5c 100644 --- a/internal/git/gitcmd/execution_environment.go +++ b/internal/git/gitcmd/execution_environment.go @@ -28,7 +28,7 @@ var ( }, }, { - Suffix: "-v2.50", + Suffix: "-prev", }, } -- GitLab