Skip to content

Commit 54bbab4

Browse files
authored
fix: allow to retain fetchEvent on all wasi 0.2.x versions (#178)
1 parent d8dd995 commit 54bbab4

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: |
4848
rustup toolchain install 1.77.1
4949
rustup target add wasm32-wasi --toolchain 1.77.1
50-
rustup target add wasm32-wasi
50+
rustup target add wasm32-wasip1
5151
5252
- uses: actions/setup-node@v4
5353
with:
@@ -96,7 +96,7 @@ jobs:
9696
run: |
9797
rustup toolchain install 1.77.1
9898
rustup target add wasm32-wasi --toolchain 1.77.1
99-
rustup target add wasm32-wasi
99+
rustup target add wasm32-wasip1
100100
101101
- name: Restore Embedding Splicer from cache
102102
uses: actions/cache/restore@v4
@@ -165,7 +165,7 @@ jobs:
165165
run: |
166166
rustup toolchain install 1.77.1
167167
rustup target add wasm32-wasi --toolchain 1.77.1
168-
rustup target add wasm32-wasi
168+
rustup target add wasm32-wasip1
169169
170170
- name: Restore Embedding Splicer from cache
171171
uses: actions/cache/restore@v4

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ debug: lib/starlingmonkey_embedding.debug.wasm lib/spidermonkey-embedding-splice
1414
release: lib/starlingmonkey_embedding.wasm lib/spidermonkey-embedding-splicer.js
1515
release-weval: lib/starlingmonkey_ics.wevalcache lib/spidermonkey-embedding-splicer.js
1616

17-
lib/spidermonkey-embedding-splicer.js: target/wasm32-wasi/release/spidermonkey_embedding_splicer.wasm crates/spidermonkey-embedding-splicer/wit/spidermonkey-embedding-splicer.wit | obj lib
18-
@$(JCO) new target/wasm32-wasi/release/spidermonkey_embedding_splicer.wasm -o obj/spidermonkey-embedding-splicer.wasm --wasi-reactor
17+
lib/spidermonkey-embedding-splicer.js: target/wasm32-wasip1/release/spidermonkey_embedding_splicer.wasm crates/spidermonkey-embedding-splicer/wit/spidermonkey-embedding-splicer.wit | obj lib
18+
@$(JCO) new target/wasm32-wasip1/release/spidermonkey_embedding_splicer.wasm -o obj/spidermonkey-embedding-splicer.wasm --wasi-reactor
1919
@$(JCO) transpile -q --name spidermonkey-embedding-splicer obj/spidermonkey-embedding-splicer.wasm -o lib -- -O1
2020

21-
target/wasm32-wasi/release/spidermonkey_embedding_splicer.wasm: Cargo.toml crates/spidermonkey-embedding-splicer/Cargo.toml crates/spidermonkey-embedding-splicer/src/*.rs
22-
cargo build --release --target wasm32-wasi
21+
target/wasm32-wasip1/release/spidermonkey_embedding_splicer.wasm: Cargo.toml crates/spidermonkey-embedding-splicer/Cargo.toml crates/spidermonkey-embedding-splicer/src/*.rs
22+
cargo build --release --target wasm32-wasip1
2323

2424
lib/starlingmonkey_embedding.wasm: StarlingMonkey/cmake/* embedding/* StarlingMonkey/runtime/* StarlingMonkey/builtins/* StarlingMonkey/builtins/*/* StarlingMonkey/builtins/*/*/* StarlingMonkey/include/* | lib
2525
cmake -B build-release -DCMAKE_BUILD_TYPE=Release

crates/spidermonkey-embedding-splicer/src/bindgen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl JsBindgen<'_> {
429429
// can be used when an explicit export is not
430430
// defined by the guest content.
431431
if iface_name == "incoming-handler"
432-
|| name == "wasi:http/[email protected].0"
432+
|| name.starts_with("wasi:http/[email protected].")
433433
{
434434
if !features.contains(&Features::Http) {
435435
bail!(

crates/spidermonkey-embedding-splicer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl Guest for SpidermonkeyEmbeddingSplicerComponent {
176176
.find(|(key, _)| {
177177
engine_resolve
178178
.name_world_key(key)
179-
.starts_with("wasi:http/[email protected]")
179+
.starts_with("wasi:http/[email protected].")
180180
})
181181
.map(|(key, _)| key.clone());
182182

test/builtins/performance.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ export const source = `
1515
};
1616
`;
1717

18-
export async function test (run) {
18+
export async function test(run) {
1919
const { stdout, stderr } = await run();
2020
strictEqual(stdout, 'Calculated fib 1000: 4.346655768693743e+208\n');
2121

2222
ok(stderr.includes(' ms'));
2323
const time = Number(stderr.split(' ms')[0]);
2424
// TODO: fix back to half a millisecond when Weval fix is added
25-
if (time > 3) {
25+
if (time > 4) {
2626
throw new Error('took more than half a millisecond - ' + time + ' ms');
2727
}
2828
}

0 commit comments

Comments
 (0)