Repository navigation
Conversation
Contributor
Author
|
Sure, will do that now. |
Move the CFFI-related logic from the global scope of `make_cffi.py` file to a `get_ffi()` function. This makes it possible to import the file without executing the code immediately, and it will make it possible to parametrize the invocation using explicit function parameters. Along with the change, I've renamed the variables to lowercase since they are no longer global. Signed-off-by: Michał Górny <[email protected]>
Support using the system zstd library with the CFFI backend. Use the GCC / Clang preprocessor output to find the paths to header files for preprocessing. Link to the system library, matching the behavior for the C backend. Signed-off-by: Michał Górny <[email protected]>
mgorny
force-pushed
the
system-zstd-cffi
branch
from
September 14, 2025 18:59
abfde12 to
5fd00c3
Compare
Contributor
Author
|
Rebased and updated. |
Contributor
Author
|
Hmm, I wonder what's different about zstd on macOS that it fails. Unfortunately, I don't have a macOS system to test. |
Owner
|
Wow - that was a quick rebase! The macOS failure looks legit. We'll need to figure out a path forward there. And I'm pressed for time today. I was planning to cut a release this weekend to help with 3.14 support. So we'll have to defer this to the next release. |
Contributor
Author
|
Yeah, no problem with that. As a last resort, I suppose we could limit system zstd + CFFI to Linux, I guess, and force CFFI with vendored libs elsewhere. |
Given that the CFFI code is much more fragile to library changes than the C extension code, use a separate `--system-zstd-cffi` switch to enable it. This should resolve the test failure on macOS. Signed-off-by: Michał Górny <[email protected]>
Contributor
Author
|
I went for the next best thing, I think: I've added a separate |
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.
make_cffi.pyto avoid performing the compilation in global scope, and allow passing parameters--system-zstdwith the CFFI backend. This uses the C preprocessor to find the system headers for, well, further preprocessing.With these changes, I can successfully build the CFFI extension using system
zstdlibrary, and have it pass tests. I've also confirmed that it builds fine after removing thezstddirectory entirely.