Skip to content
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

zstd-sys for wasm32-unknown-unknown is broken #271

Closed
oligamiq opened this issue Apr 5, 2024 · 1 comment · Fixed by #274
Closed

zstd-sys for wasm32-unknown-unknown is broken #271

oligamiq opened this issue Apr 5, 2024 · 1 comment · Fixed by #274

Comments

@oligamiq
Copy link

oligamiq commented Apr 5, 2024

zstd-sys version is 2.0.10 and error.

Error: Compiling your crate to WebAssembly failed
Caused by: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit code: 101
  full command: "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"

I set

zstd-sys = "=2.0.9"

and build successed.

@jszwedko
Copy link

Thanks @oligamiq . I just ran into this today too via vectordotdev/vector#20325 (comment)

jszwedko added a commit to vectordotdev/vector that referenced this issue Apr 24, 2024
To fix a WASM build issue. We can upgrade again once gyscos/zstd-rs#274 is
merged and released (or gyscos/zstd-rs#271 is otherwise fixed).

Also add a test that builds the playground to catch this sort of regression in the future.

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
github-merge-queue bot pushed a commit to vectordotdev/vector that referenced this issue Apr 25, 2024
* chore(dev): Bump down zstd-sys from 2.0.10 to 2.0.9

To fix a WASM build issue. We can upgrade again once gyscos/zstd-rs#274 is
merged and released (or gyscos/zstd-rs#271 is otherwise fixed).

Also add a test that builds the playground to catch this sort of regression in the future.

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

* Revert "chore(deps): Bump the zstd group with 1 update (#20199)"

This reverts commit 0599d60.

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

* chmod +x

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

* Just put directly in env prepare

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

* Bump timeout

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

---------

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
khuey added a commit to khuey/backtrace-rs that referenced this issue May 24, 2024
zstd has been introduced as an alternative to zlib for the compression of debug
sections.[0] Toolchain support is widely present at this time but lack of
support in backtrace is a severe limitation on using this feature in Rust
programs.

Unlike zlib compression, the most widely used Rust library for zstd is a set
of bindings to the zstd C library. There does exist a Rust reimplementation
(ruzstd) however the author claims it is significantly slower than the C
library and it sees substantially less usage, so I have not used it here.

Using the C library poses challenges because it requires compiling native
code. I made a few adjustments to the CI configuration to make that possible
on all platforms, and pinned the zstd crate to a slightly older version
due to gyscos/zstd-rs#271 breaking the crate on wasm targets on the very
latest version. Additionally, I've disabled this entirely on illumos rather
than try to get native code to compile successfully there.

[0] https://maskray.me/blog/2022-09-09-zstd-compressed-debug-sections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants