-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: Add zstd
support
#148
Conversation
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Awesome! |
@passcod I am not very familiar with crate |
Can you also add/check off the relevant box in the status section of the readme please :) |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Done! |
Seems like |
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.
LGTM
Code here is approved, but let's not merge until the CI/cross situation is resolved. |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
musl targets work fine, no workaound is required. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Emil Gardström <emil.gardstrom@gmail.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Emil Gardström <emil.gardstrom@gmail.com>
# | ||
# Enable feature bindgen to generate C bindings. | ||
# Enable feature zstdmt to enable multithreading in libzstd. | ||
zstd = { version = "0.10.0", features = [ "bindgen", "zstdmt" ], default-features = false } |
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.
zstd = { version = "0.10.0", features = [ "bindgen", "zstdmt" ], default-features = false } | |
zstd = { version = "0.10.0", features = [ "bindgen", "zstdmt", "pkg-config" ], default-features = false } |
do note that this will still not work, you'll need something like I mentioned in cross-rs/cross#731 (comment)
which is a custom Dockerfile to add the missing dependencies
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.
Thanks!
However, I still don't think it is a good idea to have a runtime dependency here, so I will explore other options to fix this problem, like abandoning the glibc and goes for musl-only for these two targets.
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.
it would not be a runtime dependency :) (afaik, if I interpret what zstd-coresys does)
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.
I'm sorry but what is zstd-core
?
The zstd
crate we use here depends on zstd-sys
for compiling, linking and generating bindings for libzstd
.
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.
mb! I meant zstd-sys
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.
@Emilgardis I checked the build.rs
and it panics if pkg-config
failed to probe for zstd
.
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.
yep, and to solve that/have it work, you need to have libzstd-dev installed in the builders environment, which is done with supplying a custom docker image to cross
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.
It skips building zstd
if pkg-config
is enabled, which means that it will dynamically linked with libzstd
provided by the system.
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.
but it would statically link it with the installed zstd, or am I missing something?
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.
but it would statically link it with the installed zstd, or am I missing something?
I'm not sure about that.
I wasn't able to find the println!("cargo:")
statement that specifies the linkage for the system-wide libzstd
.
@passcod Seems like only Maybe we can stop supporting these two targets and instead use the musl ones? |
That sounds okay. |
Since they are the only two targets that crate `zstd-sys` failed to build. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Done! |
Signed-off-by: Jiahao XU Jiahao_XU@outlook.com