chore: add uncheck-liblzma-version feature#342
chore: add uncheck-liblzma-version feature#342eatradish wants to merge 1 commit intoNullus157:mainfrom
uncheck-liblzma-version feature#342Conversation
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
NobodyXu
left a comment
There was a problem hiding this comment.
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