Skip to content

cli: Compile parsers to wasm using wasi-sdk, not emscripten#4393

Merged
maxbrunsfeld merged 2 commits intomasterfrom
wasi-sdk-not-emscripten
Apr 24, 2025
Merged

cli: Compile parsers to wasm using wasi-sdk, not emscripten#4393
maxbrunsfeld merged 2 commits intomasterfrom
wasi-sdk-not-emscripten

Conversation

@maxbrunsfeld
Copy link
Contributor

The wasi-sdk is automatically downloaded if needed. It is newer and lighter-weight than emscripten. This change eliminates the need for docker/podman when building wasm parsers.

@maxbrunsfeld maxbrunsfeld enabled auto-merge (squash) April 24, 2025 23:00
@maxbrunsfeld maxbrunsfeld disabled auto-merge April 24, 2025 23:00
@maxbrunsfeld maxbrunsfeld merged commit d4d8ed3 into master Apr 24, 2025
16 of 18 checks passed
@maxbrunsfeld maxbrunsfeld deleted the wasi-sdk-not-emscripten branch April 24, 2025 23:00
@clason
Copy link
Contributor

clason commented Apr 25, 2025

This means we can also remove the "update emscripten" xtask, and with it the ureq dependency as requested in #4295.

@clason
Copy link
Contributor

clason commented Apr 25, 2025

Ah, I see that you added ureq as a full dependency, so the situation is now worse... Would switching to a different crate as in #4299 work for you? (I'm not happy about the inflated dependency chain in that PR; maybe there is a more light-weight alternative?)

@maxbrunsfeld
Copy link
Contributor Author

Oh yeah, I hadn't seen that discussion about how ureq is a problem for Microsoft. Thanks for pointing that out @clason; really any HTTP crate would be fine.

@clason
Copy link
Contributor

clason commented Apr 25, 2025

Maybe one could simply shell out to curl to grab the package?

@clason
Copy link
Contributor

clason commented Apr 25, 2025

On a related note, there's still a huge number of references to emscripten -- in the docs, the xtasks (I guess they can just be removed?), the bindings and the lib. What is the plan there?

@maxbrunsfeld
Copy link
Contributor Author

Emscripten is still needed for generating the Tree-sitter web binding. It generates the JavaScript->WASM glue that lets us package Tree-sitter as a JavaScript library. What it's not needed for is compiling Tree-sitter parsers to WASM. That can now be done with clang itself, which I think is nice. In particular, now that the native Tree-sitter library can consume WASM binaries, a lot of users might want to use that feature without needing to deal with Emscripten.

@clason
Copy link
Contributor

clason commented Apr 25, 2025

That makes sense, thanks for the explanation! (And indeed a very welcome change for us pure-C consumers :))

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 this pull request may close these issues.

2 participants