-
Notifications
You must be signed in to change notification settings - Fork 95
chore: add uncheck-liblzma-version
feature
#342
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
Conversation
liblzma-rs requires a higher version of liblzma to allow dynamic linking by default (see Portable-Network-Archive/liblzma-rs#173 for details), This feature will allow any version of liblzma on the system to use the dynamic linking.
e595a80
to
01b028d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I wonder if adding another feature is necessary?
You could add a dependency to liblzma in your project and enable that feature directly
Hmm, well I'm not sure if I should add it or not |
But I have a question, if I define a version of liblzma-rs that doesn't match the version that async-compression depends on, will the feature be overwritten? |
No you would keep it in sync |
I don't think we should provide proxy features for any of the codecs, you're able to enable these yourself, by adding this to your manifest: liblzma = { version = "0.4.1", features = ["uncheck_liblzma_version"] } |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #342 +/- ##
===========================
===========================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The only thing though is that it causes difficulty for building Rust programs on older platforms (say, Ubuntu 22.04) - by our testing, liblzma before and after 5.6 is not perfectly compatible... To quote the original issue on the
The approach you noted can also be quite tedious - say when |
It's not only invalidated, but the whole build process will fail fast. cargo would say:
But we could workaround things by simply not specifying version of [dependencies]
async-compression = { version = "0.4.22", features = ["lzma",] }
liblzma = { version = "0", features = [] } |
That's a new idea I didn't think of! I think we can also have wildcard in version requirements, so liblzma = { version = "*", features = [] } Might work? |
It's dangerous for async-compression to use * versions, and I usually advise to avoid them entirely. Aside from the case with liblzma where multiple native libraries conflict, detecting duplicate packages generally is very easy with Cargo:
... will error if there are multiple liblzma in the dep tree. |
liblzma-rs requires a higher version of liblzma to allow dynamic linking by default (see Portable-Network-Archive/liblzma-rs#173 for details), This feature will allow any version of liblzma on the system to use the dynamic linking