Skip to content

ruby-rbs-sys: support wasm32-wasip1 - #3145

Open
pvcresin wants to merge 1 commit into
ruby:masterfrom
pvcresin:rust-wasm32-wasip1-20260905
Open

ruby-rbs-sys: support wasm32-wasip1#3145
pvcresin wants to merge 1 commit into
ruby:masterfrom
pvcresin:rust-wasm32-wasip1-20260905

Conversation

@pvcresin

@pvcresin pvcresin commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Add wasm32-wasip1 build support for ruby-rbs-sys and ruby-rbs.

Motivation

The vendored C parser needs to be compiled with the WASI SDK when the target is a WASI target.

In addition, bindgen output for wasm targets is sensitive to the libclang implementation. Depending on the environment, declarations may be dropped or forward-declared structs may be generated as opaque types.

For WASI builds, this change:

  • compiles the C parser with the WASI SDK compiler and sysroot;
  • generates bindings with the host target;
  • disables bindgen layout tests, which are not valid for host-generated bindings.

Native builds retain the existing behavior. No public Rust API is changed.

CI

Add a GitHub Actions job that builds both crates for wasm32-wasip1.

Testing

  • git diff --check
  • cargo fmt --all --manifest-path rust/Cargo.toml -- --check
  • cargo test --locked --manifest-path rust/Cargo.toml (52 tests passed)
  • RUSTFLAGS="-D warnings" cargo clippy --locked --manifest-path rust/Cargo.toml

Follow-up to #2992; related to #2943.

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.

1 participant