alexcrichton / xz2-rs

Bindings to liblzma in Rust (xz streams in Rust)
Apache License 2.0
81 stars 52 forks source link

WebAssembly Support #119

Closed ChanTsune closed 11 months ago

ChanTsune commented 1 year ago

Builds targeting WebAssemby using the WASI-SDK are now supported in liblzma 5.4.4. https://github.com/tukaani-project/xz/releases/tag/v5.4.4 (I patched the build to work with the xz2 WebAssemby target).

This allows builds targeting wasm32-unknown-unknown and wasm32-wasi on xz2.

However, several changes have to be made to the current xz2.

  1. Update liblzma version to 5.4.4 (currently xz2 uses liblzma 5.2.5)
  2. Enable/disable multithreading-related features in xz2 (with liblzma 5.4.4, multithreading features must be disabled when targeting WebAseembly).
  3. (Optional) Add arm64 filters (new filters have been added in liblzma 5.4 and need to be supported to pass tests against them).

There are several options for how to make the change, possible options are.

1.

2.

3.

I will work on making xz2 buildable with WebAssembly as a target, as long as you indicate your policy for handling it!

I see that you have been doing some WebAssembly-related activities recently, so please respond if you are interested!