Skip to content

Commit

Permalink
deps: bump StarlingMonkey to include wasi 0.2.3 (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthik2804 authored Jan 22, 2025
1 parent 8e67356 commit 6c06480
Show file tree
Hide file tree
Showing 31 changed files with 112 additions and 112 deletions.
2 changes: 1 addition & 1 deletion StarlingMonkey
Submodule StarlingMonkey updated 85 files
+1 −1 CMakeLists.txt
+36 −159 builtins/web/blob.cpp
+3 −33 builtins/web/blob.h
+1 −0 builtins/web/crypto/crypto-algorithm.cpp
+7 −109 builtins/web/crypto/crypto.cpp
+100 −0 builtins/web/crypto/uuid.cpp
+29 −0 builtins/web/crypto/uuid.h
+280 −38 builtins/web/fetch/fetch-api.cpp
+62 −0 builtins/web/fetch/fetch-utils.cpp
+21 −0 builtins/web/fetch/fetch-utils.h
+2 −2 builtins/web/fetch/headers.cpp
+69 −30 builtins/web/fetch/request-response.cpp
+11 −0 builtins/web/fetch/request-response.h
+151 −0 builtins/web/streams/buf-reader.cpp
+44 −0 builtins/web/streams/buf-reader.h
+3 −0 builtins/web/streams/streams.cpp
+148 −2 builtins/web/url.cpp
+5 −0 builtins/web/url.h
+3 −0 cmake/binaryen.cmake
+6 −1 cmake/builtins.cmake
+1 −6 cmake/compile-flags.cmake
+1 −1 cmake/wasmtime.cmake
+1 −0 host-apis/wasi-0.2.0/host_api.cpp
+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
+20 −0 host-apis/wasi-0.2.2/host_api.cmake
+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
+9,011 −0 host-apis/wasi-0.2.3/bindings/bindings.c
+2,130 −0 host-apis/wasi-0.2.3/bindings/bindings.h
+ host-apis/wasi-0.2.3/bindings/bindings_component_type.o
+20 −0 host-apis/wasi-0.2.3/host_api.cmake
+6 −0 host-apis/wasi-0.2.3/wit/command-extended.wit
+246 −0 host-apis/wasi-0.2.3/wit/deps/wasi-cli-0.2.3/package.wit
+29 −0 host-apis/wasi-0.2.3/wit/deps/wasi-clocks-0.2.3/package.wit
+158 −0 host-apis/wasi-0.2.3/wit/deps/wasi-filesystem-0.2.3/package.wit
+721 −0 host-apis/wasi-0.2.3/wit/deps/wasi-http-0.2.3/package.wit
+48 −0 host-apis/wasi-0.2.3/wit/deps/wasi-io-0.2.3/package.wit
+18 −0 host-apis/wasi-0.2.3/wit/deps/wasi-random-0.2.3/package.wit
+179 −0 host-apis/wasi-0.2.3/wit/deps/wasi-sockets-0.2.3/package.wit
+6 −0 host-apis/wasi-0.2.3/wit/main.wit
+21 −0 host-apis/wasi-0.2.3/wkg.lock
+34 −0 runtime/js.cpp
+6 −0 scripts/cxx-wrapper.in
+4 −4 tests/e2e/runtime-err/expect_serve_stderr.txt
+56 −0 tests/integration/blob/blob.js
+93 −0 tests/integration/fetch/fetch.js
+1 −0 tests/integration/handlers.js
+1 −0 tests/tests.cmake
+2 −2 tests/wpt-harness/expectations/fetch/api/basic/request-upload.any.js.json
+56 −0 tests/wpt-harness/expectations/fetch/api/basic/scheme-blob.sub.any.js.json
2 changes: 1 addition & 1 deletion crates/spidermonkey-embedding-splicer/src/splice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use wasmparser::Operator;

use crate::*;

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

//
// Parses the Spidermonkey binary into section data for reserialization
Expand Down
2 changes: 1 addition & 1 deletion crates/spidermonkey-embedding-splicer/src/stub_wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use wit_parser::Resolve;

use crate::{parse_wit, Features};

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

fn stub_wasi_imports<StubFn>(
module: &mut Module,
Expand Down
4 changes: 2 additions & 2 deletions test/cases/http-request/source.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { handle } from 'wasi:http/[email protected].2';
import { Fields, OutgoingRequest } from 'wasi:http/[email protected].2';
import { handle } from 'wasi:http/[email protected].3';
import { Fields, OutgoingRequest } from 'wasi:http/[email protected].3';

const encoder = new TextEncoder();
const decoder = new TextDecoder();
Expand Down
6 changes: 3 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { strictEqual } from 'node:assert';
const DEBUG_TRACING = false;
const LOG_DEBUGGING = false;

function maybeLogging (disableFeatures) {
function maybeLogging(disableFeatures) {
if (!LOG_DEBUGGING) return disableFeatures;
if (disableFeatures && disableFeatures.includes('stdio')) {
disableFeatures.splice(disableFeatures.indexOf('stdio'), 1);
Expand Down Expand Up @@ -242,8 +242,8 @@ suite('WASI', () => {

const { component } = await componentize(
`
import { now } from 'wasi:clocks/[email protected].2';
import { getRandomBytes } from 'wasi:random/[email protected].2';
import { now } from 'wasi:clocks/[email protected].3';
import { getRandomBytes } from 'wasi:random/[email protected].3';
let result;
export const run = {
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/cli/command.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:cli@0.2.2;
package wasi:cli@0.2.3;

@since(version = 0.2.0)
world command {
Expand Down
12 changes: 6 additions & 6 deletions test/wit/deps/cli/imports.wit
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package wasi:cli@0.2.2;
package wasi:cli@0.2.3;

@since(version = 0.2.0)
world imports {
@since(version = 0.2.0)
include wasi:clocks/imports@0.2.2;
include wasi:clocks/imports@0.2.3;
@since(version = 0.2.0)
include wasi:filesystem/imports@0.2.2;
include wasi:filesystem/imports@0.2.3;
@since(version = 0.2.0)
include wasi:sockets/imports@0.2.2;
include wasi:sockets/imports@0.2.3;
@since(version = 0.2.0)
include wasi:random/imports@0.2.2;
include wasi:random/imports@0.2.3;
@since(version = 0.2.0)
include wasi:io/imports@0.2.2;
include wasi:io/imports@0.2.3;

@since(version = 0.2.0)
import environment;
Expand Down
6 changes: 3 additions & 3 deletions test/wit/deps/cli/stdio.wit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@since(version = 0.2.0)
interface stdin {
@since(version = 0.2.0)
use wasi:io/streams@0.2.2.{input-stream};
use wasi:io/streams@0.2.3.{input-stream};

@since(version = 0.2.0)
get-stdin: func() -> input-stream;
Expand All @@ -10,7 +10,7 @@ interface stdin {
@since(version = 0.2.0)
interface stdout {
@since(version = 0.2.0)
use wasi:io/streams@0.2.2.{output-stream};
use wasi:io/streams@0.2.3.{output-stream};

@since(version = 0.2.0)
get-stdout: func() -> output-stream;
Expand All @@ -19,7 +19,7 @@ interface stdout {
@since(version = 0.2.0)
interface stderr {
@since(version = 0.2.0)
use wasi:io/streams@0.2.2.{output-stream};
use wasi:io/streams@0.2.3.{output-stream};

@since(version = 0.2.0)
get-stderr: func() -> output-stream;
Expand Down
4 changes: 2 additions & 2 deletions test/wit/deps/clocks/monotonic-clock.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.2;
package wasi:clocks@0.2.3;
/// WASI Monotonic Clock is a clock API intended to let users measure elapsed
/// time.
///
Expand All @@ -10,7 +10,7 @@ package wasi:[email protected];
@since(version = 0.2.0)
interface monotonic-clock {
@since(version = 0.2.0)
use wasi:io/poll@0.2.2.{pollable};
use wasi:io/poll@0.2.3.{pollable};

/// An instant in time, in nanoseconds. An instant is relative to an
/// unspecified initial value, and can only be compared to instances from
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/clocks/timezone.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.2;
package wasi:clocks@0.2.3;

@unstable(feature = clocks-timezone)
interface timezone {
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/clocks/wall-clock.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.2;
package wasi:clocks@0.2.3;
/// WASI Wall Clock is a clock API intended to let users query the current
/// time. The name "wall" makes an analogy to a "clock on the wall", which
/// is not necessarily monotonic as it may be reset.
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/clocks/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.2;
package wasi:clocks@0.2.3;

@since(version = 0.2.0)
world imports {
Expand Down
4 changes: 2 additions & 2 deletions test/wit/deps/filesystem/preopens.wit
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package wasi:filesystem@0.2.2;
package wasi:filesystem@0.2.3;

@since(version = 0.2.0)
interface preopens {
@since(version = 0.2.0)
use types.{descriptor};

/// Return the set of preopened directories, and their path.
/// Return the set of preopened directories, and their paths.
@since(version = 0.2.0)
get-directories: func() -> list<tuple<descriptor, string>>;
}
10 changes: 5 additions & 5 deletions test/wit/deps/filesystem/types.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:filesystem@0.2.2;
package wasi:filesystem@0.2.3;
/// WASI filesystem is a filesystem API primarily intended to let users run WASI
/// programs that access their files on their existing filesystems, without
/// significant overhead.
Expand Down Expand Up @@ -26,9 +26,9 @@ package wasi:[email protected];
@since(version = 0.2.0)
interface types {
@since(version = 0.2.0)
use wasi:io/streams@0.2.2.{input-stream, output-stream, error};
use wasi:io/streams@0.2.3.{input-stream, output-stream, error};
@since(version = 0.2.0)
use wasi:clocks/wall-clock@0.2.2.{datetime};
use wasi:clocks/wall-clock@0.2.3.{datetime};

/// File size or length of a region within a file.
@since(version = 0.2.0)
Expand Down Expand Up @@ -327,7 +327,7 @@ interface types {
/// May fail with an error-code describing why the file cannot be appended.
///
/// Note: This allows using `write-stream`, which is similar to `write` with
/// `O_APPEND` in in POSIX.
/// `O_APPEND` in POSIX.
@since(version = 0.2.0)
append-via-stream: func() -> result<output-stream, error-code>;

Expand Down Expand Up @@ -623,7 +623,7 @@ interface types {
/// replaced. It may also include a secret value chosen by the
/// implementation and not otherwise exposed.
///
/// Implementations are encourated to provide the following properties:
/// Implementations are encouraged to provide the following properties:
///
/// - If the file is not modified or replaced, the computed hash value should
/// usually not change.
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/filesystem/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:filesystem@0.2.2;
package wasi:filesystem@0.2.3;

@since(version = 0.2.0)
world imports {
Expand Down
14 changes: 7 additions & 7 deletions test/wit/deps/http/proxy.wit
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
package wasi:http@0.2.2;
package wasi:http@0.2.3;

/// The `wasi:http/imports` world imports all the APIs for HTTP proxies.
/// It is intended to be `include`d in other worlds.
@since(version = 0.2.0)
world imports {
/// HTTP proxies have access to time and randomness.
@since(version = 0.2.0)
import wasi:clocks/monotonic-clock@0.2.2;
import wasi:clocks/monotonic-clock@0.2.3;
@since(version = 0.2.0)
import wasi:clocks/wall-clock@0.2.2;
import wasi:clocks/wall-clock@0.2.3;
@since(version = 0.2.0)
import wasi:random/random@0.2.2;
import wasi:random/random@0.2.3;

/// Proxies have standard output and error streams which are expected to
/// terminate in a developer-facing console provided by the host.
@since(version = 0.2.0)
import wasi:cli/stdout@0.2.2;
import wasi:cli/stdout@0.2.3;
@since(version = 0.2.0)
import wasi:cli/stderr@0.2.2;
import wasi:cli/stderr@0.2.3;

/// TODO: this is a temporary workaround until component tooling is able to
/// gracefully handle the absence of stdin. Hosts must return an eof stream
/// for this import, which is what wasi-libc + tooling will do automatically
/// when this import is properly removed.
@since(version = 0.2.0)
import wasi:cli/stdin@0.2.2;
import wasi:cli/stdin@0.2.3;

/// This is the default handler to use when user code simply wants to make an
/// HTTP request (e.g., via `fetch()`).
Expand Down
10 changes: 5 additions & 5 deletions test/wit/deps/http/types.wit
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
@since(version = 0.2.0)
interface types {
@since(version = 0.2.0)
use wasi:clocks/monotonic-clock@0.2.2.{duration};
use wasi:clocks/monotonic-clock@0.2.3.{duration};
@since(version = 0.2.0)
use wasi:io/streams@0.2.2.{input-stream, output-stream};
use wasi:io/streams@0.2.3.{input-stream, output-stream};
@since(version = 0.2.0)
use wasi:io/error@0.2.2.{error as io-error};
use wasi:io/error@0.2.3.{error as io-error};
@since(version = 0.2.0)
use wasi:io/poll@0.2.2.{pollable};
use wasi:io/poll@0.2.3.{pollable};

/// This type corresponds to HTTP standard Methods.
@since(version = 0.2.0)
Expand All @@ -36,7 +36,7 @@ interface types {
}

/// These cases are inspired by the IANA HTTP Proxy Error Types:
/// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types
/// <https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types>
@since(version = 0.2.0)
variant error-code {
DNS-timeout,
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/io/error.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.2;
package wasi:io@0.2.3;

@since(version = 0.2.0)
interface error {
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/io/poll.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.2;
package wasi:io@0.2.3;

/// A poll API intended to let users wait for I/O events on multiple handles
/// at once.
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/io/streams.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.2;
package wasi:io@0.2.3;

/// WASI I/O is an I/O abstraction API which is currently focused on providing
/// stream types.
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/io/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.2;
package wasi:io@0.2.3;

@since(version = 0.2.0)
world imports {
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/random/insecure-seed.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:random@0.2.2;
package wasi:random@0.2.3;
/// The insecure-seed interface for seeding hash-map DoS resistance.
///
/// It is intended to be portable at least between Unix-family platforms and
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/random/insecure.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:random@0.2.2;
package wasi:random@0.2.3;
/// The insecure interface for insecure pseudo-random numbers.
///
/// It is intended to be portable at least between Unix-family platforms and
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/random/random.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:random@0.2.2;
package wasi:random@0.2.3;
/// WASI Random is a random data API.
///
/// It is intended to be portable at least between Unix-family platforms and
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/random/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:random@0.2.2;
package wasi:random@0.2.3;

@since(version = 0.2.0)
world imports {
Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/sockets/ip-name-lookup.wit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@since(version = 0.2.0)
interface ip-name-lookup {
@since(version = 0.2.0)
use wasi:io/poll@0.2.2.{pollable};
use wasi:io/poll@0.2.3.{pollable};
@since(version = 0.2.0)
use network.{network, error-code, ip-address};

Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/sockets/network.wit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@since(version = 0.2.0)
interface network {
@unstable(feature = network-error-code)
use wasi:io/error@0.2.2.{error};
use wasi:io/error@0.2.3.{error};

/// An opaque resource that represents access to (a subset of) the network.
/// This enables context-based security for networking.
Expand Down
6 changes: 3 additions & 3 deletions test/wit/deps/sockets/tcp.wit
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@since(version = 0.2.0)
interface tcp {
@since(version = 0.2.0)
use wasi:io/streams@0.2.2.{input-stream, output-stream};
use wasi:io/streams@0.2.3.{input-stream, output-stream};
@since(version = 0.2.0)
use wasi:io/poll@0.2.2.{pollable};
use wasi:io/poll@0.2.3.{pollable};
@since(version = 0.2.0)
use wasi:clocks/monotonic-clock@0.2.2.{duration};
use wasi:clocks/monotonic-clock@0.2.3.{duration};
@since(version = 0.2.0)
use network.{network, error-code, ip-socket-address, ip-address-family};

Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/sockets/udp.wit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@since(version = 0.2.0)
interface udp {
@since(version = 0.2.0)
use wasi:io/poll@0.2.2.{pollable};
use wasi:io/poll@0.2.3.{pollable};
@since(version = 0.2.0)
use network.{network, error-code, ip-socket-address, ip-address-family};

Expand Down
2 changes: 1 addition & 1 deletion test/wit/deps/sockets/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:sockets@0.2.2;
package wasi:sockets@0.2.3;

@since(version = 0.2.0)
world imports {
Expand Down
Loading

0 comments on commit 6c06480

Please sign in to comment.