From c0e8ab0e69f63df9aee75dd0193bc75c27afb809 Mon Sep 17 00:00:00 2001 From: Chris Darroch Date: Sat, 14 Dec 2024 15:50:56 -0800 Subject: [PATCH] script/build-git: skip Homebrew linking on macOS Since we migrated our CI jobs to GitHub Actions in PR #3808, our "build-latest" and "build-earliest" jobs, when running on macOS, have explicitly installed and linked the "curl", "openssl", "pcre2", and "zlib" Homebrew formulae before building a custom version of Git. In a prior commit in this PR we removed the "brew install" command from our script/build-git script entirely, as we no longer need to install any Homebrew formulae, for the reasons described in that commit. However, we left an invocation of the "brew link" command for the "curl" formula in place in order to ensure that in our "build-earliest" CI job the CURLDIR variable is set such that when we build Git version 2.0.0 in that job, the Git binaries are linked against the Homebrew instance of the libcurl library rather than the one provided by macOS. We introduced the CURLDIR variable in commit f3cd1ef1bc68e03a061f177cfd6e1a7f0b247246 of PR #5866 so as to prevent our Git builds from linking with the libcurl library supplied by macOS, because at present macOS 13 and 14 (Ventura and Sonoma) provide version 8.7.1 of libcurl and it has a regression that affects the programs used by git-http-backend(1). The Homebrew project recommends against using the "brew link --force" command, though, for "keg-only" libraries like those from the "curl" formula: https://docs.brew.sh/How-to-Build-Software-Outside-Homebrew-with-Homebrew-keg-only-Dependencies Fortunately, we can achieve our desired result of linking our custom Git binaries against the Homebrew version of libcurl just by setting the CURLDIR variable using the "brew --prefix curl" command, so we do that now. --- script/build-git | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/script/build-git b/script/build-git index 58374c57d2..3f499a91b3 100755 --- a/script/build-git +++ b/script/build-git @@ -4,8 +4,7 @@ DIR="$1" case $(uname -s) in Darwin) - brew link --force curl - CURLDIR="$(curl-config --prefix)";; + CURLDIR="$(brew --prefix curl)";; Linux) export DEBIAN_FRONTEND=noninteractive if test -f /etc/apt/sources.list.d/ubuntu.sources; then