Repository navigation
fix(builtins): compile bashkit for WASI targets + CI check for wasm32-wasip2 - #2310
Merged
Merged
Conversation
format_support imported std::os::unix::ffi::OsStrExt under target_os = "wasi", which does not exist there; the wasi module is also unstable on wasm32-wasip2. Use the stable as_encoded_bytes() for wasi instead. Unblocks: cargo check -p bashkit --target wasm32-wasip1/wasm32-wasip2 --features scripted_tool,jq
Keeps the library compiling for non-JS wasm runtimes (wasmtime, and the wasmtime-in-a-micro-VM guest of hyperlight-wasm) with the same reduced feature surface as the browser package. Documents the WASI target constraints in knowledge/runtimes/browser-package.md.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 8c7c382 | Commit Preview URL Branch Preview URL |
Aug 19 2026, 05:04 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The bashkit library now compiles for the WASI targets (
wasm32-wasip1,wasm32-wasip2) with the browser package's reduced feature surface(
scripted_tool,jq), and CI checkswasm32-wasip2so it stays that way.This opens bashkit to non-JS wasm runtimes (
wasmtime,wasmer) and to thewasmtime-in-a-micro-VM guest of
hyperlight-wasm. The
existing
bashkit-wasmcrate cannot serve those: it iswasm32-unknown-unknownCheck-only for now — no WASI entry-point crate (WIT component) ships here. The
CI job exists so the library does not silently regress off the target before
that lands.
Why
Question came up whether bashkit can run inside Hyperlight. Raw Hyperlight
guests are
no_stdELF binaries — not viable for a std-heavy interpreter. TheHyperlight-Wasm route is, since its guest is wasmtime and bashkit already runs
single-threaded over an in-memory VFS. The only thing standing in the way was a
broken
cfg.Before / After
Before:
format_support.rsimportedstd::os::unix::ffi::OsStrExtundertarget_os = "wasi", where that module does not exist; the wasi equivalent isunstable on
wasm32-wasip2. Fixed by using stableas_encoded_bytes()on WASI.After:
No observable behavior change on any currently supported target: the unix path
still uses
OsStrExt::as_bytes, and the non-unix fallback is untouched.Known gap, documented rather than fixed here:
--features sqlitestill fails onWASI (tokio feature selection).
Risk
cfginos_str_as_bytes. Unix behavior is byte-identical;only WASI, previously uncompilable, takes the new branch. The added CI step can
only fail the build, never change artifacts.
Checklist
wasm32-wasip2CIcheck (a
cfg-gated import cannot be exercised from host tests); hostsuite re-run green (
cargo test -p bashkit --lib --features scripted_tool,jq:3076 passed), plus
cargo fmt --all --checkandcargo clippy -p bashkit --all-targets -- -D warningsGenerated by Claude Code