Skip to content

Commit 430511c

Browse files
clemlesneclaude
andcommitted
ci: use config.mak for macOS Homebrew paths instead of make args
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) <noreply@anthropic.com>
1 parent 34ef5db commit 430511c

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,19 @@ jobs:
6666
# On macOS, Homebrew keg-only packages (openssl, curl, gettext) are
6767
# not linked into the default search paths. Git's config.mak.uname
6868
# gained Homebrew auto-detection around v2.47, but older versions
69-
# (2.34.1, 2.39.5) lack it. Git's Makefile overrides CFLAGS and
70-
# LDFLAGS env vars, so we pass them on the make command line where
71-
# they take precedence over Makefile assignments.
72-
MAKE_ARGS="prefix=$HOME/git-install"
69+
# (2.34.1, 2.39.5) lack it. Git's Makefile auto-includes config.mak,
70+
# so we write the paths there to avoid shell quoting issues with
71+
# make command-line variables.
7372
if [ "$RUNNER_OS" = "macOS" ]; then
7473
BREW_PREFIX=$(brew --prefix)
75-
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"
76-
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"
74+
cat > config.mak <<CFGEOF
75+
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
76+
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
77+
CFGEOF
7778
fi
7879
79-
make $MAKE_ARGS -j"$NPROC" all
80-
make $MAKE_ARGS install
80+
make prefix="$HOME/git-install" -j"$NPROC" all
81+
make prefix="$HOME/git-install" install
8182
8283
- name: Verify git build
8384
run: |

0 commit comments

Comments
 (0)