Skip to content

build: add wasm support - #36

Open
dfrankland wants to merge 5 commits into
Uzaaft:masterfrom
dfrankland:wasm
Open

build: add wasm support#36
dfrankland wants to merge 5 commits into
Uzaaft:masterfrom
dfrankland:wasm

Conversation

@dfrankland

Copy link
Copy Markdown

libghostty-vt already supports compiling to wasm, we just needed to alter the setup for the correct bindings to be generated

@Uzaaft

Uzaaft commented May 8, 2026

Copy link
Copy Markdown
Owner

@dfrankland can you split the codegen into a seperate commit just so that its easier to review?

Also gratzie!

@dfrankland

Copy link
Copy Markdown
Author

I've rebased and moved file changes to crates/libghostty-vt-sys/src/bindings.rs and the new crates/libghostty-vt-sys/src/bindings_wasm.rs to their own commit.

Happy to make any other changes you'd like 👍

@Uzaaft

Uzaaft commented May 18, 2026

Copy link
Copy Markdown
Owner

Sorry about the delay in reviewing this @dfrankland . Aiming to get back to this during this week.

cc @pluiedev

Comment thread crates/libghostty-vt-sys/tools/gen_bindings.rs Outdated
Comment thread crates/libghostty-vt-sys/build.rs Outdated
Comment thread crates/libghostty-vt-sys/build.rs Outdated
Comment on lines +103 to +107
if target == "wasm32-unknown-unknown" && matches!(link_mode, LinkMode::Dynamic) {
panic!(
"wasm32-unknown-unknown currently requires feature `link-static`; dynamic Ghostty wasm side modules are not supported"
);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dynamic linking is probably not going to be supported for any wasm32 target, including WASI

@dfrankland

Copy link
Copy Markdown
Author

I attempted to address the comments added, and I've rebased this PR on top of master.

@dfrankland
dfrankland requested a review from pluiedev June 1, 2026 06:20

@pluiedev pluiedev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@Uzaaft Uzaaft changed the title Add wasm support build: add wasm support Jun 4, 2026
@Uzaaft

Uzaaft commented Jun 4, 2026

Copy link
Copy Markdown
Owner

@pluiedev I'll merge this in after landing your PR's. :shipit:

@dfrankland

Copy link
Copy Markdown
Author

I've rebased once more onto master and checked everything passed on linux x86_64 + mac aarch64

@Uzaaft

Uzaaft commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Pending CI/CD. It failed previously

@dfrankland

Copy link
Copy Markdown
Author

I can't really run and adjust CI to ensure everything works, but I believe there's an issue with the Nix develop shell hook unsetting env vars needed on CI for Zig to build. I made a small work around to keep those env vars based on the CI env var being present.

I'm not really sure why local Nix develop shells would want to use the system SDK rather than the one provided by the Nix flake, so it's hard for me to tell if this is a change you'd want to accept.

@dfrankland

Copy link
Copy Markdown
Author

Rebased on to master to keep up with bindings.rs updates

@Uzaaft

Uzaaft commented Jun 18, 2026

Copy link
Copy Markdown
Owner

@dfrankland you have done more than enough.
I just need to find a window where i can sit down, fix shit, and get this over the finish line. I'll handle the rest, appreciate the effort you've put in so far!

@dfrankland
dfrankland force-pushed the wasm branch 2 times, most recently from 8131748 to bc7e415 Compare July 11, 2026 01:13
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.

3 participants