Skip to content

Commit d49410d

Browse files
committed
feat(website/sandbox): add Run panel
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
1 parent 19e4c72 commit d49410d

11 files changed

Lines changed: 2307 additions & 19 deletions

File tree

.cargo/config.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
[target.wasm32-unknown-unknown]
22
rustflags = [
3+
# Emit Wasm imports for the JS-provided host functions the sandbox declares
4+
# in `extern` blocks (`read_input`, `set_*`, …). These are resolved by the
5+
# host at instantiation, never at link time; without this, `rust-lld` (since
6+
# the 1.96 toolchain) rejects them as undefined symbols instead of importing
7+
# them. Harmless for the wasm-bindgen-based `language-server-web`, which has
8+
# no such raw imports.
9+
"-Clink-arg=--import-undefined",
310
# This adds __indirect_function_table to the exports which is needed for
411
# the host to be able to call function pointers directly.
512
"-Clink-arg=--export-table",

Cargo.lock

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

starstream-sandbox-web/Cargo.toml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,22 @@ test = false
1212
crate-type = ["cdylib"]
1313

1414
[dependencies]
15+
anyhow = "1.0.102"
1516
log = "0.4.28"
1617
miette.workspace = true
1718
serde.workspace = true
1819
serde_cbor = "0.11.2"
20+
serde_json.workspace = true
21+
sha2 = "0.10.9"
1922
starstream-compiler.workspace = true
2023
starstream-to-wasm.workspace = true
2124
termcolor = "1.4.1"
22-
wasmprinter = { workspace = true, features = ["component-model"] }
23-
wit-component.workspace = true
25+
starstream-runtime-next = { workspace = true, features = [
26+
"wasmtime-custom-virtual-memory",
27+
] }
28+
wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-46.0.0", default-features = false }
29+
cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-46.0.0", default-features = false }
30+
# wasm-tools crates kept in lockstep with wasmtime 46 (the workspace pins 0.240
31+
# for the wasmtime-45 crates; the sandbox needs the matching 0.251 line).
32+
wasmprinter = { version = "0.251.0", features = ["component-model"] }
33+
wit-component = "0.251.0"

starstream-sandbox-web/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fn main() {
2+
// Cranelift recursion (egraph, regalloc) overflows the default 1 MiB
3+
// shadow stack when compiling a component in `deploy`; give it headroom.
4+
if std::env::var("CARGO_CFG_TARGET_ARCH").as_deref() == Ok("wasm32") {
5+
println!("cargo::rustc-link-arg=-zstack-size=4194304");
6+
}
7+
}

0 commit comments

Comments
 (0)