Skip to content

Commit 7a8a98b

Browse files
arman-bdclaude
andcommitted
debug: add BoringSSL build directory inspection to find library locations
This will help us understand where BoringSSL actually places libssl.a and libcrypto.a during the build process on macOS. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9308a08 commit 7a8a98b

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed

setup.py

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,43 @@ 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
126125
vendor_boringssl = vendor_dir / "boringssl"
127126
boringssl_include = str(vendor_boringssl / "include")
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")
127+
128+
# Check where BoringSSL actually built the libraries
129+
# It could be in build/ssl/, build/crypto/, or just build/
130+
build_dir = vendor_boringssl / "build"
131+
132+
# Debug: list what's actually in the build directory
133+
import os
134+
if build_dir.exists():
135+
print(f"\n=== BoringSSL build directory contents ===")
136+
for item in os.listdir(build_dir):
137+
item_path = build_dir / item
138+
if item_path.is_dir():
139+
print(f" DIR: {item}/")
140+
# Check for .a files in subdirectories
141+
try:
142+
for subitem in os.listdir(item_path):
143+
if subitem.endswith('.a'):
144+
print(f" LIB: {subitem}")
145+
except PermissionError:
146+
pass
147+
elif item.endswith('.a'):
148+
print(f" LIB: {item}")
149+
print("=" * 43 + "\n")
150+
151+
# Determine library directory based on what exists
152+
if (build_dir / "ssl" / "libssl.a").exists():
153+
boringssl_lib = str(build_dir / "ssl")
154+
print(f"Using BoringSSL from: {boringssl_lib}")
155+
elif (build_dir / "libssl.a").exists():
156+
boringssl_lib = str(build_dir)
157+
print(f"Using BoringSSL from: {boringssl_lib}")
158+
else:
159+
# Fallback to build/ssl even if it doesn't exist yet
160+
boringssl_lib = str(build_dir / "ssl")
161+
print(f"WARNING: BoringSSL libraries not found, using default: {boringssl_lib}")
131162

132163
# nghttp2 - prefer vendor build for wheel compatibility
133164
vendor_nghttp2 = vendor_dir / "nghttp2" / "install"
@@ -153,7 +184,7 @@ def get_library_paths():
153184

154185
return {
155186
"openssl_include": boringssl_include,
156-
"openssl_lib": [boringssl_lib_ssl, boringssl_lib_crypto], # Return as list
187+
"openssl_lib": boringssl_lib,
157188
"nghttp2_include": nghttp2_include,
158189
"nghttp2_lib": nghttp2_lib,
159190
}

0 commit comments

Comments
 (0)