Skip to content

Commit 4f8c297

Browse files
committed
Fix build git installers in v2.53.0 rc1 (git-for-windows#852)
This includes the fixes I had to make to get https://github.com/microsoft/git/releases/tag/v2.53.0-rc0.vfs.0.0 to build, plus a fix for an overlooked stale `GIT-VERSION-GEN`,
2 parents aca4543 + 1443abd commit 4f8c297

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

.github/workflows/build-git-installers.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ jobs:
408408
brew link --force gettext
409409
410410
# Make universal gettext library
411+
# Note: libintl depends on iconv, but we use the system's libiconv
412+
# which is already universal, rather than Homebrew's libiconv which
413+
# has different symbol names (_libiconv vs _iconv)
411414
lipo -create -output libintl.a /usr/local/opt/gettext/lib/libintl.a /opt/homebrew/opt/gettext/lib/libintl.a
412415
413416
- name: Log in to Azure
@@ -487,9 +490,24 @@ jobs:
487490
# used in 'git version --build-options'. We'll fix that in code.
488491
HOST_CPU = universal
489492
BASIC_CFLAGS += -arch arm64 -arch x86_64
493+
494+
# macOS uses Apple Common Crypto instead of OpenSSL. The main Makefile
495+
# sets NO_OPENSSL and adds -DNO_OPENSSL to BASIC_CFLAGS, but contrib
496+
# Makefiles that only include config.mak* don't get this logic.
497+
BASIC_CFLAGS += -DNO_OPENSSL
498+
499+
# CRITICAL FIX: Disable USE_HOMEBREW_LIBICONV
500+
# On Darwin 24+ (macOS 15), config.mak.uname sets USE_HOMEBREW_LIBICONV
501+
# which causes ICONVDIR to point to Homebrew's libiconv. But Homebrew's
502+
# libiconv exports _libiconv/_libiconv_open symbols (with prefix), while
503+
# Homebrew's gettext/libintl was built against system iconv which uses
504+
# _iconv/_iconv_open symbols (no prefix). We must use the system's
505+
# /usr/lib/libiconv.dylib which is universal and has the correct symbols.
506+
USE_HOMEBREW_LIBICONV =
507+
ICONVDIR =
490508
EOF
491509
492-
# Configure the Git build to pick up gettext
510+
# Configure the Git build to find our universal libintl.a
493511
homebrew_prefix="$(brew --prefix)"
494512
cat >>git/config.mak <<EOF
495513
CFLAGS = -I$homebrew_prefix/include -I/usr/local/opt/gettext/include

contrib/credential/osxkeychain/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ prefix ?= /usr/local
4141
gitexecdir ?= $(prefix)/libexec/git-core
4242

4343
CC ?= gcc
44-
CFLAGS ?= -g -O2 -Wall -I../../.. $(BASIC_CFLAGS)
45-
LDFLAGS ?= $(BASIC_LDFLAGS) $(EXTLIBS)
44+
override CFLAGS += -g -O2 -Wall -I../../.. $(BASIC_CFLAGS)
45+
override LDFLAGS += $(BASIC_LDFLAGS) $(EXTLIBS)
4646
INSTALL ?= install
4747
RM ?= rm -f
4848

0 commit comments

Comments
 (0)