From 58ce95bf9a57ca5a7ca02341a387d4b0dffdf17b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Tue, 31 Mar 2026 13:16:53 +0200 Subject: [PATCH 01/11] ci: expand test matrix with cross-platform runners and git version testing Add build-git + test job split to test across all 4 supported platforms (x86_64-linux, aarch64-linux, aarch64-darwin, x86_64-darwin) and multiple git versions (2.34.1, 2.39.5, 2.47.3, 2.53.0) to catch regressions like the cat-file --filter breakage on older git (issue #1029). --- .github/workflows/ci.yml | 141 ++++++++++++++++++++++++++++++++------- 1 file changed, 116 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7c6f6607..224759854 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,39 +6,130 @@ on: workflow_dispatch: name: CI jobs: - test: - runs-on: ubuntu-latest - container: alpine:edge # latest go pls + build-git: + strategy: + fail-fast: false + matrix: + runner: + - ubuntu-24.04 + - ubuntu-22.04 + - ubuntu-24.04-arm + - ubuntu-22.04-arm + - macos-15 + - macos-26 + - macos-15-intel + - macos-26-intel + git-version: + - "2.34.1" + - "2.39.5" + - "2.47.3" + - "2.53.0" + runs-on: ${{ matrix.runner }} + name: build-git (${{ matrix.runner }}, git ${{ matrix.git-version }}) steps: - - name: checkout - uses: actions/checkout@v3 + - name: Cache git build + id: cache-git + uses: actions/cache@v5.0.4 + with: + path: ~/git-install + key: git-${{ matrix.git-version }}-${{ matrix.runner }} - - name: add dependencies - run: apk add go git tar + - name: Install build dependencies (Linux) + if: runner.os == 'Linux' && steps.cache-git.outputs.cache-hit != 'true' + run: | + sudo apt-get update + sudo apt-get install -y make libssl-dev libcurl4-gnutls-dev libexpat1-dev libz-dev gettext + + - name: Install build dependencies (macOS) + if: runner.os == 'macOS' && steps.cache-git.outputs.cache-hit != 'true' + run: brew install openssl curl expat - - name: Cache ctags - uses: actions/cache@v3 + - name: Build git from source + if: steps.cache-git.outputs.cache-hit != 'true' + run: | + curl -fsSL "https://www.kernel.org/pub/software/scm/git/git-${{ matrix.git-version }}.tar.gz" | tar xz + cd "git-${{ matrix.git-version }}" + + NPROC=$(nproc 2>/dev/null || sysctl -n hw.ncpu) + + if [ "$RUNNER_OS" = "macOS" ]; then + BREW_PREFIX=$(brew --prefix) + export CFLAGS="-I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/opt/curl/include -I${BREW_PREFIX}/opt/expat/include" + export LDFLAGS="-L${BREW_PREFIX}/opt/openssl/lib -L${BREW_PREFIX}/opt/curl/lib -L${BREW_PREFIX}/opt/expat/lib" + fi + + make prefix="$HOME/git-install" -j"$NPROC" all + make prefix="$HOME/git-install" install + + - name: Verify git build + run: | + "$HOME/git-install/bin/git" --version + "$HOME/git-install/bin/git" --version | grep -q "${{ matrix.git-version }}" + + - name: Upload git binaries + uses: actions/upload-artifact@v7.0.0 + with: + name: git-${{ matrix.git-version }}-${{ matrix.runner }} + path: ~/git-install + retention-days: 1 + + test: + needs: build-git + strategy: + fail-fast: false + matrix: + runner: + - ubuntu-24.04 + - ubuntu-22.04 + - ubuntu-24.04-arm + - ubuntu-22.04-arm + - macos-15 + - macos-26 + - macos-15-intel + - macos-26-intel + git-version: + - "2.34.1" + - "2.39.5" + - "2.47.3" + - "2.53.0" + runs-on: ${{ matrix.runner }} + name: test (${{ matrix.runner }}, git ${{ matrix.git-version }}) + steps: + - name: Checkout + uses: actions/checkout@v6.0.2 + + - name: Set up Go + uses: actions/setup-go@v6.4.0 with: - path: /usr/local/bin/universal-ctags - key: ${{ runner.os }}-ctags-${{ hashFiles('install-ctags-alpine.sh') }} + go-version-file: go.mod - - name: Cache Go modules - uses: actions/cache@v3 + - name: Download git binaries + uses: actions/download-artifact@v8.0.1 with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: install ctags + name: git-${{ matrix.git-version }}-${{ matrix.runner }} + path: ~/git-install + + - name: Add git to PATH run: | - if [ ! -f /usr/local/bin/universal-ctags ]; then - ./install-ctags-alpine.sh - fi + chmod -R +x "$HOME/git-install/bin" "$HOME/git-install/libexec" + echo "$HOME/git-install/bin" >> "$GITHUB_PATH" + + - name: Install universal-ctags (Linux) + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install -y universal-ctags + + - name: Install universal-ctags (macOS) + if: runner.os == 'macOS' + run: brew install universal-ctags + + - name: Print versions + run: | + go version + git --version + git --version | grep -q "${{ matrix.git-version }}" + universal-ctags --version || true - - name: test + - name: Test run: go test ./... fuzz-test: From 424a1ebd44d7143a4a2ff75661627a4a1fb40ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Tue, 31 Mar 2026 13:30:34 +0200 Subject: [PATCH 02/11] ci: add justification comments for git version matrix Each version maps to a real distro's stock git package: - 2.34.1: Ubuntu 22.04 LTS - 2.39.5: Debian 12, reported failing in #1029 - 2.47.3: Debian 13 + Alpine 3.21, also failing in #1029 - 2.53.0: latest stable, first with cat-file --batch --filter= (added in 2.50.0) --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 224759854..f80594d95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,10 +20,10 @@ jobs: - macos-15-intel - macos-26-intel git-version: - - "2.34.1" - - "2.39.5" - - "2.47.3" - - "2.53.0" + - "2.34.1" # Ubuntu 22.04 LTS (Jammy) — oldest supported LTS, ships 1:2.34.1-1ubuntu1 + - "2.39.5" # Debian 12 (Bookworm) — ships 1:2.39.5-0+deb12u3, reported failing in #1029 + - "2.47.3" # Debian 13 (Trixie) + Alpine 3.21 — ships 1:2.47.3-0+deb13u1, also failing in #1029 + - "2.53.0" # Latest stable (2026-02-02) — first version in matrix with cat-file --batch --filter= (added in 2.50.0) runs-on: ${{ matrix.runner }} name: build-git (${{ matrix.runner }}, git ${{ matrix.git-version }}) steps: @@ -88,10 +88,10 @@ jobs: - macos-15-intel - macos-26-intel git-version: - - "2.34.1" - - "2.39.5" - - "2.47.3" - - "2.53.0" + - "2.34.1" # Ubuntu 22.04 LTS (Jammy) — oldest supported LTS, ships 1:2.34.1-1ubuntu1 + - "2.39.5" # Debian 12 (Bookworm) — ships 1:2.39.5-0+deb12u3, reported failing in #1029 + - "2.47.3" # Debian 13 (Trixie) + Alpine 3.21 — ships 1:2.47.3-0+deb13u1, also failing in #1029 + - "2.53.0" # Latest stable (2026-02-02) — first version in matrix with cat-file --batch --filter= (added in 2.50.0) runs-on: ${{ matrix.runner }} name: test (${{ matrix.runner }}, git ${{ matrix.git-version }}) steps: From d29e2f8edc0547496e79da307c4f63399de05ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Tue, 31 Mar 2026 13:32:55 +0200 Subject: [PATCH 03/11] ci: centralize matrix vars in init job Define runners and git-versions once in an init job, then reference via fromJSON() in both build-git and test matrices. Avoids duplication and keeps version justification comments in a single place. --- .github/workflows/ci.yml | 52 ++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f80594d95..b846b289b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,24 +6,30 @@ on: workflow_dispatch: name: CI jobs: + init: + runs-on: ubuntu-latest + outputs: + runners: ${{ steps.matrix.outputs.runners }} + git-versions: ${{ steps.matrix.outputs.git-versions }} + steps: + - name: Define matrix + id: matrix + run: | + echo 'runners=["ubuntu-24.04","ubuntu-22.04","ubuntu-24.04-arm","ubuntu-22.04-arm","macos-15","macos-26","macos-15-intel","macos-26-intel"]' >> "$GITHUB_OUTPUT" + # Git versions to test against: + # 2.34.1 — Ubuntu 22.04 LTS (Jammy), oldest supported LTS, ships 1:2.34.1-1ubuntu1 + # 2.39.5 — Debian 12 (Bookworm), ships 1:2.39.5-0+deb12u3, reported failing in #1029 + # 2.47.3 — Debian 13 (Trixie) + Alpine 3.21, ships 1:2.47.3-0+deb13u1, also failing in #1029 + # 2.53.0 — Latest stable (2026-02-02), first version with cat-file --batch --filter= (added in 2.50.0) + echo 'git-versions=["2.34.1","2.39.5","2.47.3","2.53.0"]' >> "$GITHUB_OUTPUT" + build-git: + needs: init strategy: fail-fast: false matrix: - runner: - - ubuntu-24.04 - - ubuntu-22.04 - - ubuntu-24.04-arm - - ubuntu-22.04-arm - - macos-15 - - macos-26 - - macos-15-intel - - macos-26-intel - git-version: - - "2.34.1" # Ubuntu 22.04 LTS (Jammy) — oldest supported LTS, ships 1:2.34.1-1ubuntu1 - - "2.39.5" # Debian 12 (Bookworm) — ships 1:2.39.5-0+deb12u3, reported failing in #1029 - - "2.47.3" # Debian 13 (Trixie) + Alpine 3.21 — ships 1:2.47.3-0+deb13u1, also failing in #1029 - - "2.53.0" # Latest stable (2026-02-02) — first version in matrix with cat-file --batch --filter= (added in 2.50.0) + runner: ${{ fromJSON(needs.init.outputs.runners) }} + git-version: ${{ fromJSON(needs.init.outputs.git-versions) }} runs-on: ${{ matrix.runner }} name: build-git (${{ matrix.runner }}, git ${{ matrix.git-version }}) steps: @@ -74,24 +80,12 @@ jobs: retention-days: 1 test: - needs: build-git + needs: [init, build-git] strategy: fail-fast: false matrix: - runner: - - ubuntu-24.04 - - ubuntu-22.04 - - ubuntu-24.04-arm - - ubuntu-22.04-arm - - macos-15 - - macos-26 - - macos-15-intel - - macos-26-intel - git-version: - - "2.34.1" # Ubuntu 22.04 LTS (Jammy) — oldest supported LTS, ships 1:2.34.1-1ubuntu1 - - "2.39.5" # Debian 12 (Bookworm) — ships 1:2.39.5-0+deb12u3, reported failing in #1029 - - "2.47.3" # Debian 13 (Trixie) + Alpine 3.21 — ships 1:2.47.3-0+deb13u1, also failing in #1029 - - "2.53.0" # Latest stable (2026-02-02) — first version in matrix with cat-file --batch --filter= (added in 2.50.0) + runner: ${{ fromJSON(needs.init.outputs.runners) }} + git-version: ${{ fromJSON(needs.init.outputs.git-versions) }} runs-on: ${{ matrix.runner }} name: test (${{ matrix.runner }}, git ${{ matrix.git-version }}) steps: From 965d8399a50f797df2c531784680bda164ea8b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Tue, 31 Mar 2026 13:41:24 +0200 Subject: [PATCH 04/11] ci: add universal-ctags build-from-source matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build universal-ctags from source alongside git, using the same pattern (cache + artifact + per-runner build). Two versions: - p5.9.20210829.0: Ubuntu 22.04/24.04 LTS default (2021 snapshot) - v6.2.1: latest stable, matches Homebrew and Alpine Edge Uses --program-prefix=universal- and --enable-json to match the existing install-ctags-alpine.sh flags. Test matrix is now 8 runners × 4 git versions × 2 ctags versions = 64 combinations. --- .github/workflows/ci.yml | 83 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 76 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b846b289b..5a7442e18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: outputs: runners: ${{ steps.matrix.outputs.runners }} git-versions: ${{ steps.matrix.outputs.git-versions }} + ctags-versions: ${{ steps.matrix.outputs.ctags-versions }} steps: - name: Define matrix id: matrix @@ -22,6 +23,10 @@ jobs: # 2.47.3 — Debian 13 (Trixie) + Alpine 3.21, ships 1:2.47.3-0+deb13u1, also failing in #1029 # 2.53.0 — Latest stable (2026-02-02), first version with cat-file --batch --filter= (added in 2.50.0) echo 'git-versions=["2.34.1","2.39.5","2.47.3","2.53.0"]' >> "$GITHUB_OUTPUT" + # Universal-ctags versions to test against: + # p5.9.20210829.0 — Ubuntu 22.04/24.04 LTS, ships 5.9.20210829.0-1 (2021-08-29 snapshot) + # v6.2.1 — Latest stable, matches Homebrew and Alpine Edge + echo 'ctags-versions=["p5.9.20210829.0","v6.2.1"]' >> "$GITHUB_OUTPUT" build-git: needs: init @@ -79,15 +84,68 @@ jobs: path: ~/git-install retention-days: 1 + build-ctags: + needs: init + strategy: + fail-fast: false + matrix: + runner: ${{ fromJSON(needs.init.outputs.runners) }} + ctags-version: ${{ fromJSON(needs.init.outputs.ctags-versions) }} + runs-on: ${{ matrix.runner }} + name: build-ctags (${{ matrix.runner }}, ctags ${{ matrix.ctags-version }}) + steps: + - name: Cache ctags build + id: cache-ctags + uses: actions/cache@v5.0.4 + with: + path: ~/ctags-install + key: ctags-${{ matrix.ctags-version }}-${{ matrix.runner }} + + - name: Install build dependencies (Linux) + if: runner.os == 'Linux' && steps.cache-ctags.outputs.cache-hit != 'true' + run: | + sudo apt-get update + sudo apt-get install -y gcc make pkg-config autoconf automake libjansson-dev libyaml-dev libxml2-dev + + - name: Install build dependencies (macOS) + if: runner.os == 'macOS' && steps.cache-ctags.outputs.cache-hit != 'true' + run: brew install autoconf automake pkg-config jansson libyaml pcre2 + + - name: Build universal-ctags from source + if: steps.cache-ctags.outputs.cache-hit != 'true' + run: | + curl -fsSL "https://github.com/universal-ctags/ctags/archive/refs/tags/${{ matrix.ctags-version }}.tar.gz" | tar xz + cd ctags-*/ + + NPROC=$(nproc 2>/dev/null || sysctl -n hw.ncpu) + + ./autogen.sh + ./configure --prefix="$HOME/ctags-install" --program-prefix=universal- --enable-json + make -j"$NPROC" + make install + + - name: Verify ctags build + run: | + "$HOME/ctags-install/bin/universal-ctags" --version + "$HOME/ctags-install/bin/universal-ctags" --version | grep -q "Universal Ctags" + + - name: Upload ctags binaries + uses: actions/upload-artifact@v7.0.0 + with: + name: ctags-${{ matrix.ctags-version }}-${{ matrix.runner }} + path: ~/ctags-install + retention-days: 1 + test: - needs: [init, build-git] + needs: [init, build-git, build-ctags] strategy: fail-fast: false matrix: runner: ${{ fromJSON(needs.init.outputs.runners) }} git-version: ${{ fromJSON(needs.init.outputs.git-versions) }} + ctags-version: ${{ fromJSON(needs.init.outputs.ctags-versions) }} runs-on: ${{ matrix.runner }} - name: test (${{ matrix.runner }}, git ${{ matrix.git-version }}) + name: test (${{ matrix.runner }}, git ${{ matrix.git-version }}, ctags ${{ matrix.ctags-version }}) steps: - name: Checkout uses: actions/checkout@v6.0.2 @@ -108,20 +166,31 @@ jobs: chmod -R +x "$HOME/git-install/bin" "$HOME/git-install/libexec" echo "$HOME/git-install/bin" >> "$GITHUB_PATH" - - name: Install universal-ctags (Linux) + - name: Download ctags binaries + uses: actions/download-artifact@v8.0.1 + with: + name: ctags-${{ matrix.ctags-version }}-${{ matrix.runner }} + path: ~/ctags-install + + - name: Add ctags to PATH + run: | + chmod -R +x "$HOME/ctags-install/bin" + echo "$HOME/ctags-install/bin" >> "$GITHUB_PATH" + + - name: Install ctags runtime dependencies (Linux) if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y universal-ctags + run: sudo apt-get update && sudo apt-get install -y libjansson4 libyaml-0-2 libxml2 - - name: Install universal-ctags (macOS) + - name: Install ctags runtime dependencies (macOS) if: runner.os == 'macOS' - run: brew install universal-ctags + run: brew install jansson libyaml pcre2 - name: Print versions run: | go version git --version git --version | grep -q "${{ matrix.git-version }}" - universal-ctags --version || true + universal-ctags --version - name: Test run: go test ./... From 180e3808cdcaf46265445796cb639c05c90000d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Tue, 31 Mar 2026 15:11:25 +0200 Subject: [PATCH 05/11] ci: add gettext to macOS git build dependencies gettext is keg-only on Homebrew, so libintl.h is not in the default include path. Add it to brew install and CFLAGS/LDFLAGS. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a7442e18..9e23d3445 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - name: Install build dependencies (macOS) if: runner.os == 'macOS' && steps.cache-git.outputs.cache-hit != 'true' - run: brew install openssl curl expat + run: brew install openssl curl expat gettext - name: Build git from source if: steps.cache-git.outputs.cache-hit != 'true' @@ -65,8 +65,8 @@ jobs: if [ "$RUNNER_OS" = "macOS" ]; then BREW_PREFIX=$(brew --prefix) - export CFLAGS="-I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/opt/curl/include -I${BREW_PREFIX}/opt/expat/include" - export LDFLAGS="-L${BREW_PREFIX}/opt/openssl/lib -L${BREW_PREFIX}/opt/curl/lib -L${BREW_PREFIX}/opt/expat/lib" + export CFLAGS="-I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/opt/curl/include -I${BREW_PREFIX}/opt/expat/include -I${BREW_PREFIX}/opt/gettext/include" + export LDFLAGS="-L${BREW_PREFIX}/opt/openssl/lib -L${BREW_PREFIX}/opt/curl/lib -L${BREW_PREFIX}/opt/expat/lib -L${BREW_PREFIX}/opt/gettext/lib" fi make prefix="$HOME/git-install" -j"$NPROC" all From 36d7705b7c3feee32839cc9b4c6a8225b94f5289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Tue, 31 Mar 2026 15:17:25 +0200 Subject: [PATCH 06/11] ci: always install deps regardless of cache hit The verify step runs unconditionally but dynamically-linked binaries need their runtime deps present. Removing the cache-miss condition from dep install steps ensures dylibs are always available. brew/apt install are idempotent and fast when packages are already present. --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e23d3445..6f7ae26a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,14 +45,14 @@ jobs: path: ~/git-install key: git-${{ matrix.git-version }}-${{ matrix.runner }} - - name: Install build dependencies (Linux) - if: runner.os == 'Linux' && steps.cache-git.outputs.cache-hit != 'true' + - name: Install dependencies (Linux) + if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install -y make libssl-dev libcurl4-gnutls-dev libexpat1-dev libz-dev gettext - - name: Install build dependencies (macOS) - if: runner.os == 'macOS' && steps.cache-git.outputs.cache-hit != 'true' + - name: Install dependencies (macOS) + if: runner.os == 'macOS' run: brew install openssl curl expat gettext - name: Build git from source @@ -101,14 +101,14 @@ jobs: path: ~/ctags-install key: ctags-${{ matrix.ctags-version }}-${{ matrix.runner }} - - name: Install build dependencies (Linux) - if: runner.os == 'Linux' && steps.cache-ctags.outputs.cache-hit != 'true' + - name: Install dependencies (Linux) + if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install -y gcc make pkg-config autoconf automake libjansson-dev libyaml-dev libxml2-dev - - name: Install build dependencies (macOS) - if: runner.os == 'macOS' && steps.cache-ctags.outputs.cache-hit != 'true' + - name: Install dependencies (macOS) + if: runner.os == 'macOS' run: brew install autoconf automake pkg-config jansson libyaml pcre2 - name: Build universal-ctags from source From 00ddf88f5666b7239ce5cb85bd106684e6a04c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Tue, 31 Mar 2026 15:18:23 +0200 Subject: [PATCH 07/11] ci: let git Makefile auto-detect Homebrew deps on macOS Git's config.mak.uname already auto-detects Homebrew prefix and finds gettext, libiconv, openssl paths. Manual CFLAGS/LDFLAGS were redundant and could conflict with the build system's own detection. --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f7ae26a9..e5f456bbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,12 +63,6 @@ jobs: NPROC=$(nproc 2>/dev/null || sysctl -n hw.ncpu) - if [ "$RUNNER_OS" = "macOS" ]; then - BREW_PREFIX=$(brew --prefix) - export CFLAGS="-I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/opt/curl/include -I${BREW_PREFIX}/opt/expat/include -I${BREW_PREFIX}/opt/gettext/include" - export LDFLAGS="-L${BREW_PREFIX}/opt/openssl/lib -L${BREW_PREFIX}/opt/curl/lib -L${BREW_PREFIX}/opt/expat/lib -L${BREW_PREFIX}/opt/gettext/lib" - fi - make prefix="$HOME/git-install" -j"$NPROC" all make prefix="$HOME/git-install" install From 3069942afacb87ba82ec11780978eada2f10f606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Tue, 31 Mar 2026 15:24:02 +0200 Subject: [PATCH 08/11] Revert "ci: let git Makefile auto-detect Homebrew deps on macOS" This reverts commit 00ddf88f. Git's config.mak.uname Homebrew auto-detection for gettext was added after git 2.34.1, so older versions fail with 'libintl.h' not found on macOS. Restore explicit CFLAGS/LDFLAGS to support all git versions in the matrix. --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5f456bbd..1864cd5f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,18 @@ jobs: NPROC=$(nproc 2>/dev/null || sysctl -n hw.ncpu) + # On macOS, Homebrew keg-only packages (openssl, curl, gettext) are + # not linked into the default search paths. Git's config.mak.uname + # gained Homebrew auto-detection for gettext around v2.47, but older + # versions in our matrix (2.34.1, 2.39.5) lack it and fail with + # 'libintl.h' not found. Explicit CFLAGS/LDFLAGS ensure all versions + # build consistently. See: git INSTALL docs, config.mak.uname. + if [ "$RUNNER_OS" = "macOS" ]; then + BREW_PREFIX=$(brew --prefix) + export CFLAGS="-I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/opt/curl/include -I${BREW_PREFIX}/opt/expat/include -I${BREW_PREFIX}/opt/gettext/include" + export LDFLAGS="-L${BREW_PREFIX}/opt/openssl/lib -L${BREW_PREFIX}/opt/curl/lib -L${BREW_PREFIX}/opt/expat/lib -L${BREW_PREFIX}/opt/gettext/lib" + fi + make prefix="$HOME/git-install" -j"$NPROC" all make prefix="$HOME/git-install" install From 21b8da5cc70bbfd168b4a16ef82cd43698256bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Wed, 1 Apr 2026 11:07:09 +0200 Subject: [PATCH 09/11] ci: use CPPFLAGS instead of CFLAGS for macOS include paths Git's Makefile sets CFLAGS = -g -O2 -Wall which overrides the env var. CPPFLAGS is preserved via ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS), so keg-only Homebrew include paths (gettext, openssl, etc.) are actually picked up by the compiler. --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1864cd5f5..95bc39bc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,11 +67,12 @@ jobs: # not linked into the default search paths. Git's config.mak.uname # gained Homebrew auto-detection for gettext around v2.47, but older # versions in our matrix (2.34.1, 2.39.5) lack it and fail with - # 'libintl.h' not found. Explicit CFLAGS/LDFLAGS ensure all versions - # build consistently. See: git INSTALL docs, config.mak.uname. + # 'libintl.h' not found. We use CPPFLAGS/LDFLAGS (not CFLAGS) because + # git's Makefile overrides CFLAGS but preserves CPPFLAGS via + # ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS). if [ "$RUNNER_OS" = "macOS" ]; then BREW_PREFIX=$(brew --prefix) - export CFLAGS="-I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/opt/curl/include -I${BREW_PREFIX}/opt/expat/include -I${BREW_PREFIX}/opt/gettext/include" + export CPPFLAGS="-I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/opt/curl/include -I${BREW_PREFIX}/opt/expat/include -I${BREW_PREFIX}/opt/gettext/include" export LDFLAGS="-L${BREW_PREFIX}/opt/openssl/lib -L${BREW_PREFIX}/opt/curl/lib -L${BREW_PREFIX}/opt/expat/lib -L${BREW_PREFIX}/opt/gettext/lib" fi From 34ef5db155d8a96c09525299240c3b5bd481fda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Wed, 1 Apr 2026 15:18:57 +0200 Subject: [PATCH 10/11] ci: pass CPPFLAGS/LDFLAGS on make command line, not as env vars Git's Makefile overrides both CFLAGS and LDFLAGS env vars with its own assignments. Only command-line arguments to make take precedence over Makefile assignments. Previous fix solved the compile step (CPPFLAGS for headers) but the linker still couldn't find libintl because LDFLAGS was being overridden. --- .github/workflows/ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95bc39bc8..050ba1766 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,19 +65,19 @@ jobs: # On macOS, Homebrew keg-only packages (openssl, curl, gettext) are # not linked into the default search paths. Git's config.mak.uname - # gained Homebrew auto-detection for gettext around v2.47, but older - # versions in our matrix (2.34.1, 2.39.5) lack it and fail with - # 'libintl.h' not found. We use CPPFLAGS/LDFLAGS (not CFLAGS) because - # git's Makefile overrides CFLAGS but preserves CPPFLAGS via - # ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS). + # gained Homebrew auto-detection around v2.47, but older versions + # (2.34.1, 2.39.5) lack it. Git's Makefile overrides CFLAGS and + # LDFLAGS env vars, so we pass them on the make command line where + # they take precedence over Makefile assignments. + MAKE_ARGS="prefix=$HOME/git-install" if [ "$RUNNER_OS" = "macOS" ]; then BREW_PREFIX=$(brew --prefix) - export CPPFLAGS="-I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/opt/curl/include -I${BREW_PREFIX}/opt/expat/include -I${BREW_PREFIX}/opt/gettext/include" - export LDFLAGS="-L${BREW_PREFIX}/opt/openssl/lib -L${BREW_PREFIX}/opt/curl/lib -L${BREW_PREFIX}/opt/expat/lib -L${BREW_PREFIX}/opt/gettext/lib" + MAKE_ARGS="$MAKE_ARGS CPPFLAGS=-I${BREW_PREFIX}/opt/openssl/include\ -I${BREW_PREFIX}/opt/curl/include\ -I${BREW_PREFIX}/opt/expat/include\ -I${BREW_PREFIX}/opt/gettext/include" + MAKE_ARGS="$MAKE_ARGS LDFLAGS=-L${BREW_PREFIX}/opt/openssl/lib\ -L${BREW_PREFIX}/opt/curl/lib\ -L${BREW_PREFIX}/opt/expat/lib\ -L${BREW_PREFIX}/opt/gettext/lib" fi - make prefix="$HOME/git-install" -j"$NPROC" all - make prefix="$HOME/git-install" install + make $MAKE_ARGS -j"$NPROC" all + make $MAKE_ARGS install - name: Verify git build run: | From 030ba7ede43884528d7f9154dc6faeb71e4ae1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Thu, 2 Apr 2026 15:40:31 +0200 Subject: [PATCH 11/11] ci: use config.mak for macOS Homebrew paths instead of make args MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shell quoting with make command-line variables is fragile — spaces in CPPFLAGS/LDFLAGS caused make to interpret paths as options. Git's Makefile auto-includes config.mak, so writing the paths there avoids all quoting issues. Uses += to append to existing flags. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 050ba1766..f105c77c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,21 +63,23 @@ jobs: NPROC=$(nproc 2>/dev/null || sysctl -n hw.ncpu) - # On macOS, Homebrew keg-only packages (openssl, curl, gettext) are - # not linked into the default search paths. Git's config.mak.uname - # gained Homebrew auto-detection around v2.47, but older versions - # (2.34.1, 2.39.5) lack it. Git's Makefile overrides CFLAGS and - # LDFLAGS env vars, so we pass them on the make command line where - # they take precedence over Makefile assignments. - MAKE_ARGS="prefix=$HOME/git-install" + # On macOS, Homebrew keg-only packages (openssl, curl, expat, + # gettext) are not linked into the default search paths. + # Git's config.mak.uname has partial Homebrew auto-detection: + # - gettext: since git 2.27 (Intel), 2.44 (ARM) + # - openssl, curl, expat: NOT auto-detected in any version + # Git's Makefile uses -include config.mak (silently skipped if + # absent), so we write paths there. Uses += to append to flags. if [ "$RUNNER_OS" = "macOS" ]; then BREW_PREFIX=$(brew --prefix) - MAKE_ARGS="$MAKE_ARGS CPPFLAGS=-I${BREW_PREFIX}/opt/openssl/include\ -I${BREW_PREFIX}/opt/curl/include\ -I${BREW_PREFIX}/opt/expat/include\ -I${BREW_PREFIX}/opt/gettext/include" - MAKE_ARGS="$MAKE_ARGS LDFLAGS=-L${BREW_PREFIX}/opt/openssl/lib\ -L${BREW_PREFIX}/opt/curl/lib\ -L${BREW_PREFIX}/opt/expat/lib\ -L${BREW_PREFIX}/opt/gettext/lib" + printf '%s\n' \ + "CPPFLAGS += -I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/opt/curl/include -I${BREW_PREFIX}/opt/expat/include -I${BREW_PREFIX}/opt/gettext/include" \ + "LDFLAGS += -L${BREW_PREFIX}/opt/openssl/lib -L${BREW_PREFIX}/opt/curl/lib -L${BREW_PREFIX}/opt/expat/lib -L${BREW_PREFIX}/opt/gettext/lib" \ + > config.mak fi - make $MAKE_ARGS -j"$NPROC" all - make $MAKE_ARGS install + make prefix="$HOME/git-install" -j"$NPROC" all + make prefix="$HOME/git-install" install - name: Verify git build run: |