Skip to content

Commit 4a97aac

Browse files
arman-bdclaude
andcommitted
fix: build nghttp2 from source on macOS for wheel compatibility
- Remove Homebrew nghttp2 dependency on macOS to avoid deployment target conflicts - Build nghttp2 from source for better macOS version compatibility - Add --ignore-missing-dependencies to delocate-wheel for static linking - This allows wheels to work on older macOS versions (11.0+) instead of requiring 15.0+ The issue was that Homebrew's libnghttp2 is compiled for macOS 15.0+, causing delocate-wheel to fail when building wheels for macOS 11.0. By building from source, we can target older macOS versions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent abfe40a commit 4a97aac

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ before-build = "bash scripts/setup_vendors.sh"
131131

132132
[tool.cibuildwheel.macos]
133133
before-all = [
134-
"brew install cmake ninja openssl@3 libnghttp2 go",
134+
"brew install cmake ninja go",
135135
]
136136
before-build = "bash scripts/setup_vendors.sh"
137+
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel} --ignore-missing-dependencies"
137138

138139
[tool.cibuildwheel.windows]
139140
before-all = [

scripts/setup_vendors.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,8 @@ fi
163163
echo ""
164164
echo "==> Setting up nghttp2..."
165165

166-
# On macOS, use Homebrew's nghttp2 if available
167-
if [ "$OS" = "Darwin" ] && command -v brew &> /dev/null && brew list libnghttp2 &> /dev/null; then
168-
echo "✓ Using Homebrew's libnghttp2"
169-
echo " Location: $(brew --prefix libnghttp2)"
170166
# On Windows with vcpkg, use vcpkg's nghttp2
171-
elif [ "$OS" = "Windows" ] && [ -n "$VCPKG_ROOT" ] && [ -d "$VCPKG_ROOT/installed/x64-windows" ]; then
167+
if [ "$OS" = "Windows" ] && [ -n "$VCPKG_ROOT" ] && [ -d "$VCPKG_ROOT/installed/x64-windows" ]; then
172168
echo "✓ Using vcpkg's nghttp2"
173169
echo " Location: $VCPKG_ROOT/installed/x64-windows"
174170
# On Windows with MSYS2, use the MSYS2 package
@@ -238,9 +234,7 @@ echo " ✓ BoringSSL: $VENDOR_DIR/boringssl/build"
238234
if [ "$OS" = "Linux" ]; then
239235
echo " ✓ liburing: $VENDOR_DIR/liburing/install"
240236
fi
241-
if [ "$OS" = "Darwin" ] && command -v brew &> /dev/null && brew list libnghttp2 &> /dev/null; then
242-
echo " ✓ nghttp2: $(brew --prefix libnghttp2) (Homebrew)"
243-
elif [ "$OS" = "Windows" ] && [ -n "$VCPKG_ROOT" ] && [ -d "$VCPKG_ROOT/installed/x64-windows" ]; then
237+
if [ "$OS" = "Windows" ] && [ -n "$VCPKG_ROOT" ] && [ -d "$VCPKG_ROOT/installed/x64-windows" ]; then
244238
echo " ✓ nghttp2: $VCPKG_ROOT/installed/x64-windows (vcpkg)"
245239
elif [ "$OS" = "Windows" ] && [ -d "/mingw64/include/nghttp2" ]; then
246240
echo " ✓ nghttp2: /mingw64 (MSYS2)"

0 commit comments

Comments
 (0)