diff --git a/crates/js-component-bindgen/src/function_bindgen.rs b/crates/js-component-bindgen/src/function_bindgen.rs index 817a2c3b6..49a8aff48 100644 --- a/crates/js-component-bindgen/src/function_bindgen.rs +++ b/crates/js-component-bindgen/src/function_bindgen.rs @@ -1103,7 +1103,7 @@ impl Bindgen for FunctionBindgen<'_> { ); } - // after a high level call, we need to deactivate the component resource borrows + // After a high level call, we need to deactivate the component resource borrows. if !self.cur_resource_borrows.is_empty() { for resource_borrow in &self.cur_resource_borrows { uwriteln!(self.src, "{}", resource_borrow); @@ -1189,61 +1189,57 @@ impl Bindgen for FunctionBindgen<'_> { let rid = rid.as_u32(); let symbol_dispose = self.intrinsic(Intrinsic::SymbolDispose); let rsc_table_remove = self.intrinsic(Intrinsic::ResourceTableRemove); - let rep = format!("rep{}", self.tmp()); + let rsc_flag = self.intrinsic(Intrinsic::ResourceTableFlag); if !imported { let symbol_resource_handle = self.intrinsic(Intrinsic::SymbolResourceHandle); - let rsc_flag = self.intrinsic(Intrinsic::ResourceTableFlag); - uwrite!( - self.src, - "var {rsc} = new.target === {local_name} ? this : Object.create({local_name}.prototype); - var {rep} = handleTable{tid}[({handle} << 1) + 1] & ~{rsc_flag}; - Object.defineProperty({rsc}, {symbol_resource_handle}, {{ writable: true, value: {rep} }}); - ", - ); + uwriteln!(self.src, "var {rsc} = new.target === {local_name} ? this : Object.create({local_name}.prototype);"); if is_own { - // when we share an own handle with JS, we need to remove the original handle - // and add a finalizer to the JS handle created - // in addition, we add a Symbol.dispose function for manual destructor calls - // / integration with explicit resource management + // Sending an own handle out to JS as a return value - set up finalizer and disposal. let empty_func = self.intrinsic(Intrinsic::EmptyFunc); - uwriteln!( - self.src, - "finalizationRegistry{tid}.register({rsc}, {handle}, {rsc}); - Object.defineProperty({rsc}, {symbol_dispose}, {{ writable: true, value: function () {{{}}} }}); - {rsc_table_remove}(handleTable{tid}, {handle}); - ", - match dtor_name { - Some(dtor) => format!(" + uwriteln!(self.src, + "Object.defineProperty({rsc}, {symbol_resource_handle}, {{ writable: true, value: {handle} }}); + finalizationRegistry{tid}.register({rsc}, {handle}, {rsc});"); + if let Some(dtor) = dtor_name { + // The Symbol.dispose function gets disabled on drop, so we can rely on the own handle remaining valid. + uwriteln!( + self.src, + "Object.defineProperty({rsc}, {symbol_dispose}, {{ writable: true, value: function () {{ finalizationRegistry{tid}.unregister({rsc}); {rsc_table_remove}(handleTable{tid}, {handle}); {rsc}[{symbol_dispose}] = {empty_func}; {rsc}[{symbol_resource_handle}] = null; - {dtor}({rep}); - "), - None => "".into(), - } - ); + {dtor}(handleTable{tid}[({handle} << 1) + 1] & ~{rsc_flag}); + }}}});" + ); + } else { + // Set up Symbol.dispose for borrows to allow its call, even though it does nothing. + uwriteln!( + self.src, + "Object.defineProperty({rsc}, {symbol_dispose}, {{ writable: true, value: {empty_func} }});", + ); + } } else { - // borrow handles are tracked to release after the call by CallInterface + // Borrow handles of local resources have rep handles, which we carry through here. + uwriteln!(self.src, "Object.defineProperty({rsc}, {symbol_resource_handle}, {{ writable: true, value: {handle} }});"); + // Borrow handles are tracked to release after the call by CallInterface. + // Once may_enter and may_leave are properly implemented, we can be certain to avoid non-reentrancy of import calls + // calling export calls with borrow handles, so can maintain the invariant that borrows cannot ever be passed in. self.cur_resource_borrows.push(format!( "{}[{symbol_resource_handle}] = null;", rsc.to_string() )); } } else { - // imported handles either lift as instance capture from a previous lowering, - // or we create a new JS class to represent it - let rsc_flag = self.intrinsic(Intrinsic::ResourceTableFlag); + let rep = format!("rep{}", self.tmp()); + // Imported handles either lift as instance capture from a previous lowering, + // or we create a new JS class to represent it. let symbol_resource_rep = self.intrinsic(Intrinsic::SymbolResourceRep); let symbol_resource_handle = self.intrinsic(Intrinsic::SymbolResourceHandle); - uwriteln!( - self.src, - "var {rep} = handleTable{tid}[({handle} << 1) + 1] & ~{rsc_flag};" - ); uwriteln!(self.src, - "var {rsc} = captureTable{rid}.get({rep}); + "var {rep} = handleTable{tid}[({handle} << 1) + 1] & ~{rsc_flag}; + var {rsc} = captureTable{rid}.get({rep}); if (!{rsc}) {{ {rsc} = Object.create({local_name}.prototype); Object.defineProperty({rsc}, {symbol_resource_handle}, {{ writable: true, value: {handle} }}); @@ -1251,7 +1247,7 @@ impl Bindgen for FunctionBindgen<'_> { }}" ); if is_own { - // an own lifting is a transfer to JS, so existing own handle is implicitly dropped + // An own lifting is a transfer to JS, so existing own handle is implicitly dropped. uwriteln!( self.src, "else {{ @@ -1260,7 +1256,7 @@ impl Bindgen for FunctionBindgen<'_> { {rsc_table_remove}(handleTable{tid}, {handle});" ); } else { - // if lifting a borrow, that was not previously captured, create the class + // If lifting a borrow, that was not previously captured, create the class. self.cur_resource_borrows.push(format!( "{}[{symbol_resource_handle}] = null;", rsc.to_string() @@ -1341,66 +1337,62 @@ impl Bindgen for FunctionBindgen<'_> { let tid = tid.as_u32(); let rid = rid.as_u32(); if !imported { - uwriteln!( - self.src, - "var {handle} = {op}[{symbol_resource_handle}]; - if (!{handle}) {{ - throw new Error('Resource error: Not a valid \"{class_name}\" resource.'); - }} - ", - ); - if is_own { let empty_func = self.intrinsic(Intrinsic::EmptyFunc); uwriteln!( self.src, - "finalizationRegistry{tid}.unregister({op}); + "var {handle} = {op}[{symbol_resource_handle}]; + if (!{handle}) {{ + throw new Error('Resource error: Not a valid \"{class_name}\" resource.'); + }} + finalizationRegistry{tid}.unregister({op}); {op}[{symbol_dispose}] = {empty_func}; {op}[{symbol_resource_handle}] = null;" ); + } else { + // When expecting a borrow, the JS resource provided will always be an own + // handle. This is because it is not possible for borrow handles to be passed + // back reentrantly. + // We then set the handle to the rep per the local borrow rule. + let rsc_flag = self.intrinsic(Intrinsic::ResourceTableFlag); + let own_handle = format!("handle{}", self.tmp()); + uwriteln!(self.src, + "var {own_handle} = {op}[{symbol_resource_handle}]; + if (!{own_handle} || (handleTable{tid}[({own_handle} << 1) + 1] & {rsc_flag}) === 0) {{ + throw new Error('Resource error: Not a valid \"{class_name}\" resource.'); + }} + var {handle} = handleTable{tid}[({own_handle} << 1) + 1] & ~{rsc_flag};" + ); } } else { - // imported resources may already have a handle if they were constructed - // by a component and then passed out + // Imported resources may already have a handle if they were constructed + // by a component and then passed out. uwriteln!( self.src, "if (!({op} instanceof {local_name})) {{ throw new Error('Resource error: Not a valid \"{class_name}\" resource.'); }} - var {handle} = {op}[{symbol_resource_handle}]; - " + var {handle} = {op}[{symbol_resource_handle}];" ); - // otherwise, in hybrid bindgen we check for a Symbol.for('cabiRep') - // to get the resource rep - // fall back to assign a new rep in the capture table, when the imported - // resource was constructed externally - if is_own { - let symbol_resource_rep = - self.intrinsic(Intrinsic::SymbolResourceRep); - let rsc_table_create = - self.intrinsic(Intrinsic::ResourceTableCreateOwn); - uwriteln!( - self.src, - "if (!{handle}) {{ - const rep = {op}[{symbol_resource_rep}] || ++captureCnt{rid}; - captureTable{rid}.set(rep, {op}); - {handle} = {rsc_table_create}(handleTable{tid}, rep); - }}" - ); + // Otherwise, in hybrid bindgen we check for a Symbol.for('cabiRep') + // to get the resource rep. + // Fall back to assign a new rep in the capture table, when the imported + // resource was constructed externally. + let symbol_resource_rep = self.intrinsic(Intrinsic::SymbolResourceRep); + let rsc_table_create = if is_own { + self.intrinsic(Intrinsic::ResourceTableCreateOwn) } else { - let symbol_resource_rep = - self.intrinsic(Intrinsic::SymbolResourceRep); - let rsc_table_create = - self.intrinsic(Intrinsic::ResourceTableCreateBorrow); - uwriteln!( - self.src, - "if (!{handle}) {{ - const rep = {op}[{symbol_resource_rep}] || ++captureCnt{rid}; - captureTable{rid}.set(rep, {op}); - {handle} = {rsc_table_create}(handleTable{tid}, rep); - }}" - ); + self.intrinsic(Intrinsic::ScopeId); + self.intrinsic(Intrinsic::ResourceTableCreateBorrow) }; + uwriteln!( + self.src, + "if (!{handle}) {{ + const rep = {op}[{symbol_resource_rep}] || ++captureCnt{rid}; + captureTable{rid}.set(rep, {op}); + {handle} = {rsc_table_create}(handleTable{tid}, rep); + }}" + ); } } @@ -1415,21 +1407,37 @@ impl Bindgen for FunctionBindgen<'_> { if !imported { let local_rep = format!("localRep{}", self.tmp()); - uwrite!( + uwriteln!( self.src, "if (!({op} instanceof {upper_camel})) {{ - throw new Error('Resource error: Not a valid \"{upper_camel}\" resource.'); - }} - let {handle} = {op}[{symbol_resource_handle}]; - if ({handle} === undefined) {{ - var {local_rep} = repCnt++; - repTable.set({local_rep}, {{ rep: {op}, own: {is_own} }}); - {handle} = $resource_{prefix}new${lower_camel}({local_rep}); - {op}[{symbol_resource_handle}] = {handle}; - finalizationRegistry_export${prefix}{lower_camel}.register({op}, {handle}, {op}); - }} - " + throw new Error('Resource error: Not a valid \"{upper_camel}\" resource.'); + }} + let {handle} = {op}[{symbol_resource_handle}];" ); + + if is_own { + uwriteln!( + self.src, + "if ({handle} === undefined) {{ + var {local_rep} = repCnt++; + repTable.set({local_rep}, {{ rep: {op}, own: true }}); + {handle} = $resource_{prefix}new${lower_camel}({local_rep}); + {op}[{symbol_resource_handle}] = {handle}; + finalizationRegistry_export${prefix}{lower_camel}.register({op}, {handle}, {op}); + }} + " + ); + } else { + uwriteln!( + self.src, + "if ({handle} === undefined) {{ + var {local_rep} = repCnt++; + repTable.set({local_rep}, {{ rep: {op}, own: false }}); + {op}[{symbol_resource_handle}] = {local_rep}; + }} + " + ); + } } else { let symbol_resource_handle = self.intrinsic(Intrinsic::SymbolResourceHandle); diff --git a/crates/js-component-bindgen/src/transpile_bindgen.rs b/crates/js-component-bindgen/src/transpile_bindgen.rs index 21bda1fda..b0f25fa83 100644 --- a/crates/js-component-bindgen/src/transpile_bindgen.rs +++ b/crates/js-component-bindgen/src/transpile_bindgen.rs @@ -763,12 +763,12 @@ impl<'a> Instantiator<'a, '_> { "".into() } } else { - // imported resource is one without a defined resource index - // if it is a captured instance (class instance was created externally so had to + // Imported resource is one without a defined resource index. + // If it is a captured instance (class instance was created externally so had to // be assigned a rep), and there is a Symbol.dispose handler, call it explicitly - // for imported resources when the resource is dropped, otherwise - // if it is an instance without a captured class definition, then call the - // low-level bindgen destructor + // for imported resources when the resource is dropped. + // Otherwise if it is an instance without a captured class definition, then + // call the low-level bindgen destructor. let symbol_dispose = self.gen.intrinsic(Intrinsic::SymbolDispose); let symbol_cabi_dispose = self.gen.intrinsic(Intrinsic::SymbolCabiDispose); @@ -792,14 +792,14 @@ impl<'a> Instantiator<'a, '_> { } }; - // If the unexpected borrow handle case does ever happen in further testing, - // then we must handle this. let rsc_table_remove = self.gen.intrinsic(Intrinsic::ResourceTableRemove); uwrite!( self.src.js, "function trampoline{i}(handle) {{ const handleEntry = {rsc_table_remove}(handleTable{tid}, handle); - if (!handleEntry.own) throw new Error('Internal error: Unexpected borrow handle');{dtor} + if (handleEntry.own) {{ + {dtor} + }} }} ", ); @@ -1164,7 +1164,7 @@ impl<'a> Instantiator<'a, '_> { Some(BindingsMode::DirectOptimized) => { uwriteln!( self.src.js_init, - "trampoline{} = {callee_name}({memory}, {realloc}, {post_return}, {string_encoding});", + "trampoline{} = {callee_name}({memory}{realloc}{post_return}{string_encoding});", trampoline.as_u32() ); } diff --git a/package.json b/package.json index 10bd0da24..f5bf2c3f6 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "terser": "^5" }, "devDependencies": { - "@bytecodealliance/componentize-js": "^0.7.0", + "@bytecodealliance/componentize-js": "^0.8.0", "@types/node": "^18.11.17", "@typescript-eslint/eslint-plugin": "^5.41.0", "@typescript-eslint/parser": "^5.41.0", diff --git a/packages/preview2-shim/lib/nodejs/clocks.js b/packages/preview2-shim/lib/nodejs/clocks.js index 1aad968f1..929bbc71d 100644 --- a/packages/preview2-shim/lib/nodejs/clocks.js +++ b/packages/preview2-shim/lib/nodejs/clocks.js @@ -38,7 +38,7 @@ export const wallClock = { monotonicClock.resolution[symbolCabiLower] = () => resolution; monotonicClock.now[symbolCabiLower] = () => hrtime.bigint; -wallClock.resolution[symbolCabiLower] = (memory) => { +wallClock.resolution[symbolCabiLower] = ({ memory }) => { let buf32 = new Int32Array(memory.buffer); return function now(retptr) { if (memory.buffer !== buf32.buffer) buf32 = new Int32Array(memory.buffer); @@ -49,7 +49,7 @@ wallClock.resolution[symbolCabiLower] = (memory) => { }; }; -wallClock.now[symbolCabiLower] = (memory) => { +wallClock.now[symbolCabiLower] = ({ memory }) => { let buf32 = new Int32Array(memory.buffer); let buf64 = new BigInt64Array(memory.buffer); return function now(retptr) { diff --git a/packages/preview2-shim/lib/nodejs/random.js b/packages/preview2-shim/lib/nodejs/random.js index b43f6e0cd..ae4828980 100644 --- a/packages/preview2-shim/lib/nodejs/random.js +++ b/packages/preview2-shim/lib/nodejs/random.js @@ -31,7 +31,7 @@ function getRandomBytes(len) { return randomBytes(Number(len)); } -randomBytes[Symbol.for("cabiLower")] = ({ memory, realloc }) => { +getRandomBytes[Symbol.for("cabiLower")] = ({ memory, realloc }) => { let buf32 = new Uint32Array(memory.buffer); return function randomBytes(len, retptr) { len = Number(len); diff --git a/src/cmd/componentize.js b/src/cmd/componentize.js index c821bdd4c..b2394c3a6 100644 --- a/src/cmd/componentize.js +++ b/src/cmd/componentize.js @@ -1,5 +1,5 @@ import { readFile, writeFile } from 'node:fs/promises'; -import { resolve } from 'node:path'; +import { resolve, basename } from 'node:path'; import c from 'chalk-template'; export async function componentize (jsSource, opts) { @@ -13,7 +13,7 @@ export async function componentize (jsSource, opts) { } const source = await readFile(jsSource, 'utf8'); const { component, imports } = await componentizeFn(source, { - sourceName: jsSource, + sourceName: basename(jsSource), witPath: resolve(opts.wit), worldName: opts.worldName, enableStdout: opts.enableStdout, diff --git a/test/cli.js b/test/cli.js index ce49e7cf8..af5e1ed1e 100644 --- a/test/cli.js +++ b/test/cli.js @@ -441,7 +441,7 @@ export async function cliTest(fixtures) { ]); }); - test("Componentize", async () => { + (process.platform === 'win32' ? test.skip : test)("Componentize", async () => { const { stdout, stderr } = await exec( jcoPath, "componentize", diff --git a/test/preview2.js b/test/preview2.js index fae24a968..c265abf8b 100644 --- a/test/preview2.js +++ b/test/preview2.js @@ -61,7 +61,7 @@ export async function preview2Test() { strictEqual(stderr, "writing to stderr: hello, world\n"); }); - test("wasi-http-proxy", async () => { + (process.platform === 'win32' ? test.skip : test)("wasi-http-proxy", async () => { const server = createServer(async (req, res) => { if (req.url == "/api/examples") { res.writeHead(200, { diff --git a/tests/gen/api_proxy.component.wasm b/tests/gen/api_proxy.component.wasm index de38604d9..60a2987ef 100644 Binary files a/tests/gen/api_proxy.component.wasm and b/tests/gen/api_proxy.component.wasm differ diff --git a/tests/gen/api_proxy_streaming.component.wasm b/tests/gen/api_proxy_streaming.component.wasm index 7f3cf7e42..76977c77f 100644 Binary files a/tests/gen/api_proxy_streaming.component.wasm and b/tests/gen/api_proxy_streaming.component.wasm differ diff --git a/tests/gen/api_reactor.component.wasm b/tests/gen/api_reactor.component.wasm index a11d71a7a..5541de403 100644 Binary files a/tests/gen/api_reactor.component.wasm and b/tests/gen/api_reactor.component.wasm differ diff --git a/tests/gen/api_read_only.component.wasm b/tests/gen/api_read_only.component.wasm index f954dedb0..2bc45620c 100644 Binary files a/tests/gen/api_read_only.component.wasm and b/tests/gen/api_read_only.component.wasm differ diff --git a/tests/gen/api_time.component.wasm b/tests/gen/api_time.component.wasm index 9b1b52308..d16c7ae20 100644 Binary files a/tests/gen/api_time.component.wasm and b/tests/gen/api_time.component.wasm differ diff --git a/tests/gen/cli_args.component.wasm b/tests/gen/cli_args.component.wasm index 4d52961fd..75630732d 100644 Binary files a/tests/gen/cli_args.component.wasm and b/tests/gen/cli_args.component.wasm differ diff --git a/tests/gen/cli_default_clocks.component.wasm b/tests/gen/cli_default_clocks.component.wasm index de47e266d..47cf30eb3 100644 Binary files a/tests/gen/cli_default_clocks.component.wasm and b/tests/gen/cli_default_clocks.component.wasm differ diff --git a/tests/gen/cli_directory_list.component.wasm b/tests/gen/cli_directory_list.component.wasm index 7d38f7a9b..2bdd5c4c5 100644 Binary files a/tests/gen/cli_directory_list.component.wasm and b/tests/gen/cli_directory_list.component.wasm differ diff --git a/tests/gen/cli_env.component.wasm b/tests/gen/cli_env.component.wasm index 96cdccb64..281fcf83c 100644 Binary files a/tests/gen/cli_env.component.wasm and b/tests/gen/cli_env.component.wasm differ diff --git a/tests/gen/cli_exit_default.component.wasm b/tests/gen/cli_exit_default.component.wasm index ace217206..083671f8d 100644 Binary files a/tests/gen/cli_exit_default.component.wasm and b/tests/gen/cli_exit_default.component.wasm differ diff --git a/tests/gen/cli_exit_failure.component.wasm b/tests/gen/cli_exit_failure.component.wasm index 515c387df..34805d6c1 100644 Binary files a/tests/gen/cli_exit_failure.component.wasm and b/tests/gen/cli_exit_failure.component.wasm differ diff --git a/tests/gen/cli_exit_panic.component.wasm b/tests/gen/cli_exit_panic.component.wasm index b26335a35..56efa0f58 100644 Binary files a/tests/gen/cli_exit_panic.component.wasm and b/tests/gen/cli_exit_panic.component.wasm differ diff --git a/tests/gen/cli_exit_success.component.wasm b/tests/gen/cli_exit_success.component.wasm index 59dc338ec..167d16e91 100644 Binary files a/tests/gen/cli_exit_success.component.wasm and b/tests/gen/cli_exit_success.component.wasm differ diff --git a/tests/gen/cli_export_cabi_realloc.component.wasm b/tests/gen/cli_export_cabi_realloc.component.wasm index a189e7f23..52be8684a 100644 Binary files a/tests/gen/cli_export_cabi_realloc.component.wasm and b/tests/gen/cli_export_cabi_realloc.component.wasm differ diff --git a/tests/gen/cli_file_append.component.wasm b/tests/gen/cli_file_append.component.wasm index 5da3cc8a6..6a3f66049 100644 Binary files a/tests/gen/cli_file_append.component.wasm and b/tests/gen/cli_file_append.component.wasm differ diff --git a/tests/gen/cli_file_dir_sync.component.wasm b/tests/gen/cli_file_dir_sync.component.wasm index aadd78184..85db7bb4f 100644 Binary files a/tests/gen/cli_file_dir_sync.component.wasm and b/tests/gen/cli_file_dir_sync.component.wasm differ diff --git a/tests/gen/cli_file_read.component.wasm b/tests/gen/cli_file_read.component.wasm index 286bbdb9e..b13e9ac3d 100644 Binary files a/tests/gen/cli_file_read.component.wasm and b/tests/gen/cli_file_read.component.wasm differ diff --git a/tests/gen/cli_hello_stdout.component.wasm b/tests/gen/cli_hello_stdout.component.wasm index 62a6e7fb1..172f43878 100644 Binary files a/tests/gen/cli_hello_stdout.component.wasm and b/tests/gen/cli_hello_stdout.component.wasm differ diff --git a/tests/gen/cli_no_ip_name_lookup.component.wasm b/tests/gen/cli_no_ip_name_lookup.component.wasm index 2c590c6dc..34db60add 100644 Binary files a/tests/gen/cli_no_ip_name_lookup.component.wasm and b/tests/gen/cli_no_ip_name_lookup.component.wasm differ diff --git a/tests/gen/cli_no_tcp.component.wasm b/tests/gen/cli_no_tcp.component.wasm index 9dacd3c79..e4606659d 100644 Binary files a/tests/gen/cli_no_tcp.component.wasm and b/tests/gen/cli_no_tcp.component.wasm differ diff --git a/tests/gen/cli_no_udp.component.wasm b/tests/gen/cli_no_udp.component.wasm index 5b90a7e0a..f73c374f0 100644 Binary files a/tests/gen/cli_no_udp.component.wasm and b/tests/gen/cli_no_udp.component.wasm differ diff --git a/tests/gen/cli_splice_stdin.component.wasm b/tests/gen/cli_splice_stdin.component.wasm index 1648d4d0e..11d3761e3 100644 Binary files a/tests/gen/cli_splice_stdin.component.wasm and b/tests/gen/cli_splice_stdin.component.wasm differ diff --git a/tests/gen/cli_stdin.component.wasm b/tests/gen/cli_stdin.component.wasm index c32c4a553..942644fc7 100644 Binary files a/tests/gen/cli_stdin.component.wasm and b/tests/gen/cli_stdin.component.wasm differ diff --git a/tests/gen/cli_stdio_write_flushes.component.wasm b/tests/gen/cli_stdio_write_flushes.component.wasm index 834c9c635..530af89cb 100644 Binary files a/tests/gen/cli_stdio_write_flushes.component.wasm and b/tests/gen/cli_stdio_write_flushes.component.wasm differ diff --git a/tests/gen/deno_api_reactor.rs b/tests/gen/deno_api_reactor.rs deleted file mode 100644 index b502f0b85..000000000 --- a/tests/gen/deno_api_reactor.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use std::process::{Command, Stdio}; - -#[test] -fn api_reactor() -> anyhow::Result<()> { - { - let wasi_file = "./tests/gen/api_reactor.component.wasm"; - let _ = fs::remove_dir_all("./tests/rundir/deno_api_reactor"); - let mut cmd1 = Command::new("node"); - cmd1.arg("./src/jco.js"); - cmd1.arg("run"); - cmd1.env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A"); - cmd1.arg("--jco-dir"); - cmd1.arg("./tests/rundir/deno_api_reactor"); - cmd1.arg("--jco-import"); - cmd1.arg("./tests/virtualenvs/base.js"); - cmd1.arg("--jco-import-bindings"); - cmd1.arg("hybrid"); - cmd1.arg(wasi_file); - cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]); - cmd1.stdin(Stdio::null()); - let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program"); - let status = cmd1_child.wait().expect("failed to wait on child"); - assert!(status.success(), "test execution failed"); - } - Ok(()) -} diff --git a/tests/gen/deno_api_time.rs b/tests/gen/deno_api_time.rs deleted file mode 100644 index 6fbc7cf69..000000000 --- a/tests/gen/deno_api_time.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use std::process::{Command, Stdio}; - -#[test] -fn api_time() -> anyhow::Result<()> { - { - let wasi_file = "./tests/gen/api_time.component.wasm"; - let _ = fs::remove_dir_all("./tests/rundir/deno_api_time"); - let mut cmd1 = Command::new("node"); - cmd1.arg("./src/jco.js"); - cmd1.arg("run"); - cmd1.env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A"); - cmd1.arg("--jco-dir"); - cmd1.arg("./tests/rundir/deno_api_time"); - cmd1.arg("--jco-import"); - cmd1.arg("./tests/virtualenvs/fakeclocks.js"); - cmd1.arg("--jco-import-bindings"); - cmd1.arg("hybrid"); - cmd1.arg(wasi_file); - cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]); - cmd1.stdin(Stdio::null()); - let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program"); - let status = cmd1_child.wait().expect("failed to wait on child"); - assert!(status.success(), "test execution failed"); - } - Ok(()) -} diff --git a/tests/gen/deno_cli_args.rs b/tests/gen/deno_cli_args.rs deleted file mode 100644 index 9c8afc621..000000000 --- a/tests/gen/deno_cli_args.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use std::process::{Command, Stdio}; - -#[test] -fn cli_args() -> anyhow::Result<()> { - { - let wasi_file = "./tests/gen/cli_args.component.wasm"; - let _ = fs::remove_dir_all("./tests/rundir/deno_cli_args"); - let mut cmd1 = Command::new("node"); - cmd1.arg("./src/jco.js"); - cmd1.arg("run"); - cmd1.env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A"); - cmd1.arg("--jco-dir"); - cmd1.arg("./tests/rundir/deno_cli_args"); - cmd1.arg("--jco-import"); - cmd1.arg("./tests/virtualenvs/base.js"); - cmd1.arg("--jco-import-bindings"); - cmd1.arg("hybrid"); - cmd1.arg(wasi_file); - cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]); - cmd1.stdin(Stdio::null()); - let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program"); - let status = cmd1_child.wait().expect("failed to wait on child"); - assert!(status.success(), "test execution failed"); - } - Ok(()) -} diff --git a/tests/gen/deno_cli_env.rs b/tests/gen/deno_cli_env.rs deleted file mode 100644 index 76555a2fd..000000000 --- a/tests/gen/deno_cli_env.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use std::process::{Command, Stdio}; - -#[test] -fn cli_env() -> anyhow::Result<()> { - { - let wasi_file = "./tests/gen/cli_env.component.wasm"; - let _ = fs::remove_dir_all("./tests/rundir/deno_cli_env"); - let mut cmd1 = Command::new("node"); - cmd1.arg("./src/jco.js"); - cmd1.arg("run"); - cmd1.env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A"); - cmd1.arg("--jco-dir"); - cmd1.arg("./tests/rundir/deno_cli_env"); - cmd1.arg("--jco-import"); - cmd1.arg("./tests/virtualenvs/envtest.js"); - cmd1.arg("--jco-import-bindings"); - cmd1.arg("hybrid"); - cmd1.arg(wasi_file); - cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]); - cmd1.stdin(Stdio::null()); - let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program"); - let status = cmd1_child.wait().expect("failed to wait on child"); - assert!(status.success(), "test execution failed"); - } - Ok(()) -} diff --git a/tests/gen/deno_cli_exit_default.rs b/tests/gen/deno_cli_exit_default.rs deleted file mode 100644 index 53e85bf7e..000000000 --- a/tests/gen/deno_cli_exit_default.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use std::process::{Command, Stdio}; - -#[test] -fn cli_exit_default() -> anyhow::Result<()> { - { - let wasi_file = "./tests/gen/cli_exit_default.component.wasm"; - let _ = fs::remove_dir_all("./tests/rundir/deno_cli_exit_default"); - let mut cmd1 = Command::new("node"); - cmd1.arg("./src/jco.js"); - cmd1.arg("run"); - cmd1.env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A"); - cmd1.arg("--jco-dir"); - cmd1.arg("./tests/rundir/deno_cli_exit_default"); - cmd1.arg("--jco-import"); - cmd1.arg("./tests/virtualenvs/base.js"); - cmd1.arg("--jco-import-bindings"); - cmd1.arg("hybrid"); - cmd1.arg(wasi_file); - cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]); - cmd1.stdin(Stdio::null()); - let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program"); - let status = cmd1_child.wait().expect("failed to wait on child"); - assert!(status.success(), "test execution failed"); - } - Ok(()) -} diff --git a/tests/gen/deno_cli_exit_failure.rs b/tests/gen/deno_cli_exit_failure.rs deleted file mode 100644 index f85ef630b..000000000 --- a/tests/gen/deno_cli_exit_failure.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use std::process::{Command, Stdio}; - -#[test] -fn cli_exit_failure() -> anyhow::Result<()> { - { - let wasi_file = "./tests/gen/cli_exit_failure.component.wasm"; - let _ = fs::remove_dir_all("./tests/rundir/deno_cli_exit_failure"); - let mut cmd1 = Command::new("node"); - cmd1.arg("./src/jco.js"); - cmd1.arg("run"); - cmd1.env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A"); - cmd1.arg("--jco-dir"); - cmd1.arg("./tests/rundir/deno_cli_exit_failure"); - cmd1.arg("--jco-import"); - cmd1.arg("./tests/virtualenvs/base.js"); - cmd1.arg("--jco-import-bindings"); - cmd1.arg("hybrid"); - cmd1.arg(wasi_file); - cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]); - cmd1.stdin(Stdio::null()); - let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program"); - let status = cmd1_child.wait().expect("failed to wait on child"); - assert!(!status.success(), "test execution failed"); - } - Ok(()) -} diff --git a/tests/gen/deno_cli_exit_success.rs b/tests/gen/deno_cli_exit_success.rs deleted file mode 100644 index 8c7256d6e..000000000 --- a/tests/gen/deno_cli_exit_success.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use std::process::{Command, Stdio}; - -#[test] -fn cli_exit_success() -> anyhow::Result<()> { - { - let wasi_file = "./tests/gen/cli_exit_success.component.wasm"; - let _ = fs::remove_dir_all("./tests/rundir/deno_cli_exit_success"); - let mut cmd1 = Command::new("node"); - cmd1.arg("./src/jco.js"); - cmd1.arg("run"); - cmd1.env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A"); - cmd1.arg("--jco-dir"); - cmd1.arg("./tests/rundir/deno_cli_exit_success"); - cmd1.arg("--jco-import"); - cmd1.arg("./tests/virtualenvs/base.js"); - cmd1.arg("--jco-import-bindings"); - cmd1.arg("hybrid"); - cmd1.arg(wasi_file); - cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]); - cmd1.stdin(Stdio::null()); - let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program"); - let status = cmd1_child.wait().expect("failed to wait on child"); - assert!(status.success(), "test execution failed"); - } - Ok(()) -} diff --git a/tests/gen/deno_preview1_big_random_buf.rs b/tests/gen/deno_preview1_big_random_buf.rs deleted file mode 100644 index fce745f68..000000000 --- a/tests/gen/deno_preview1_big_random_buf.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use std::process::{Command, Stdio}; - -#[test] -fn preview1_big_random_buf() -> anyhow::Result<()> { - { - let wasi_file = "./tests/gen/preview1_big_random_buf.component.wasm"; - let _ = fs::remove_dir_all("./tests/rundir/deno_preview1_big_random_buf"); - let mut cmd1 = Command::new("node"); - cmd1.arg("./src/jco.js"); - cmd1.arg("run"); - cmd1.env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A"); - cmd1.arg("--jco-dir"); - cmd1.arg("./tests/rundir/deno_preview1_big_random_buf"); - cmd1.arg("--jco-import"); - cmd1.arg("./tests/virtualenvs/scratch.js"); - cmd1.arg("--jco-import-bindings"); - cmd1.arg("hybrid"); - cmd1.arg(wasi_file); - cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]); - cmd1.stdin(Stdio::null()); - let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program"); - let status = cmd1_child.wait().expect("failed to wait on child"); - assert!(status.success(), "test execution failed"); - } - Ok(()) -} diff --git a/tests/gen/deno_preview2_random.rs b/tests/gen/deno_preview2_random.rs deleted file mode 100644 index edace7b78..000000000 --- a/tests/gen/deno_preview2_random.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use std::process::{Command, Stdio}; - -#[test] -fn preview2_random() -> anyhow::Result<()> { - { - let wasi_file = "./tests/gen/preview2_random.component.wasm"; - let _ = fs::remove_dir_all("./tests/rundir/deno_preview2_random"); - let mut cmd1 = Command::new("node"); - cmd1.arg("./src/jco.js"); - cmd1.arg("run"); - cmd1.env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A"); - cmd1.arg("--jco-dir"); - cmd1.arg("./tests/rundir/deno_preview2_random"); - cmd1.arg("--jco-import"); - cmd1.arg("./tests/virtualenvs/base.js"); - cmd1.arg("--jco-import-bindings"); - cmd1.arg("hybrid"); - cmd1.arg(wasi_file); - cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]); - cmd1.stdin(Stdio::null()); - let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program"); - let status = cmd1_child.wait().expect("failed to wait on child"); - assert!(status.success(), "test execution failed"); - } - Ok(()) -} diff --git a/tests/gen/http_outbound_request_content_length.component.wasm b/tests/gen/http_outbound_request_content_length.component.wasm index 795ceb387..bb2d8a0c0 100644 Binary files a/tests/gen/http_outbound_request_content_length.component.wasm and b/tests/gen/http_outbound_request_content_length.component.wasm differ diff --git a/tests/gen/http_outbound_request_get.component.wasm b/tests/gen/http_outbound_request_get.component.wasm index 43bbbba25..1cd58273a 100644 Binary files a/tests/gen/http_outbound_request_get.component.wasm and b/tests/gen/http_outbound_request_get.component.wasm differ diff --git a/tests/gen/http_outbound_request_invalid_dnsname.component.wasm b/tests/gen/http_outbound_request_invalid_dnsname.component.wasm index ccd3e46e3..863460fea 100644 Binary files a/tests/gen/http_outbound_request_invalid_dnsname.component.wasm and b/tests/gen/http_outbound_request_invalid_dnsname.component.wasm differ diff --git a/tests/gen/http_outbound_request_invalid_header.component.wasm b/tests/gen/http_outbound_request_invalid_header.component.wasm index 560daa0de..dea0f3912 100644 Binary files a/tests/gen/http_outbound_request_invalid_header.component.wasm and b/tests/gen/http_outbound_request_invalid_header.component.wasm differ diff --git a/tests/gen/http_outbound_request_invalid_port.component.wasm b/tests/gen/http_outbound_request_invalid_port.component.wasm index 4771a274c..25638854d 100644 Binary files a/tests/gen/http_outbound_request_invalid_port.component.wasm and b/tests/gen/http_outbound_request_invalid_port.component.wasm differ diff --git a/tests/gen/http_outbound_request_invalid_version.component.wasm b/tests/gen/http_outbound_request_invalid_version.component.wasm index cd30ad714..d15f862c3 100644 Binary files a/tests/gen/http_outbound_request_invalid_version.component.wasm and b/tests/gen/http_outbound_request_invalid_version.component.wasm differ diff --git a/tests/gen/http_outbound_request_large_post.component.wasm b/tests/gen/http_outbound_request_large_post.component.wasm index bcda7b518..1f4911e66 100644 Binary files a/tests/gen/http_outbound_request_large_post.component.wasm and b/tests/gen/http_outbound_request_large_post.component.wasm differ diff --git a/tests/gen/http_outbound_request_post.component.wasm b/tests/gen/http_outbound_request_post.component.wasm index 0fa18bb79..7fe5b2145 100644 Binary files a/tests/gen/http_outbound_request_post.component.wasm and b/tests/gen/http_outbound_request_post.component.wasm differ diff --git a/tests/gen/http_outbound_request_put.component.wasm b/tests/gen/http_outbound_request_put.component.wasm index 9e5f65644..54a615937 100644 Binary files a/tests/gen/http_outbound_request_put.component.wasm and b/tests/gen/http_outbound_request_put.component.wasm differ diff --git a/tests/gen/http_outbound_request_response_build.component.wasm b/tests/gen/http_outbound_request_response_build.component.wasm index 844a70799..2d192902b 100644 Binary files a/tests/gen/http_outbound_request_response_build.component.wasm and b/tests/gen/http_outbound_request_response_build.component.wasm differ diff --git a/tests/gen/http_outbound_request_unknown_method.component.wasm b/tests/gen/http_outbound_request_unknown_method.component.wasm index ca0dfdbd4..2ba503c85 100644 Binary files a/tests/gen/http_outbound_request_unknown_method.component.wasm and b/tests/gen/http_outbound_request_unknown_method.component.wasm differ diff --git a/tests/gen/http_outbound_request_unsupported_scheme.component.wasm b/tests/gen/http_outbound_request_unsupported_scheme.component.wasm index e670b4149..1cb70e323 100644 Binary files a/tests/gen/http_outbound_request_unsupported_scheme.component.wasm and b/tests/gen/http_outbound_request_unsupported_scheme.component.wasm differ diff --git a/tests/gen/mod.rs b/tests/gen/mod.rs index c8e540274..cb6ff3bdd 100644 --- a/tests/gen/mod.rs +++ b/tests/gen/mod.rs @@ -20,15 +20,6 @@ mod cli_no_udp; mod cli_splice_stdin; mod cli_stdin; mod cli_stdio_write_flushes; -mod deno_api_reactor; -mod deno_api_time; -mod deno_cli_args; -mod deno_cli_env; -mod deno_cli_exit_default; -mod deno_cli_exit_failure; -mod deno_cli_exit_success; -mod deno_preview1_big_random_buf; -mod deno_preview2_random; mod http_outbound_request_content_length; mod http_outbound_request_get; mod http_outbound_request_invalid_dnsname; diff --git a/tests/gen/piped_multiple.component.wasm b/tests/gen/piped_multiple.component.wasm index 4e75645d3..498926c83 100644 Binary files a/tests/gen/piped_multiple.component.wasm and b/tests/gen/piped_multiple.component.wasm differ diff --git a/tests/gen/piped_polling.component.wasm b/tests/gen/piped_polling.component.wasm index 4fc59fe05..b8dc100e6 100644 Binary files a/tests/gen/piped_polling.component.wasm and b/tests/gen/piped_polling.component.wasm differ diff --git a/tests/gen/piped_simple.component.wasm b/tests/gen/piped_simple.component.wasm index 8922d2c71..8ca8fb00b 100644 Binary files a/tests/gen/piped_simple.component.wasm and b/tests/gen/piped_simple.component.wasm differ diff --git a/tests/gen/preview1_big_random_buf.component.wasm b/tests/gen/preview1_big_random_buf.component.wasm index 299247e65..a3c2b56f9 100644 Binary files a/tests/gen/preview1_big_random_buf.component.wasm and b/tests/gen/preview1_big_random_buf.component.wasm differ diff --git a/tests/gen/preview1_clock_time_get.component.wasm b/tests/gen/preview1_clock_time_get.component.wasm index ebff3034b..67defeb9d 100644 Binary files a/tests/gen/preview1_clock_time_get.component.wasm and b/tests/gen/preview1_clock_time_get.component.wasm differ diff --git a/tests/gen/preview1_close_preopen.component.wasm b/tests/gen/preview1_close_preopen.component.wasm index 1d14f25be..e30d78bee 100644 Binary files a/tests/gen/preview1_close_preopen.component.wasm and b/tests/gen/preview1_close_preopen.component.wasm differ diff --git a/tests/gen/preview1_dangling_fd.component.wasm b/tests/gen/preview1_dangling_fd.component.wasm index 069439918..81b116946 100644 Binary files a/tests/gen/preview1_dangling_fd.component.wasm and b/tests/gen/preview1_dangling_fd.component.wasm differ diff --git a/tests/gen/preview1_dangling_symlink.component.wasm b/tests/gen/preview1_dangling_symlink.component.wasm index 488759fd7..0cf9b06c1 100644 Binary files a/tests/gen/preview1_dangling_symlink.component.wasm and b/tests/gen/preview1_dangling_symlink.component.wasm differ diff --git a/tests/gen/preview1_dir_fd_op_failures.component.wasm b/tests/gen/preview1_dir_fd_op_failures.component.wasm index b883c9ca4..dc0638be2 100644 Binary files a/tests/gen/preview1_dir_fd_op_failures.component.wasm and b/tests/gen/preview1_dir_fd_op_failures.component.wasm differ diff --git a/tests/gen/preview1_directory_seek.component.wasm b/tests/gen/preview1_directory_seek.component.wasm index 627bd298f..a215b9350 100644 Binary files a/tests/gen/preview1_directory_seek.component.wasm and b/tests/gen/preview1_directory_seek.component.wasm differ diff --git a/tests/gen/preview1_fd_advise.component.wasm b/tests/gen/preview1_fd_advise.component.wasm index 95f165cbd..f0b6c0927 100644 Binary files a/tests/gen/preview1_fd_advise.component.wasm and b/tests/gen/preview1_fd_advise.component.wasm differ diff --git a/tests/gen/preview1_fd_filestat_get.component.wasm b/tests/gen/preview1_fd_filestat_get.component.wasm index 4e13ea54d..5ab8078cf 100644 Binary files a/tests/gen/preview1_fd_filestat_get.component.wasm and b/tests/gen/preview1_fd_filestat_get.component.wasm differ diff --git a/tests/gen/preview1_fd_filestat_set.component.wasm b/tests/gen/preview1_fd_filestat_set.component.wasm index 20d652bba..983c44aa4 100644 Binary files a/tests/gen/preview1_fd_filestat_set.component.wasm and b/tests/gen/preview1_fd_filestat_set.component.wasm differ diff --git a/tests/gen/preview1_fd_flags_set.component.wasm b/tests/gen/preview1_fd_flags_set.component.wasm index 62c101ce2..d2a7c913d 100644 Binary files a/tests/gen/preview1_fd_flags_set.component.wasm and b/tests/gen/preview1_fd_flags_set.component.wasm differ diff --git a/tests/gen/preview1_fd_readdir.component.wasm b/tests/gen/preview1_fd_readdir.component.wasm index a9706563a..2e4f37fd5 100644 Binary files a/tests/gen/preview1_fd_readdir.component.wasm and b/tests/gen/preview1_fd_readdir.component.wasm differ diff --git a/tests/gen/preview1_file_allocate.component.wasm b/tests/gen/preview1_file_allocate.component.wasm index 9e566d04f..5fc81986a 100644 Binary files a/tests/gen/preview1_file_allocate.component.wasm and b/tests/gen/preview1_file_allocate.component.wasm differ diff --git a/tests/gen/preview1_file_pread_pwrite.component.wasm b/tests/gen/preview1_file_pread_pwrite.component.wasm index 892b49eed..b993cc510 100644 Binary files a/tests/gen/preview1_file_pread_pwrite.component.wasm and b/tests/gen/preview1_file_pread_pwrite.component.wasm differ diff --git a/tests/gen/preview1_file_seek_tell.component.wasm b/tests/gen/preview1_file_seek_tell.component.wasm index 0036bd57d..43ce5921c 100644 Binary files a/tests/gen/preview1_file_seek_tell.component.wasm and b/tests/gen/preview1_file_seek_tell.component.wasm differ diff --git a/tests/gen/preview1_file_truncation.component.wasm b/tests/gen/preview1_file_truncation.component.wasm index b4ef9c779..8100de603 100644 Binary files a/tests/gen/preview1_file_truncation.component.wasm and b/tests/gen/preview1_file_truncation.component.wasm differ diff --git a/tests/gen/preview1_file_unbuffered_write.component.wasm b/tests/gen/preview1_file_unbuffered_write.component.wasm index 8ed5cbafb..6480225b9 100644 Binary files a/tests/gen/preview1_file_unbuffered_write.component.wasm and b/tests/gen/preview1_file_unbuffered_write.component.wasm differ diff --git a/tests/gen/preview1_file_write.component.wasm b/tests/gen/preview1_file_write.component.wasm index ec9ded7ab..00ab7a637 100644 Binary files a/tests/gen/preview1_file_write.component.wasm and b/tests/gen/preview1_file_write.component.wasm differ diff --git a/tests/gen/preview1_interesting_paths.component.wasm b/tests/gen/preview1_interesting_paths.component.wasm index dc737ee07..9f4892337 100644 Binary files a/tests/gen/preview1_interesting_paths.component.wasm and b/tests/gen/preview1_interesting_paths.component.wasm differ diff --git a/tests/gen/preview1_nofollow_errors.component.wasm b/tests/gen/preview1_nofollow_errors.component.wasm index 435e72bbd..9f2a5399e 100644 Binary files a/tests/gen/preview1_nofollow_errors.component.wasm and b/tests/gen/preview1_nofollow_errors.component.wasm differ diff --git a/tests/gen/preview1_overwrite_preopen.component.wasm b/tests/gen/preview1_overwrite_preopen.component.wasm index 2e24beb94..86cf0630c 100644 Binary files a/tests/gen/preview1_overwrite_preopen.component.wasm and b/tests/gen/preview1_overwrite_preopen.component.wasm differ diff --git a/tests/gen/preview1_path_exists.component.wasm b/tests/gen/preview1_path_exists.component.wasm index ae32af4c1..df837709b 100644 Binary files a/tests/gen/preview1_path_exists.component.wasm and b/tests/gen/preview1_path_exists.component.wasm differ diff --git a/tests/gen/preview1_path_filestat.component.wasm b/tests/gen/preview1_path_filestat.component.wasm index 6467f3c20..0ee149643 100644 Binary files a/tests/gen/preview1_path_filestat.component.wasm and b/tests/gen/preview1_path_filestat.component.wasm differ diff --git a/tests/gen/preview1_path_link.component.wasm b/tests/gen/preview1_path_link.component.wasm index 1bb5436db..a9b431592 100644 Binary files a/tests/gen/preview1_path_link.component.wasm and b/tests/gen/preview1_path_link.component.wasm differ diff --git a/tests/gen/preview1_path_open_create_existing.component.wasm b/tests/gen/preview1_path_open_create_existing.component.wasm index c0d80fa2d..4827c51be 100644 Binary files a/tests/gen/preview1_path_open_create_existing.component.wasm and b/tests/gen/preview1_path_open_create_existing.component.wasm differ diff --git a/tests/gen/preview1_path_open_dirfd_not_dir.component.wasm b/tests/gen/preview1_path_open_dirfd_not_dir.component.wasm index 2a187d968..bd43a24e2 100644 Binary files a/tests/gen/preview1_path_open_dirfd_not_dir.component.wasm and b/tests/gen/preview1_path_open_dirfd_not_dir.component.wasm differ diff --git a/tests/gen/preview1_path_open_lots.component.wasm b/tests/gen/preview1_path_open_lots.component.wasm index d6ee77a94..3f4e4f3d3 100644 Binary files a/tests/gen/preview1_path_open_lots.component.wasm and b/tests/gen/preview1_path_open_lots.component.wasm differ diff --git a/tests/gen/preview1_path_open_missing.component.wasm b/tests/gen/preview1_path_open_missing.component.wasm index f8fab25fd..b0742e648 100644 Binary files a/tests/gen/preview1_path_open_missing.component.wasm and b/tests/gen/preview1_path_open_missing.component.wasm differ diff --git a/tests/gen/preview1_path_open_nonblock.component.wasm b/tests/gen/preview1_path_open_nonblock.component.wasm index 144da630d..01a38d5ea 100644 Binary files a/tests/gen/preview1_path_open_nonblock.component.wasm and b/tests/gen/preview1_path_open_nonblock.component.wasm differ diff --git a/tests/gen/preview1_path_open_preopen.component.wasm b/tests/gen/preview1_path_open_preopen.component.wasm index a7969c6e7..4b0985ae2 100644 Binary files a/tests/gen/preview1_path_open_preopen.component.wasm and b/tests/gen/preview1_path_open_preopen.component.wasm differ diff --git a/tests/gen/preview1_path_open_read_write.component.wasm b/tests/gen/preview1_path_open_read_write.component.wasm index 74c9652d2..9b0c071f0 100644 Binary files a/tests/gen/preview1_path_open_read_write.component.wasm and b/tests/gen/preview1_path_open_read_write.component.wasm differ diff --git a/tests/gen/preview1_path_rename.component.wasm b/tests/gen/preview1_path_rename.component.wasm index 44a776137..56054307d 100644 Binary files a/tests/gen/preview1_path_rename.component.wasm and b/tests/gen/preview1_path_rename.component.wasm differ diff --git a/tests/gen/preview1_path_rename_dir_trailing_slashes.component.wasm b/tests/gen/preview1_path_rename_dir_trailing_slashes.component.wasm index 3ece079dc..06442ff0c 100644 Binary files a/tests/gen/preview1_path_rename_dir_trailing_slashes.component.wasm and b/tests/gen/preview1_path_rename_dir_trailing_slashes.component.wasm differ diff --git a/tests/gen/preview1_path_symlink_trailing_slashes.component.wasm b/tests/gen/preview1_path_symlink_trailing_slashes.component.wasm index 3e8f16c52..a47c4161c 100644 Binary files a/tests/gen/preview1_path_symlink_trailing_slashes.component.wasm and b/tests/gen/preview1_path_symlink_trailing_slashes.component.wasm differ diff --git a/tests/gen/preview1_poll_oneoff_files.component.wasm b/tests/gen/preview1_poll_oneoff_files.component.wasm index 01c88b3e6..242248471 100644 Binary files a/tests/gen/preview1_poll_oneoff_files.component.wasm and b/tests/gen/preview1_poll_oneoff_files.component.wasm differ diff --git a/tests/gen/preview1_poll_oneoff_stdio.component.wasm b/tests/gen/preview1_poll_oneoff_stdio.component.wasm index 6cd4d6839..455289d4a 100644 Binary files a/tests/gen/preview1_poll_oneoff_stdio.component.wasm and b/tests/gen/preview1_poll_oneoff_stdio.component.wasm differ diff --git a/tests/gen/preview1_readlink.component.wasm b/tests/gen/preview1_readlink.component.wasm index 2af12a0dd..757beade8 100644 Binary files a/tests/gen/preview1_readlink.component.wasm and b/tests/gen/preview1_readlink.component.wasm differ diff --git a/tests/gen/preview1_regular_file_isatty.component.wasm b/tests/gen/preview1_regular_file_isatty.component.wasm index 343c52106..5ac1143bc 100644 Binary files a/tests/gen/preview1_regular_file_isatty.component.wasm and b/tests/gen/preview1_regular_file_isatty.component.wasm differ diff --git a/tests/gen/preview1_remove_directory.component.wasm b/tests/gen/preview1_remove_directory.component.wasm index 1580924fc..6dcc682c2 100644 Binary files a/tests/gen/preview1_remove_directory.component.wasm and b/tests/gen/preview1_remove_directory.component.wasm differ diff --git a/tests/gen/preview1_remove_nonempty_directory.component.wasm b/tests/gen/preview1_remove_nonempty_directory.component.wasm index 5e855866f..0834ae675 100644 Binary files a/tests/gen/preview1_remove_nonempty_directory.component.wasm and b/tests/gen/preview1_remove_nonempty_directory.component.wasm differ diff --git a/tests/gen/preview1_renumber.component.wasm b/tests/gen/preview1_renumber.component.wasm index 659de54a0..36a785cef 100644 Binary files a/tests/gen/preview1_renumber.component.wasm and b/tests/gen/preview1_renumber.component.wasm differ diff --git a/tests/gen/preview1_sched_yield.component.wasm b/tests/gen/preview1_sched_yield.component.wasm index 80e9f2132..d9433070d 100644 Binary files a/tests/gen/preview1_sched_yield.component.wasm and b/tests/gen/preview1_sched_yield.component.wasm differ diff --git a/tests/gen/preview1_stdio.component.wasm b/tests/gen/preview1_stdio.component.wasm index e1e8df408..7828a8d90 100644 Binary files a/tests/gen/preview1_stdio.component.wasm and b/tests/gen/preview1_stdio.component.wasm differ diff --git a/tests/gen/preview1_stdio_isatty.component.wasm b/tests/gen/preview1_stdio_isatty.component.wasm index 9bd1c8724..a1465a0d3 100644 Binary files a/tests/gen/preview1_stdio_isatty.component.wasm and b/tests/gen/preview1_stdio_isatty.component.wasm differ diff --git a/tests/gen/preview1_stdio_not_isatty.component.wasm b/tests/gen/preview1_stdio_not_isatty.component.wasm index ddecddc47..6c2839ae1 100644 Binary files a/tests/gen/preview1_stdio_not_isatty.component.wasm and b/tests/gen/preview1_stdio_not_isatty.component.wasm differ diff --git a/tests/gen/preview1_symlink_create.component.wasm b/tests/gen/preview1_symlink_create.component.wasm index ee02133af..1a4d73703 100644 Binary files a/tests/gen/preview1_symlink_create.component.wasm and b/tests/gen/preview1_symlink_create.component.wasm differ diff --git a/tests/gen/preview1_symlink_filestat.component.wasm b/tests/gen/preview1_symlink_filestat.component.wasm index 3e2b9c239..dd56852e6 100644 Binary files a/tests/gen/preview1_symlink_filestat.component.wasm and b/tests/gen/preview1_symlink_filestat.component.wasm differ diff --git a/tests/gen/preview1_symlink_loop.component.wasm b/tests/gen/preview1_symlink_loop.component.wasm index 66f037e90..44444d441 100644 Binary files a/tests/gen/preview1_symlink_loop.component.wasm and b/tests/gen/preview1_symlink_loop.component.wasm differ diff --git a/tests/gen/preview1_unicode_output.component.wasm b/tests/gen/preview1_unicode_output.component.wasm index e7978331b..dec2b891d 100644 Binary files a/tests/gen/preview1_unicode_output.component.wasm and b/tests/gen/preview1_unicode_output.component.wasm differ diff --git a/tests/gen/preview1_unlink_file_trailing_slashes.component.wasm b/tests/gen/preview1_unlink_file_trailing_slashes.component.wasm index 48c07ff44..ff5aeb13c 100644 Binary files a/tests/gen/preview1_unlink_file_trailing_slashes.component.wasm and b/tests/gen/preview1_unlink_file_trailing_slashes.component.wasm differ diff --git a/tests/gen/preview2_adapter_badfd.component.wasm b/tests/gen/preview2_adapter_badfd.component.wasm index ad7130d8c..b36ddfd2e 100644 Binary files a/tests/gen/preview2_adapter_badfd.component.wasm and b/tests/gen/preview2_adapter_badfd.component.wasm differ diff --git a/tests/gen/preview2_ip_name_lookup.component.wasm b/tests/gen/preview2_ip_name_lookup.component.wasm index 5491b94bb..f067ba85c 100644 Binary files a/tests/gen/preview2_ip_name_lookup.component.wasm and b/tests/gen/preview2_ip_name_lookup.component.wasm differ diff --git a/tests/gen/preview2_pollable_correct.component.wasm b/tests/gen/preview2_pollable_correct.component.wasm index b13cb0c69..24ff3d7ea 100644 Binary files a/tests/gen/preview2_pollable_correct.component.wasm and b/tests/gen/preview2_pollable_correct.component.wasm differ diff --git a/tests/gen/preview2_pollable_traps.component.wasm b/tests/gen/preview2_pollable_traps.component.wasm index a85ea268a..c4bfad8eb 100644 Binary files a/tests/gen/preview2_pollable_traps.component.wasm and b/tests/gen/preview2_pollable_traps.component.wasm differ diff --git a/tests/gen/preview2_random.component.wasm b/tests/gen/preview2_random.component.wasm index c310a537a..ba2a90e6f 100644 Binary files a/tests/gen/preview2_random.component.wasm and b/tests/gen/preview2_random.component.wasm differ diff --git a/tests/gen/preview2_sleep.component.wasm b/tests/gen/preview2_sleep.component.wasm index d4dcbf0ad..2e5281d90 100644 Binary files a/tests/gen/preview2_sleep.component.wasm and b/tests/gen/preview2_sleep.component.wasm differ diff --git a/tests/gen/preview2_stream_pollable_correct.component.wasm b/tests/gen/preview2_stream_pollable_correct.component.wasm index 7bed2f2dc..90d01c780 100644 Binary files a/tests/gen/preview2_stream_pollable_correct.component.wasm and b/tests/gen/preview2_stream_pollable_correct.component.wasm differ diff --git a/tests/gen/preview2_stream_pollable_traps.component.wasm b/tests/gen/preview2_stream_pollable_traps.component.wasm index 36e2db1ef..fad3c32d4 100644 Binary files a/tests/gen/preview2_stream_pollable_traps.component.wasm and b/tests/gen/preview2_stream_pollable_traps.component.wasm differ diff --git a/tests/gen/preview2_tcp_bind.component.wasm b/tests/gen/preview2_tcp_bind.component.wasm index ca4a6c0a8..b2354486d 100644 Binary files a/tests/gen/preview2_tcp_bind.component.wasm and b/tests/gen/preview2_tcp_bind.component.wasm differ diff --git a/tests/gen/preview2_tcp_connect.component.wasm b/tests/gen/preview2_tcp_connect.component.wasm index 54c1bf621..c4746cd2e 100644 Binary files a/tests/gen/preview2_tcp_connect.component.wasm and b/tests/gen/preview2_tcp_connect.component.wasm differ diff --git a/tests/gen/preview2_tcp_sample_application.component.wasm b/tests/gen/preview2_tcp_sample_application.component.wasm index d4bd9cdc0..ef051ce58 100644 Binary files a/tests/gen/preview2_tcp_sample_application.component.wasm and b/tests/gen/preview2_tcp_sample_application.component.wasm differ diff --git a/tests/gen/preview2_tcp_sockopts.component.wasm b/tests/gen/preview2_tcp_sockopts.component.wasm index 2788366b2..e0a45d4d1 100644 Binary files a/tests/gen/preview2_tcp_sockopts.component.wasm and b/tests/gen/preview2_tcp_sockopts.component.wasm differ diff --git a/tests/gen/preview2_tcp_states.component.wasm b/tests/gen/preview2_tcp_states.component.wasm index e90eb1337..71c66d96f 100644 Binary files a/tests/gen/preview2_tcp_states.component.wasm and b/tests/gen/preview2_tcp_states.component.wasm differ diff --git a/tests/gen/preview2_udp_bind.component.wasm b/tests/gen/preview2_udp_bind.component.wasm index 453bd0727..b39b483fc 100644 Binary files a/tests/gen/preview2_udp_bind.component.wasm and b/tests/gen/preview2_udp_bind.component.wasm differ diff --git a/tests/gen/preview2_udp_connect.component.wasm b/tests/gen/preview2_udp_connect.component.wasm index 5ee4a1d1f..85a8eaf6b 100644 Binary files a/tests/gen/preview2_udp_connect.component.wasm and b/tests/gen/preview2_udp_connect.component.wasm differ diff --git a/tests/gen/preview2_udp_sample_application.component.wasm b/tests/gen/preview2_udp_sample_application.component.wasm index 116aa25b0..af099cbd9 100644 Binary files a/tests/gen/preview2_udp_sample_application.component.wasm and b/tests/gen/preview2_udp_sample_application.component.wasm differ diff --git a/tests/gen/preview2_udp_sockopts.component.wasm b/tests/gen/preview2_udp_sockopts.component.wasm index aeae597d1..b95c78037 100644 Binary files a/tests/gen/preview2_udp_sockopts.component.wasm and b/tests/gen/preview2_udp_sockopts.component.wasm differ diff --git a/tests/gen/preview2_udp_states.component.wasm b/tests/gen/preview2_udp_states.component.wasm index 98a2a14a1..a3d17bd4d 100644 Binary files a/tests/gen/preview2_udp_states.component.wasm and b/tests/gen/preview2_udp_states.component.wasm differ diff --git a/tests/gen/proxy_echo.component.wasm b/tests/gen/proxy_echo.component.wasm index e3c94d0e1..d8e362c53 100644 Binary files a/tests/gen/proxy_echo.component.wasm and b/tests/gen/proxy_echo.component.wasm differ diff --git a/tests/gen/proxy_handler.component.wasm b/tests/gen/proxy_handler.component.wasm index 136da8854..41429ef98 100644 Binary files a/tests/gen/proxy_handler.component.wasm and b/tests/gen/proxy_handler.component.wasm differ diff --git a/tests/gen/proxy_hash.component.wasm b/tests/gen/proxy_hash.component.wasm index 87fdf3925..3bafdc348 100644 Binary files a/tests/gen/proxy_hash.component.wasm and b/tests/gen/proxy_hash.component.wasm differ diff --git a/xtask/src/generate/tests.rs b/xtask/src/generate/tests.rs index 5aba78e7e..946ffa8c8 100644 --- a/xtask/src/generate/tests.rs +++ b/xtask/src/generate/tests.rs @@ -3,7 +3,7 @@ use xshell::{cmd, Shell}; // for debugging const TRACE: bool = false; -const DENO: bool = true; +const DENO: bool = false; const TEST_FILTER: &[&str] = &[]; const TEST_IGNORE: &[&str] = &["nn_image_classification", "nn_image_classification_named"];