From 685f2815265c9c0fbdb92544de6c476fb8a33f3d Mon Sep 17 00:00:00 2001 From: native-api Date: Fri, 8 Aug 2025 23:05:49 +0300 Subject: [PATCH] Skip Zlib from XCode for XCode 16+ (#3298) It breaks the build due to yet unknown structural changes from XCode 15 --- plugins/python-build/bin/python-build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 69b617e3..60ace186 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -1826,8 +1826,13 @@ use_homebrew_zlib() { } use_xcode_sdk_zlib() { + local xcode_major; # If a custom compiler is used, including XCode SDK will likely break it [[ "${CC:-clang}" != "clang" || "$(command -v clang 2>/dev/null || true)" != "/usr/bin/clang" ]] && return 1 + # The flags set by this function break the build in XCode 16 due to unknown changes from XCode 15 + # For future-proofing, also disable it if we cannot determine the version + [[ $(xcodebuild -version) =~ ^Xcode\ ([[:digit:]]+) ]] && xcode_major="${BASH_REMATCH[1]}" + [[ -z $xcode_major || $xcode_major -ge 16 ]] && return 1 local xc_sdk_path="$(xcrun --show-sdk-path 2>/dev/null || true)" if [ -d "$xc_sdk_path" ]; then echo "python-build: use zlib from xcode sdk"