Skip to content

Commit

Permalink
deps: update to [email protected] (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored Nov 2, 2024
1 parent 2506561 commit c498dca
Show file tree
Hide file tree
Showing 6 changed files with 587 additions and 575 deletions.
2 changes: 1 addition & 1 deletion StarlingMonkey
Submodule StarlingMonkey updated 47 files
+1 −1 CMakeLists.txt
+1 −1 cmake/wasmtime.cmake
+9,011 −0 host-apis/wasi-0.2.2/bindings/bindings.c
+3,356 −0 host-apis/wasi-0.2.2/bindings/bindings.h
+ host-apis/wasi-0.2.2/bindings/bindings_component_type.o
+1,195 −0 host-apis/wasi-0.2.2/host_api.cpp
+11 −0 host-apis/wasi-0.2.2/host_call.cpp
+10 −0 host-apis/wasi-0.2.2/include/exports.h
+ host-apis/wasi-0.2.2/preview1-adapter-debug/wasi_snapshot_preview1.wasm
+ host-apis/wasi-0.2.2/preview1-adapter-release/wasi_snapshot_preview1.wasm
+6 −0 host-apis/wasi-0.2.2/wit/command-extended.wit
+10 −0 host-apis/wasi-0.2.2/wit/deps/cli/command.wit
+22 −0 host-apis/wasi-0.2.2/wit/deps/cli/environment.wit
+17 −0 host-apis/wasi-0.2.2/wit/deps/cli/exit.wit
+36 −0 host-apis/wasi-0.2.2/wit/deps/cli/imports.wit
+6 −0 host-apis/wasi-0.2.2/wit/deps/cli/run.wit
+26 −0 host-apis/wasi-0.2.2/wit/deps/cli/stdio.wit
+62 −0 host-apis/wasi-0.2.2/wit/deps/cli/terminal.wit
+50 −0 host-apis/wasi-0.2.2/wit/deps/clocks/monotonic-clock.wit
+55 −0 host-apis/wasi-0.2.2/wit/deps/clocks/timezone.wit
+46 −0 host-apis/wasi-0.2.2/wit/deps/clocks/wall-clock.wit
+11 −0 host-apis/wasi-0.2.2/wit/deps/clocks/world.wit
+11 −0 host-apis/wasi-0.2.2/wit/deps/filesystem/preopens.wit
+672 −0 host-apis/wasi-0.2.2/wit/deps/filesystem/types.wit
+9 −0 host-apis/wasi-0.2.2/wit/deps/filesystem/world.wit
+49 −0 host-apis/wasi-0.2.2/wit/deps/http/handler.wit
+50 −0 host-apis/wasi-0.2.2/wit/deps/http/proxy.wit
+673 −0 host-apis/wasi-0.2.2/wit/deps/http/types.wit
+34 −0 host-apis/wasi-0.2.2/wit/deps/io/error.wit
+47 −0 host-apis/wasi-0.2.2/wit/deps/io/poll.wit
+290 −0 host-apis/wasi-0.2.2/wit/deps/io/streams.wit
+10 −0 host-apis/wasi-0.2.2/wit/deps/io/world.wit
+27 −0 host-apis/wasi-0.2.2/wit/deps/random/insecure-seed.wit
+25 −0 host-apis/wasi-0.2.2/wit/deps/random/insecure.wit
+29 −0 host-apis/wasi-0.2.2/wit/deps/random/random.wit
+13 −0 host-apis/wasi-0.2.2/wit/deps/random/world.wit
+11 −0 host-apis/wasi-0.2.2/wit/deps/sockets/instance-network.wit
+56 −0 host-apis/wasi-0.2.2/wit/deps/sockets/ip-name-lookup.wit
+169 −0 host-apis/wasi-0.2.2/wit/deps/sockets/network.wit
+30 −0 host-apis/wasi-0.2.2/wit/deps/sockets/tcp-create-socket.wit
+387 −0 host-apis/wasi-0.2.2/wit/deps/sockets/tcp.wit
+30 −0 host-apis/wasi-0.2.2/wit/deps/sockets/udp-create-socket.wit
+288 −0 host-apis/wasi-0.2.2/wit/deps/sockets/udp.wit
+19 −0 host-apis/wasi-0.2.2/wit/deps/sockets/world.wit
+6 −0 host-apis/wasi-0.2.2/wit/main.wit
+1 −0 runtime/script_loader.cpp
+4 −4 tests/e2e/runtime-err/expect_serve_stderr.txt
10 changes: 8 additions & 2 deletions crates/spidermonkey-embedding-splicer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ impl Guest for SpidermonkeyEmbeddingSplicerComponent {
let maybe_run = engine_resolve.worlds[engine_world]
.exports
.iter()
.find(|(key, _)| engine_resolve.name_world_key(key) == "wasi:cli/[email protected]")
.find(|(key, _)| {
engine_resolve
.name_world_key(key)
.starts_with("wasi:cli/[email protected]")
})
.map(|(key, _)| key.clone());
if let Some(run) = maybe_run {
engine_resolve.worlds[engine_world]
Expand All @@ -169,7 +173,9 @@ impl Guest for SpidermonkeyEmbeddingSplicerComponent {
.exports
.iter()
.find(|(key, _)| {
engine_resolve.name_world_key(key) == "wasi:http/[email protected]"
engine_resolve
.name_world_key(key)
.starts_with("wasi:http/[email protected]")
})
.map(|(key, _)| key.clone());

Expand Down
40 changes: 18 additions & 22 deletions crates/spidermonkey-embedding-splicer/src/splice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ use wasmparser::Operator;

use crate::*;

const WASI_VERSIONS: [&str; 3] = ["0.2.0", "0.2.1", "0.2.2"];

//
// Parses the Spidermonkey binary into section data for reserialization
// into an output binary, and in the process:
Expand Down Expand Up @@ -44,31 +46,25 @@ pub fn splice(

// since StarlingMonkey implements CLI Run and incoming handler,
// we override them only if the guest content exports those functions
if exports
.iter()
.any(|(name, _)| name == "wasi:cli/[email protected]#run")
{
if let Some(run) = module
.exports
.get_func_by_name("wasi:cli/[email protected]#run".to_string())
{
let expt = module.exports.get_func_by_id(run).unwrap();
module.exports.delete(expt);
module.delete_func(run); // TODO: Look at the intended behaviour here. Need to pass function ID to delete from functions. Was Previously passing Exports ID
for wasi_version in WASI_VERSIONS {
let import = format!("wasi:cli/run@{wasi_version}#run");
if exports.iter().any(|(name, _)| *name == import) {
if let Some(run) = module.exports.get_func_by_name(import) {
let expt = module.exports.get_func_by_id(run).unwrap();
module.exports.delete(expt);
module.delete_func(run); // TODO: Look at the intended behaviour here. Need to pass function ID to delete from functions. Was Previously passing Exports ID
}
}
}

if exports
.iter()
.any(|(name, _)| name == "wasi:http/[email protected]#handle")
{
if let Some(serve) = module
.exports
.get_func_by_name("wasi:http/[email protected]#handle".to_string())
{
let expt = module.exports.get_func_by_id(serve).unwrap();
module.exports.delete(expt);
module.delete_func(serve); // TODO: Look at the intended behaviour here. Same as above comment
for wasi_version in WASI_VERSIONS {
let import = format!("wasi:http/incoming-handler@{wasi_version}#handle");
if exports.iter().any(|(name, _)| *name == import) {
if let Some(serve) = module.exports.get_func_by_name(import) {
let expt = module.exports.get_func_by_id(serve).unwrap();
module.exports.delete(expt);
module.delete_func(serve); // TODO: Look at the intended behaviour here. Same as above comment
}
}
}

Expand Down
Loading

0 comments on commit c498dca

Please sign in to comment.