Skip to content

Commit 814bf11

Browse files
Fix WASM build and add CI check for env imports
- Fix tree_sitter_rust extern to use tree_sitter_rust_orchard (matches C symbol) - Add stdio.c stub to tree-sitter build for WASM targets - Add CI step to verify no env imports in WASM modules
1 parent c8496d8 commit 814bf11

File tree

870 files changed

+16447793
-3303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

870 files changed

+16447793
-3303
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,29 @@ jobs:
7373

7474
- uses: Swatinem/rust-cache@v2
7575

76+
- name: Install wabt
77+
run: sudo apt-get update && sudo apt-get install -y wabt
78+
7679
- name: Build for WASM
7780
run: cargo build --target wasm32-unknown-unknown --features wasm-fix
7881

82+
- name: Check for env imports in WASM
83+
run: |
84+
# Find all .wasm files and check for env imports
85+
found_env_imports=false
86+
for wasm_file in $(find target/wasm32-unknown-unknown -name "*.wasm" -type f); do
87+
if wasm-objdump -j Import -x "$wasm_file" 2>/dev/null | grep -q '<- env\.'; then
88+
echo "ERROR: Found env imports in $wasm_file:"
89+
wasm-objdump -j Import -x "$wasm_file" | grep '<- env\.'
90+
found_env_imports=true
91+
fi
92+
done
93+
if [ "$found_env_imports" = true ]; then
94+
echo "WASM modules should not have env imports - these won't work in the browser"
95+
exit 1
96+
fi
97+
echo "No env imports found - WASM modules are browser-compatible"
98+
7999
clippy:
80100
runs-on: depot-ubuntu-24.04-8
81101
steps:

0 commit comments

Comments
 (0)