Skip to content

Commit 9308a08

Browse files
arman-bdclaude
andcommitted
fix: add both BoringSSL library directories and add vendor dependency caching
- Return both build/ssl and build/crypto directories for BoringSSL on macOS - Handle openssl_lib being either a string or list for cross-platform compat - Add GitHub Actions cache for vendor dependencies (BoringSSL, nghttp2, liburing) - Cache key includes setup script hash to invalidate on changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 876c50d commit 9308a08

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ jobs:
5252
with:
5353
submodules: recursive
5454

55+
# Cache vendor dependencies (BoringSSL, nghttp2, liburing)
56+
# This cache significantly speeds up builds by avoiding recompilation
57+
# Cache key includes setup script hash to invalidate on script changes
58+
- name: Cache vendor dependencies
59+
uses: actions/cache@v4
60+
with:
61+
path: |
62+
vendor/boringssl/build
63+
vendor/nghttp2/install
64+
vendor/liburing/install
65+
key: vendor-deps-${{ runner.os }}-${{ hashFiles('scripts/setup_vendors.sh') }}
66+
restore-keys: |
67+
vendor-deps-${{ runner.os }}-
68+
5569
- name: Build wheels
5670
uses: pypa/cibuildwheel@v2.22.0
5771

setup.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,12 @@ def get_library_paths():
122122
vendor_dir = Path("vendor").resolve()
123123

124124
# BoringSSL (always vendor-built)
125+
# BoringSSL builds libssl.a and libcrypto.a in separate subdirectories
125126
vendor_boringssl = vendor_dir / "boringssl"
126127
boringssl_include = str(vendor_boringssl / "include")
127-
boringssl_lib = str(vendor_boringssl / "build" / "ssl")
128+
# Return both ssl and crypto lib directories as a list
129+
boringssl_lib_ssl = str(vendor_boringssl / "build" / "ssl")
130+
boringssl_lib_crypto = str(vendor_boringssl / "build" / "crypto")
128131

129132
# nghttp2 - prefer vendor build for wheel compatibility
130133
vendor_nghttp2 = vendor_dir / "nghttp2" / "install"
@@ -150,7 +153,7 @@ def get_library_paths():
150153

151154
return {
152155
"openssl_include": boringssl_include,
153-
"openssl_lib": boringssl_lib,
156+
"openssl_lib": [boringssl_lib_ssl, boringssl_lib_crypto], # Return as list
154157
"nghttp2_include": nghttp2_include,
155158
"nghttp2_lib": nghttp2_lib,
156159
}
@@ -390,17 +393,12 @@ def get_library_paths():
390393

391394
# Define C extension modules
392395
# Build library directories list
393-
# On macOS, BoringSSL builds libssl.a in build/ssl/ and libcrypto.a in build/crypto/
394-
if IS_MACOS:
395-
# Add both ssl and crypto directories for BoringSSL
396-
vendor_dir = Path("vendor").resolve()
397-
vendor_boringssl = vendor_dir / "boringssl"
398-
BORINGSSL_LIB_DIRS = [
399-
str(vendor_boringssl / "build" / "ssl"),
400-
str(vendor_boringssl / "build" / "crypto"),
401-
]
396+
# Handle openssl_lib being either a string or a list
397+
openssl_lib = LIB_PATHS["openssl_lib"]
398+
if isinstance(openssl_lib, list):
399+
BORINGSSL_LIB_DIRS = openssl_lib
402400
else:
403-
BORINGSSL_LIB_DIRS = [LIB_PATHS["openssl_lib"]]
401+
BORINGSSL_LIB_DIRS = [openssl_lib]
404402

405403
# Build include and library directory lists
406404
INCLUDE_DIRS = [

0 commit comments

Comments
 (0)