Skip to content

fix(ci): Add endian.h shim for WASM builds#36

Merged
JuanMarchetto merged 1 commit into
mainfrom
fix/wasm-endian-shim
Feb 26, 2026
Merged

fix(ci): Add endian.h shim for WASM builds#36
JuanMarchetto merged 1 commit into
mainfrom
fix/wasm-endian-shim

Conversation

@jeanclawdbotdamn

Copy link
Copy Markdown
Collaborator

Summary

  • tree-sitter 0.25's portable/endian.h detects __wasm__ and does #include <endian.h>, but wasm32-unknown-unknown has no system endian.h
  • Adds an endian.h shim to crates/truss-wasm/wasm-shim/ providing le16toh/be16toh/etc. macros
  • WASM is little-endian, so le→host is a no-op and be→host uses __builtin_bswap

This fixes the Deploy Playground CI failure from #35.

Test plan

  • cargo clippy --workspace -- -D warnings — clean
  • cargo test --workspace — all tests pass
  • Deploy Playground workflow succeeds on merge

🤖 Generated with Claude Code

tree-sitter 0.25's portable/endian.h detects __wasm__ and does
#include <endian.h>, but wasm32-unknown-unknown has no system endian.h.
Add a shim providing le16toh/be16toh/etc. macros (WASM is little-endian,
so le→host is a no-op and be→host uses __builtin_bswap).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JuanMarchetto JuanMarchetto merged commit c5ddf45 into main Feb 26, 2026
8 checks passed
@JuanMarchetto JuanMarchetto deleted the fix/wasm-endian-shim branch February 26, 2026 18:51
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