Fix static-only wolfSSL linking, improve FFI import errors, and fix make dist#64
Open
cconlon wants to merge 3 commits intowolfSSL:masterfrom
Open
Fix static-only wolfSSL linking, improve FFI import errors, and fix make dist#64cconlon wants to merge 3 commits intowolfSSL:masterfrom
cconlon wants to merge 3 commits intowolfSSL:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes local/static wolfSSL builds producing a broken _ffi module, improves the user-facing failure mode when CFFI bindings aren’t available, and repairs the make dist packaging target.
Changes:
- Switch static-only linking to pass
libwolfssl.aviaextra_objectsrather than-lwolfssl - Replace silent
_ffiimport failures with a placeholder that raises an actionable error - Improve lib detection (
.dylibsupport) and simplifymake distto build sdist + wheel
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfssl/utils.py | Introduces an _ffi placeholder object to surface meaningful import-time failures |
| wolfssl/_methods.py | Uses the placeholder on _ffi import failure and adjusts destructor guard logic |
| wolfssl/_build_ffi.py | Adds robust lib path discovery, optional function probing changes, and static archive linking support |
| wolfssl/init.py | Uses the placeholder on _ffi import failure and adjusts destructor guard logic |
| Makefile | Fixes dist target by building sdist + wheel without missing scripts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…lder that raises ImportError with instructions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes issue #40 where
USE_LOCAL_WOLFSSLwith a static-only wolfSSL build fails to produce a working_ffimodule, and users get aNameErrorinstead of a useful error message..aarchives directly viaextra_objectsinstead of-lwolfssl, which the linker can't resolve without a shared library presentexcept ImportError: passwith_FFIPlaceholderthat raisesImportErrorwith instructionslibwolfssl_pathglobal that was always"", breaking optional function detection.dylibdetection for macOS alongside.somake disttarget that referenced missing./make/osx/and./make/manylinux1/scripts__del__methods to avoid triggering the placeholder during garbage collection