Xcode 16 beta was released on 2024-06-10 and ships with macOS SDK 15.0 [1]. It appears PostgreSQL does not compile due to typedef redefiniton errors in the regex library:
/tmp/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -O2 -I../../../src/include -isysroot /tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -c -o regcomp.o regcomp.c In file included from regcomp.c:2647: In file included from ./regc_pg_locale.c:21: In file included from ../../../src/include/utils/pg_locale.h:16: In file included from /tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/xlocale.h:45: In file included from /tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/xlocale/_regex.h:27: /tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/_regex.h:107:24: error: typedef redefinition with different types ('__darwin_off_t' (aka 'long long') vs 'long') 107 | typedef __darwin_off_t regoff_t; | ^ ../../../src/include/regex/regex.h:48:14: note: previous definition is here 48 | typedef long regoff_t; | ^ In file included from regcomp.c:2647: In file included from ./regc_pg_locale.c:21: In file included from ../../../src/include/utils/pg_locale.h:16: In file included from /tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/xlocale.h:45: In file included from /tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/xlocale/_regex.h:27: /tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/_regex.h:114:3: error: typedef redefinition with different types ('struct regex_t' vs 'struct regex_t') 114 | } regex_t; | ^ ../../../src/include/regex/regex.h:82:3: note: previous definition is here 82 | } regex_t; | ^ In file included from regcomp.c:2647: In file included from ./regc_pg_locale.c:21: In file included from ../../../src/include/utils/pg_locale.h:16: In file included from /tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/xlocale.h:45: In file included from /tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/xlocale/_regex.h:27: /tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/_regex.h:119:3: error: typedef redefinition with different types ('struct regmatch_t' vs 'struct regmatch_t') 119 | } regmatch_t; | ^ ../../../src/include/regex/regex.h:89:3: note: previous definition is here 89 | } regmatch_t; | ^ 3 errors generated. make[3]: *** [regcomp.o] Error 1 make[2]: *** [regex-recursive] Error 2 make[1]: *** [all-backend-recurse] Error 2 make: *** [all-src-recurse] Error 2 I've reproduced this issue by: 1. Download the XCode 16 beta 2 ZIP file: https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_16_beta/Xcode_16_beta.xip 2. Extract this to `/tmp`. 3. Then I ran: export PATH=/tmp/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH export SDKROOT=/tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk export XCODE_DIR=/tmp/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain export CC="$XCODE_DIR/usr/bin/clang" export CXX="$XCODE_DIR/usr/bin/clang++" ./configure CC="$CC" CXX="$CXX" make The compilation goes through if I comment out the "#include <xlocale/_regex.h>" from /tmp/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/xlocale.h. However, even on macOS SDK 14.5 I see that include statement. I'm still trying to figure out what changed here. [1] - https://developer.apple.com/macos/