indygreg / python-zstandard

Python bindings to the Zstandard (zstd) compression library
BSD 3-Clause "New" or "Revised" License
512 stars 90 forks source link

Compiling `zstandard` to WebAssembly #227

Open agriyakhetarpal opened 6 months ago

agriyakhetarpal commented 6 months ago

Hi there! I am trying to package (in specific, add a recipe for) zstandard for Pyodide, a Python distribution compiled using the Emscripten toolchain to WebAssembly that enables running Python code in the browser and I thought that I should reach out here! Here is the link to the PR: https://github.com/pyodide/pyodide/pull/4792.

I see that the builds for zstandard are passing locally and the package builds in under half a minute. Would a package maintainer or core developer be willing to be added as a maintainer for this recipe? In any case, regardless, I would like to note that I would be happy to serve as a de facto maintainer for this recipe and help out with upgrades to the package in Pyodide on new releases for it in PyPI with patches, tests, etc.

I would be happy to share further context around this: the reason is that version 3 of the Zarr Python package is going to use zstandard as a required dependency, and therefore wheels for zstandard for a wasm32 platform tag (with the ABI and ABI tag managed by the available Emscripten version in Pyodide), which would be distributed through the Pyodide CDN across browsers and handled by Pyodide's infrastructure and developer tooling for building in-tree packages would be a wonderful addition towards bringing Zarr (and other dependents that might be using zstandard) to run on WASM-based platforms like JupyterLite.


xref: here is the corresponding issue on the Pyodide repository that I opened a while ago: https://github.com/pyodide/pyodide/issues/4788