diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-08-30 14:31:01 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-05 10:42:54 +0300 |
commit | 33b125c09fc6852729f4bdf3f27237553bc7825f (patch) | |
tree | 2f08c82d9599674f40c63179e7229a93ae59ba51 | |
parent | 4325481ab92a44ae5de5f58e126fe1202512998a (diff) |
Makefile: Stop building libgit2
Now that we have dropped gitaly-git2go there is no need to build libgit2
anymore. Drop it from our Makefile.
-rw-r--r-- | .gitlab-ci.yml | 3 | ||||
-rw-r--r-- | Makefile | 62 |
2 files changed, 3 insertions, 62 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b1ca532e7..98380b298 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -344,9 +344,6 @@ test:macos: variables: <<: *test_variables CACHE_PREFIX: !reference [.versions, macos] - # This is required to fix inconsistent deployment targets across CGo and - # libgit2. - MACOSX_DEPLOYMENT_TARGET: "12.0" PGDATA: /Volumes/RAMDisk/postgres PGHOST: localhost PGUSER: gitlab @@ -173,41 +173,6 @@ ifdef GIT_FIPS_BUILD_OPTIONS GIT_BUILD_OPTIONS += ${GIT_FIPS_BUILD_OPTIONS} endif -# libgit2 target -# Git2Go and libgit2 may need to be updated in sync. Please refer to -# https://github.com/libgit2/git2go/#which-go-version-to-use for a -# compatibility matrix. -GIT2GO_VERSION ?= v34 -LIBGIT2_VERSION ?= v1.5.1 -LIBGIT2_REPO_URL ?= https://gitlab.com/libgit2/libgit2.git -LIBGIT2_SOURCE_DIR ?= ${DEPENDENCY_DIR}/libgit2/source -LIBGIT2_BUILD_DIR ?= ${DEPENDENCY_DIR}/libgit2/build -LIBGIT2_INSTALL_DIR ?= ${DEPENDENCY_DIR}/libgit2/install - -ifeq ($(origin LIBGIT2_BUILD_OPTIONS),undefined) - ## Build options for libgit2. - LIBGIT2_BUILD_OPTIONS ?= - LIBGIT2_BUILD_OPTIONS += -DBUILD_CLI=OFF - LIBGIT2_BUILD_OPTIONS += -DBUILD_TESTS=OFF - LIBGIT2_BUILD_OPTIONS += -DBUILD_SHARED_LIBS=OFF - LIBGIT2_BUILD_OPTIONS += -DCMAKE_C_FLAGS=-fPIC - LIBGIT2_BUILD_OPTIONS += -DCMAKE_BUILD_TYPE=Release - LIBGIT2_BUILD_OPTIONS += -DCMAKE_INSTALL_PREFIX=${LIBGIT2_INSTALL_DIR} - LIBGIT2_BUILD_OPTIONS += -DCMAKE_INSTALL_LIBDIR=lib - LIBGIT2_BUILD_OPTIONS += -DUSE_SSH=OFF - LIBGIT2_BUILD_OPTIONS += -DUSE_HTTPS=OFF - LIBGIT2_BUILD_OPTIONS += -DUSE_ICONV=OFF - LIBGIT2_BUILD_OPTIONS += -DUSE_NTLMCLIENT=OFF - LIBGIT2_BUILD_OPTIONS += -DUSE_BUNDLED_ZLIB=ON - LIBGIT2_BUILD_OPTIONS += -DUSE_HTTP_PARSER=builtin - LIBGIT2_BUILD_OPTIONS += -DUSE_THREADS=ON - LIBGIT2_BUILD_OPTIONS += -DREGEX_BACKEND=builtin -endif - -ifdef LIBGIT2_APPEND_BUILD_OPTIONS - LIBGIT2_BUILD_OPTIONS += ${LIBGIT2_APPEND_BUILD_OPTIONS} -endif - # These variables control test options and artifacts ## List of Go packages which shall be tested. ## Go packages to test when using the test-go target. @@ -268,9 +233,6 @@ GOCACHE_MAX_SIZE_KB ?= 5000000 export GOCACHE ?= ${BUILD_DIR}/cache export GOPROXY ?= https://proxy.golang.org|https://proxy.golang.org export PATH := ${BUILD_DIR}/bin:${PATH} -export PKG_CONFIG_PATH := ${LIBGIT2_INSTALL_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} -# Allow the linker flag -D_THREAD_SAFE as libgit2 is compiled with it on FreeBSD -export CGO_LDFLAGS_ALLOW = -D_THREAD_SAFE # By default, intermediate targets get deleted automatically after a successful # build. We do not want that though: there's some precious intermediate targets @@ -369,7 +331,7 @@ run_go_tests += \ endif .PHONY: prepare-tests -prepare-tests: libgit2 ${GOTESTSUM} ${GITALY_PACKED_EXECUTABLES} +prepare-tests: ${GOTESTSUM} ${GITALY_PACKED_EXECUTABLES} ${Q}mkdir -p "$(dir ${TEST_JUNIT_REPORT})" .PHONY: prepare-debug @@ -442,12 +404,12 @@ ${TOOLS_DIR}/gitaly-linters.so: ${SOURCE_DIR}/tools/golangci-lint/go.sum $(wildc .PHONY: lint ## Run Go linter. -lint: ${GOLANGCI_LINT} libgit2 ${GITALY_PACKED_EXECUTABLES} ${TOOLS_DIR}/gitaly-linters.so lint-gitaly-linters +lint: ${GOLANGCI_LINT} ${GITALY_PACKED_EXECUTABLES} ${TOOLS_DIR}/gitaly-linters.so lint-gitaly-linters ${Q}${GOLANGCI_LINT} run --build-tags "${SERVER_BUILD_TAGS}" --out-format tab --config ${GOLANGCI_LINT_CONFIG} ${GOLANGCI_LINT_OPTIONS} .PHONY: lint-fix ## Run Go linter and write back fixes to the files (not supported by all linters). -lint-fix: ${GOLANGCI_LINT} libgit2 ${GITALY_PACKED_EXECUTABLES} ${TOOLS_DIR}/gitaly-linters.so +lint-fix: ${GOLANGCI_LINT} ${GITALY_PACKED_EXECUTABLES} ${TOOLS_DIR}/gitaly-linters.so ${Q}${GOLANGCI_LINT} run --fix --build-tags "${SERVER_BUILD_TAGS}" --out-format tab --config ${GOLANGCI_LINT_CONFIG} ${GOLANGCI_LINT_OPTIONS} .PHONY: lint-docs @@ -550,10 +512,6 @@ build-git: ${DEPENDENCY_DIR}/git-distribution/git 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 -## Build libgit2. -libgit2: ${LIBGIT2_INSTALL_DIR}/lib/libgit2.a - ${SOURCE_DIR}/NOTICE: ${BUILD_DIR}/NOTICE ${Q}mv $< $@ @@ -623,25 +581,11 @@ ${BUILD_DIR}/intermediate/%: clear-go-build-cache-if-needed .FOR # change. The dependency on the phony target is required to always rebuild # these targets. .PHONY: dependency-version -${DEPENDENCY_DIR}/libgit2.version: dependency-version | ${DEPENDENCY_DIR} - ${Q}[ x"$$(cat "$@" 2>/dev/null)" = x"${LIBGIT2_VERSION} ${LIBGIT2_BUILD_OPTIONS}" ] || >$@ echo -n "${LIBGIT2_VERSION} ${LIBGIT2_BUILD_OPTIONS}" ${DEPENDENCY_DIR}/git-%.version: dependency-version | ${DEPENDENCY_DIR} ${Q}[ x"$$(cat "$@" 2>/dev/null)" = x"${GIT_VERSION} ${GIT_BUILD_OPTIONS}" ] || >$@ echo -n "${GIT_VERSION} ${GIT_BUILD_OPTIONS}" ${DEPENDENCY_DIR}/protoc.version: dependency-version | ${DEPENDENCY_DIR} ${Q}[ x"$$(cat "$@" 2>/dev/null)" = x"${PROTOC_VERSION} ${PROTOC_BUILD_OPTIONS}" ] || >$@ echo -n "${PROTOC_VERSION} ${PROTOC_BUILD_OPTIONS}" -${LIBGIT2_INSTALL_DIR}/lib/libgit2.a: ${DEPENDENCY_DIR}/libgit2.version - ${Q}${GIT} -c init.defaultBranch=master init ${GIT_QUIET} ${LIBGIT2_SOURCE_DIR} - ${Q}${GIT} -C "${LIBGIT2_SOURCE_DIR}" config remote.origin.url ${LIBGIT2_REPO_URL} - ${Q}${GIT} -C "${LIBGIT2_SOURCE_DIR}" config remote.origin.tagOpt --no-tags - ${Q}${GIT} -C "${LIBGIT2_SOURCE_DIR}" fetch --depth 1 ${GIT_QUIET} origin ${LIBGIT2_VERSION} - ${Q}${GIT} -C "${LIBGIT2_SOURCE_DIR}" checkout ${GIT_QUIET} --detach FETCH_HEAD - ${Q}rm -rf ${LIBGIT2_BUILD_DIR} - ${Q}mkdir -p ${LIBGIT2_BUILD_DIR} - ${Q}cd ${LIBGIT2_BUILD_DIR} && cmake ${LIBGIT2_SOURCE_DIR} ${LIBGIT2_BUILD_OPTIONS} - ${Q}CMAKE_BUILD_PARALLEL_LEVEL=$(shell nproc) cmake --build ${LIBGIT2_BUILD_DIR} --target install - go install -a github.com/libgit2/git2go/${GIT2GO_VERSION} - # This target is responsible for checking out Git sources. In theory, we'd only # need to depend on the source directory. But given that the source directory # always changes when anything inside of it changes, like when we for example |