-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use of private zstd POOL_* APIs prevents linking against shared zstd library #106
Comments
We currently make use of the private zstandard APIs unconditionally. And we don't make attempts to support zstandard library versions that don't match the bundled version. I concede that both of these traits are sub-optimal. zstandard uses its own threads internally for C code and we cannot use Python's The proper solution here is to make the build system and run-time code more adaptive to varying system environments. This is on the roadmap for a 1.0 release. It just hasn't been a priority so far. |
This issue is also problematic for people who use source-based build systems like buck. Now that zstd has switched to using relative includes for non-public headers like As a short-term fix, would it be possible to copy zstd's |
@terrelln this came up again after the 0.15.0 release of this package and the transition to the single file zstd library. The problem is that some C code in this Python package makes use of private APIs in From my perspective, the easy fix is for libzstd to expose these pool APIs from the public Long term, I can work around this by removing the C backend and reimplementing things in Rust. The reason I'm using the Anyway, I plan to work around this in 0.15.1 by distributing the |
I think I'm going to make a backwards-incompatible change to disable the experimental APIs relying on |
The pool APIs are not exported from the library nor are they present in public headers. This commit changes behavior of the C backend to conditionally enable features relying on these symbols. The practical effect is that these features will only be available if building against the single file / bundled libzstd and will no longer be available when building against a system libzstd. This effectively closes #106. A side-effect of this change is that --system-zstd likely regressed due to inability to find zstd headers. We'll need to add a setup.py argument to plumb the header search path through. But this was a pre-existing condition.
I think that is the best way forward. Alternatively, you could copy Though, if you're willing to add a rust (or C++) toolchain to the build process, it would be much easier to just use a rust implementation, because it already has cross-platform threads. |
This module has a
--system-zstd
option insetup.py
, but it doesn't work as expected, because the bundled zstd copy (#48) is compiled anyway. I found that it's almost possible to delete the bundled zstd, but one has to remove all references to the internal zstd POOL_* APIs. Does this module really need to (ab)use internal zstd APIs? Could the multi-threaded mode be implemented in some other way? Maybe using the standard Pool interface with multiprocessing.dummy?My use-case is packaging zstandard for use in Fedora and we have, like many other distributions, specific provisions against bundling, mostly for security reasons in our packaging guidelines. I'd really appreciate it if I could simply
rm -rf zstd
and still have the module build with--system-zstd
and link to the shared system libzstd then.The text was updated successfully, but these errors were encountered: