async-compression icon indicating copy to clipboard operation
async-compression copied to clipboard

Bump zstd for WASM support

Open gagbo opened this issue 2 years ago • 5 comments

Hello,

It would be nice, if possible to bump the zstd dependency to 0.11 to be able to use this crate on WASM targets. To be honest I'm not entirely sure this is possible, or whether the bump would be enough. I'll probably try eventually in some point in the future, I'm mostly making this issue to raise awareness

gagbo avatar Mar 29 '22 13:03 gagbo

Wanted to bump this! Would greatly appreciate an upgrade to 0.11.1 (not for WASM support, just to keep up to date with zstd and zstd-safe). And an upgrade to zstd-safe to 5.0.1

hariria avatar Apr 10 '22 23:04 hariria

@Nemo157 any chance this might be possible?

hariria avatar Apr 12 '22 00:04 hariria

PR #144 should fix this.

indygreg avatar Apr 16 '22 22:04 indygreg

Sorry about the delay, I've merged and published #144 finally. I'd like to keep this issue open for adding CI testing on wasm32-wasi if possible.

Nemo157 avatar May 11 '22 11:05 Nemo157

Blockers for testing on wasm32-wasi:

  • proptest uses forking
  • ntest::timeout uses threads

Quickly deleting those dependencies from the tests I was able to successfully run the tests on arch after installing libc-wasi with:

CFLAGS='-iwithsysroot /usr/share/wasi-sysroot/include' cargo test --target wasm32-wasi --features zstd,all-implementations

It looks like everything except xz/lzma compiles ok, that uses pthread.h which doesn't exist, it's hopefully possible to disable that by adding some extra build-configuration somewhere.

I'll think about what to do about proptest/ntest and come back to this later.

Nemo157 avatar May 11 '22 12:05 Nemo157