From d42eefda556791520f52818c0cd42710eb58a8ad Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Thu, 26 Sep 2024 17:06:02 +0200 Subject: [PATCH 1/6] Upgrade Wasmer --- Cargo.toml | 19 ++++++++-------- rollup.config.mjs | 2 +- rust-toolchain.toml | 4 +++- src/fs/directory.rs | 6 +++++ src/lib.rs | 6 ++--- src/package_loader.rs | 5 +++-- src/runtime.rs | 12 +++++----- src/wasmer.rs | 52 ++++++++++++++++++++++++++++++++++++++----- tests/run.test.ts | 18 +++++++++++++++ 9 files changed, 96 insertions(+), 28 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 65738bbe..635ccb6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,11 +17,10 @@ bytes = "1" console_error_panic_hook = { version = "0.1" } derivative = { version = "2" } futures = "0.3" -http = "0.2" instant = { version = "0.1", features = ["wasm-bindgen"] } js-sys = "0.3" once_cell = "1" -reqwest = { version = "0.12.5", features = ["stream"] } +reqwest = { version = "0.12.7", features = ["stream"] } serde = { version = "1", features = ["derive"] } serde-wasm-bindgen = "0.6" sha2 = "0.10.8" @@ -31,18 +30,18 @@ toml = "0.8.14" tracing = { version = "0.1", features = ["log", "release_max_level_debug"] } tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } url = "2.4.0" -virtual-fs = { version = "0.13.0", default-features = false } -virtual-net = { version = "0.6.7", default-features = false, features = ["remote"] } +virtual-fs = { version = "0.16.0", default-features = false } +virtual-net = { version = "0.8.0", default-features = false, features = ["remote"] } wasm-bindgen = { version = "0.2" } wasm-bindgen-derive = "0.2.1" wasm-bindgen-futures = "0.4" wasm-bindgen-test = "0.3.37" -wasmer = { version = "4.3.2", default-features = false, features = ["js", "js-default", "wasm-types-polyfill", "enable-serde"] } -wasmer-api = { version = "0.0.30", git = "https://github.com/wasmerio/wasmer", branch = "backend-api-wasm32"} -wasmer-config = "0.4.0" -wasmer-types = "4.3.2" -wasmer-wasix = { version = "0.22.0", default-features = false, features = ["js", "js-default"] } -webc = "6.0.0-rc2" +wasmer = { version = "4.3.6", default-features = false, features = ["js", "js-default", "wasm-types-polyfill", "enable-serde"] } +wasmer-api = { version = "0.0.34"} +wasmer-config = "0.8.0" +wasmer-types = "4.3.6" +wasmer-wasix = { version = "0.27.0", default-features = false, features = ["js", "js-default"] } +webc = "6.0.1" [dependencies.web-sys] version = "0.3" diff --git a/rollup.config.mjs b/rollup.config.mjs index b49498d8..40df1d96 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,6 +1,6 @@ import { defineConfig } from 'rollup' import terser from "@rollup/plugin-terser"; -import pkg from "./package.json" assert { type: "json" }; +import pkg from "./package.json" with { type: "json" }; import dts from "rollup-plugin-dts"; // import typescript from "@rollup/plugin-typescript"; import typescript from "rollup-plugin-typescript2"; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 59330327..74027567 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,6 @@ [toolchain] -channel = "nightly-2023-12-20" +# The nightly toolchain is needed so the generated wasm generates +# a shared memory (via +atomics) instead of a non-shared one (default behavior) +channel = "nightly-2024-09-23" targets = ["wasm32-unknown-unknown", "wasm32-wasi"] components = ["rust-src", "rustfmt", "clippy"] diff --git a/src/fs/directory.rs b/src/fs/directory.rs index f0b0d2ef..34af7daa 100644 --- a/src/fs/directory.rs +++ b/src/fs/directory.rs @@ -211,6 +211,12 @@ impl FileSystem for Directory { fn symlink_metadata(&self, path: &Path) -> virtual_fs::Result { self.0.symlink_metadata(path) } + + #[tracing::instrument(level = "trace", skip(self))] + fn mount(&self, name: String, path: &Path, fs: Box) + -> virtual_fs::Result<()> { + self.0.mount(name, path, fs) + } } impl virtual_fs::FileOpener for Directory { diff --git a/src/lib.rs b/src/lib.rs index d0d68bab..52b1ff7c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(once_cell_try)] +// #![feature(once_cell_try)] #[cfg(test)] wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); @@ -37,12 +37,12 @@ pub use crate::{ use once_cell::sync::Lazy; use wasm_bindgen::prelude::wasm_bindgen; +use wasmer_wasix::runtime::resolver::BackendSource; pub(crate) const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); pub(crate) const DEFAULT_RUST_LOG: &[&str] = &["warn"]; pub(crate) static CUSTOM_WORKER_URL: Lazy>> = Lazy::new(Mutex::default); -pub(crate) const DEFAULT_REGISTRY: &str = - wasmer_wasix::runtime::resolver::WapmSource::WASMER_PROD_ENDPOINT; +pub(crate) const DEFAULT_REGISTRY: &str = BackendSource::WASMER_PROD_ENDPOINT; #[wasm_bindgen] pub fn wat2wasm(wat: String) -> Result { diff --git a/src/package_loader.rs b/src/package_loader.rs index deedb4a3..1a4ace0e 100644 --- a/src/package_loader.rs +++ b/src/package_loader.rs @@ -5,7 +5,7 @@ use std::{ use anyhow::{Context, Error}; use bytes::Bytes; -use http::{HeaderMap, HeaderValue, Method, StatusCode}; +use reqwest::{Method, header::{HeaderMap, HeaderValue}, StatusCode}; use wasmer_wasix::{ bin_factory::BinaryPackage, http::{HttpClient, HttpRequest, HttpResponse}, @@ -109,8 +109,9 @@ impl wasmer_wasix::runtime::package_loader::PackageLoader for PackageLoader { &self, root: &Container, resolution: &Resolution, + root_is_local_dir: bool, ) -> Result { - wasmer_wasix::runtime::package_loader::load_package_tree(root, self, resolution).await + wasmer_wasix::runtime::package_loader::load_package_tree(root, self, resolution, root_is_local_dir).await } } diff --git a/src/runtime.rs b/src/runtime.rs index 3e517174..74c6623c 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -1,6 +1,6 @@ use std::sync::{atomic::AtomicBool, Arc, Mutex, Weak}; -use http::HeaderValue; +use reqwest::header::HeaderValue; use lazy_static::lazy_static; use once_cell::sync::Lazy; use virtual_net::VirtualNetworking; @@ -11,7 +11,7 @@ use wasmer_wasix::{ runtime::{ module_cache::ThreadLocalCache, package_loader::PackageLoader, - resolver::{PackageSummary, QueryError, Source, WapmSource}, + resolver::{PackageSummary, QueryError, Source, BackendSource}, }, VirtualTaskManager, WasiTtyState, }; @@ -32,7 +32,7 @@ static GLOBAL_RUNTIME: Lazy>> = Lazy::new(Mutex::default); pub struct Runtime { task_manager: Option>, networking: Arc, - source: Option>, + source: Option>, http_client: Arc, package_loader: Arc, module_cache: Arc, @@ -89,7 +89,7 @@ impl Runtime { let mut http_client = WebHttpClient::default(); http_client .with_default_header( - http::header::USER_AGENT, + reqwest::header::USER_AGENT, HeaderValue::from_static(crate::USER_AGENT), ) .with_task_manager(task_manager.clone()); @@ -107,7 +107,7 @@ impl Runtime { pub(crate) fn new() -> Self { let mut http_client = WebHttpClient::default(); http_client.with_default_header( - http::header::USER_AGENT, + reqwest::header::USER_AGENT, HeaderValue::from_static(crate::USER_AGENT), ); let http_client = Arc::new(http_client); @@ -131,7 +131,7 @@ impl Runtime { pub fn set_registry(&mut self, url: &str, token: Option<&str>) -> Result<(), Error> { let url = url.parse().map_err(Error::from)?; - let mut source = WapmSource::new(url, self.http_client.clone()); + let mut source = BackendSource::new(url, self.http_client.clone()); if let Some(token) = token { source = source.with_auth_token(token); } diff --git a/src/wasmer.rs b/src/wasmer.rs index 0bc1e0b1..2ac78afc 100644 --- a/src/wasmer.rs +++ b/src/wasmer.rs @@ -6,17 +6,18 @@ use futures::{channel::oneshot, TryStreamExt}; use js_sys::{JsString, Reflect, Uint8Array}; use sha2::Digest; use tracing::Instrument; -use virtual_fs::{AsyncReadExt, Pipe}; +use virtual_fs::{AsyncReadExt, Pipe, RootFileSystemBuilder}; use wasm_bindgen::{prelude::wasm_bindgen, JsValue, UnwrapThrowExt}; -use wasmer_config::package::PackageSource; +use wasmer_config::{hash::Sha256Hash, package::{PackageHash, PackageId, PackageSource}}; +use wasmer_types::ModuleHash; use wasmer_wasix::{ - bin_factory::BinaryPackage, + bin_factory::{BinaryPackage, BinaryPackageCommand}, os::{Tty, TtyOptions}, runners::{wasi::WasiRunner, Runner}, Runtime as _, }; use web_sys::{ReadableStream, WritableStream}; -use webc::wasmer_package::Package; +use webc::{indexmap::IndexMap, metadata::Command as MetadataCommand, wasmer_package::Package}; use crate::{ instance::ExitCondition, @@ -82,7 +83,24 @@ impl Wasmer { binary: Uint8Array, runtime: Option, ) -> Result { - Wasmer::from_file(binary.to_vec(), runtime).await + let bytes = binary.to_vec(); + if bytes.starts_with(b"\0asm") { + // If the user provides bytes similar to Wasm, we don't assume + // we are provided a package, but a Wasm file + Wasmer::from_wasm(bytes, runtime) + } + else { + Wasmer::from_file(bytes, runtime).await + } + } + + /// Load a package from a package file. + #[wasm_bindgen(js_name = "fromWasm")] + pub fn js_from_wasm( + binary: Uint8Array, + runtime: Option, + ) -> Result { + Wasmer::from_wasm(binary.to_vec(), runtime) } } @@ -136,6 +154,30 @@ impl Wasmer { }) } + fn from_wasm(wasm: Vec, runtime: Option) -> Result { + let webc_fs = RootFileSystemBuilder::default().build(); + let hash = ModuleHash::xxhash(&wasm); + let metadata = MetadataCommand { + runner: "wasi".to_string(), + annotations: IndexMap::new(), + }; + let package = BinaryPackage { + id: PackageId::Hash(PackageHash::Sha256(Sha256Hash::from_bytes([0; 32]))), + package_ids: vec![], + hash: hash.clone().into(), + uses: vec![], + webc_fs: Arc::new(webc_fs), + when_cached: None, + file_system_memory_footprint: 0, + entrypoint_cmd: None, + commands: vec![BinaryPackageCommand::new( + "entrypoint".to_string(), metadata, wasm.into(), hash)], + additional_host_mapped_directories: vec![], + }; + let runtime = runtime.unwrap_or_default().resolve()?.into_inner(); + Self::from_package(package, runtime) + } + pub(crate) async fn from_user_package( pkg: Package, manifest: wasmer_config::package::Manifest, diff --git a/tests/run.test.ts b/tests/run.test.ts index 258b1aa9..ea5872e2 100644 --- a/tests/run.test.ts +++ b/tests/run.test.ts @@ -34,6 +34,24 @@ describe("run", function () { expect(output.code).to.equal(0); }); + it("can execute a Wasm file", async () => { + const noop = `( + module + (memory $memory 0) + (export "memory" (memory $memory)) + (func (export "_start") nop) + )`; + const wasm = wat2wasm(noop); + const pkg = await Wasmer.fromWasm(wasm); + const instance = pkg.entrypoint!.run(); + + const output = await instance.wait(); + + expect(output.ok).to.be.true; + expect(output.code).to.equal(0); + }); + + it("can start quickjs", async () => { const pkg = await Wasmer.fromRegistry("saghul/quickjs@0.0.3"); const quickjs = pkg.commands["quickjs"].binary(); From 2da078d395ec870f104869d1d3571953c10e8f86 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Thu, 26 Sep 2024 17:32:22 +0200 Subject: [PATCH 2/6] Updated everything --- Cargo.lock | 531 ++++++++++++++++++++++------------------------ Cargo.toml | 6 +- src/wasmer.rs | 2 +- tests/run.test.ts | 2 +- 4 files changed, 263 insertions(+), 278 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 03d4fea6..39ed304f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,15 +19,28 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", "version_check", ] +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.2" @@ -293,6 +306,33 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -411,6 +451,12 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -423,13 +469,13 @@ dependencies = [ [[package]] name = "cynic" -version = "3.4.3" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7335114540697c7b1c1a0131cbe0e983fdb1e646f881234afe9e2a66133ac99a" +checksum = "394a4797bda697d5e028f3bc3fcb8c8c374a2b72cf8d22e0efc0e127c95fd11f" dependencies = [ "cynic-proc-macros", "ref-cast", - "reqwest 0.11.27", + "reqwest", "serde", "serde_json", "static_assertions", @@ -438,9 +484,9 @@ dependencies = [ [[package]] name = "cynic-codegen" -version = "3.7.3" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c0ec86f960a00ce087e96ff6f073f6ff28b6876d69ce8caa06c03fb4143981c" +checksum = "408ad3d9c8d729e4d89e1aaed76eab918f76169f1bb3aa017c9fc1b39dac3066" dependencies = [ "counter", "cynic-parser", @@ -467,9 +513,9 @@ dependencies = [ [[package]] name = "cynic-proc-macros" -version = "3.7.3" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a69ecdf4aa110fed1c0c8de290bc8ccb2835388733cf2f418f0abdf6ff3899" +checksum = "7f72af69ebf914a975468c4f7e3f81ddc5482e140dd98032d90e7602c535681d" dependencies = [ "cynic-codegen", "darling 0.20.3", @@ -549,11 +595,12 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.5.3" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", + "crossbeam-utils", "hashbrown 0.14.3", "lock_api", "once_cell", @@ -631,6 +678,12 @@ dependencies = [ "litrs", ] +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "dyn-clone" version = "1.0.17" @@ -959,25 +1012,6 @@ dependencies = [ "regex-syntax 0.8.2", ] -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.11", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.5" @@ -999,9 +1033,13 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] [[package]] name = "harsh" @@ -1024,7 +1062,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.8", ] [[package]] @@ -1089,17 +1127,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.11", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.0" @@ -1119,7 +1146,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body", "pin-project-lite", ] @@ -1139,36 +1166,6 @@ version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "0.14.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.11", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.4.0" @@ -1178,9 +1175,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", + "h2", "http 1.1.0", - "http-body 1.0.0", + "http-body", "httparse", "itoa", "pin-project-lite", @@ -1197,7 +1194,7 @@ checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.0", + "hyper", "hyper-util", "rustls", "rustls-pki-types", @@ -1214,7 +1211,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.4.0", + "hyper", "hyper-util", "native-tls", "tokio", @@ -1232,8 +1229,8 @@ dependencies = [ "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", - "hyper 1.4.0", + "http-body", + "hyper", "pin-project-lite", "socket2", "tokio", @@ -1360,9 +1357,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1489,10 +1486,10 @@ dependencies = [ ] [[package]] -name = "mach" -version = "0.3.2" +name = "mach2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ "libc", ] @@ -1625,6 +1622,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.45" @@ -2057,14 +2060,14 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "region" -version = "3.0.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" dependencies = [ "bitflags 1.3.2", "libc", - "mach", - "winapi", + "mach2", + "windows-sys 0.52.0", ] [[package]] @@ -2084,56 +2087,20 @@ checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.6", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.11", - "http-body 0.4.6", - "hyper 0.14.29", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration", - "tokio", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg 0.50.0", -] - -[[package]] -name = "reqwest" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2 0.4.5", + "h2", "http 1.1.0", - "http-body 1.0.0", + "http-body", "http-body-util", - "hyper 1.4.0", + "hyper", "hyper-rustls", "hyper-tls", "hyper-util", @@ -2149,7 +2116,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -2160,7 +2127,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "winreg 0.52.0", + "windows-registry", ] [[package]] @@ -2422,16 +2389,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.195" @@ -2657,34 +2614,31 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -2776,12 +2730,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -2796,10 +2751,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -3170,14 +3126,16 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "virtual-fs" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2be050a12999526f637afa40f010f3657827e63a804020bdb1be2e9fd5367a1" +checksum = "e60ef133d8336b201a1618252518d81f9e9d30fbe27449dab706699a549216bc" dependencies = [ "anyhow", "async-trait", "bytes", + "dashmap", "derivative", + "dunce", "futures", "getrandom", "indexmap 1.9.3", @@ -3209,9 +3167,9 @@ dependencies = [ [[package]] name = "virtual-net" -version = "0.6.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74aa69bbb19e531d274ba1aa730028f6fcd2117513ff6696d020af05188dfe92" +checksum = "05d9551aa47efdb28093f79845d40858baf5075e4b4a09c7d9c8a0edd42f942b" dependencies = [ "anyhow", "async-trait", @@ -3380,9 +3338,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -3421,9 +3379,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-bindgen-test" -version = "0.3.39" +version = "0.3.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf9242c0d27999b831eae4767b2a146feb0b27d332d553e605864acd2afd403" +checksum = "d9bf62a58e0780af3e852044583deee40983e5886da43a271dd772379987667b" dependencies = [ "console_error_panic_hook", "js-sys", @@ -3435,9 +3393,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.39" +version = "0.3.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794645f5408c9a039fd09f4d113cdfb2e7eba5ff1956b07bcf701cf4b394fe89" +checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" dependencies = [ "proc-macro2", "quote", @@ -3468,9 +3426,9 @@ dependencies = [ [[package]] name = "wasmer" -version = "4.3.2" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1852ee143a2d8143265bfee017c43bf690702d6c2b45a763a2f13e669f5b7ec" +checksum = "4b28d4251f96ece14460328c56ee0525edcf4bbb08748cfd87fef3580ae4d403" dependencies = [ "bytes", "cfg-if", @@ -3492,13 +3450,14 @@ dependencies = [ "wasmer-vm", "wasmparser 0.121.2", "wat", - "winapi", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-api" -version = "0.0.30" -source = "git+https://github.com/wasmerio/wasmer?branch=backend-api-wasm32#17b77586782c657610e2cc329b1c4b6ae0924bed" +version = "0.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "697706b2ab3e1c7951a30c26e4e1dd904e71ce7192d737c5f55bf70e1d0e069e" dependencies = [ "anyhow", "cynic", @@ -3508,7 +3467,7 @@ dependencies = [ "harsh", "merge-streams", "pin-project-lite", - "reqwest 0.11.27", + "reqwest", "serde", "serde_json", "serde_path_to_error", @@ -3516,15 +3475,15 @@ dependencies = [ "tokio", "tracing", "url", - "wasmer-config 0.4.0 (git+https://github.com/wasmerio/wasmer?branch=backend-api-wasm32)", + "wasmer-config", "webc", ] [[package]] name = "wasmer-compiler" -version = "4.3.2" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4f157d715f3bb60c2c9d7b9e48299a30e9209f87f4484f79f9cd586b40b6ee" +checksum = "009b8417d51dbca8ac9a640ea999cc924fc59040a81245ecd0e092cb7c45dc10" dependencies = [ "backtrace", "bytes", @@ -3533,6 +3492,7 @@ dependencies = [ "enumset", "lazy_static", "leb128", + "libc", "memmap2 0.5.10", "more-asserts", "region", @@ -3545,46 +3505,25 @@ dependencies = [ "thiserror", "wasmer-types", "wasmer-vm", - "winapi", + "windows-sys 0.59.0", "xxhash-rust", ] [[package]] name = "wasmer-config" -version = "0.4.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b4a632496950fde9ad821e195ef1a301440076f7c7d80de55239a140359bcbd" +checksum = "644b7e3547bd7e796d92220f60bf57734914254c6cee56607e80177a3e8a28da" dependencies = [ "anyhow", "bytesize", + "ciborium", "derive_builder", "hex", "indexmap 2.2.6", "schemars", "semver", "serde", - "serde_cbor", - "serde_json", - "serde_yaml 0.9.34+deprecated", - "thiserror", - "toml", - "url", -] - -[[package]] -name = "wasmer-config" -version = "0.4.0" -source = "git+https://github.com/wasmerio/wasmer?branch=backend-api-wasm32#17b77586782c657610e2cc329b1c4b6ae0924bed" -dependencies = [ - "anyhow", - "bytesize", - "derive_builder", - "hex", - "indexmap 2.2.6", - "schemars", - "semver", - "serde", - "serde_cbor", "serde_json", "serde_yaml 0.9.34+deprecated", "thiserror", @@ -3594,9 +3533,9 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "4.3.2" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cd5732ff64370e98986f9753cce13b91cc9d3c4b649e31b0d08d5db69164ea" +checksum = "02592d86ac19fb09c972e72edeb3e57ac5c569eac7e77b919b165da014e8c139" dependencies = [ "proc-macro-error", "proc-macro2", @@ -3606,9 +3545,9 @@ dependencies = [ [[package]] name = "wasmer-journal" -version = "0.4.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4f51818afcb61d608414a1eee90e9d368753376ff2340c63deb548a6aa0c0c7" +checksum = "3045807a8a70da47eb06cb55aad673d5774f87f26ee11b7758d63c54b67bc5f4" dependencies = [ "anyhow", "async-trait", @@ -3641,12 +3580,11 @@ dependencies = [ "console_error_panic_hook", "derivative", "futures", - "http 0.2.11", "instant", "js-sys", "lazy_static", "once_cell", - "reqwest 0.12.5", + "reqwest", "serde", "serde-wasm-bindgen 0.6.3", "sha2", @@ -3664,7 +3602,7 @@ dependencies = [ "wasm-bindgen-test", "wasmer", "wasmer-api", - "wasmer-config 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-config", "wasmer-types", "wasmer-wasix", "web-sys", @@ -3673,9 +3611,9 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "4.3.2" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c890fd0dbda40df03977b899d1ad7113deba3c225f2cc7b88deb7633044d3e07" +checksum = "3d22a00f1a90e9e66d5427853f41e76d8ab89e03eb3034debd11933607fef56a" dependencies = [ "bytecheck", "enum-iterator", @@ -3690,15 +3628,14 @@ dependencies = [ "sha2", "target-lexicon", "thiserror", - "webc", "xxhash-rust", ] [[package]] name = "wasmer-vm" -version = "4.3.2" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0dc60ab800cf0bd44e2d35d88422d256d2470b00c72778f91bfb826c42dbd0" +checksum = "87d88e8355157cd730fb81e33c3b4d6849fd44c26d32bf78820638e1d935967b" dependencies = [ "backtrace", "cc", @@ -3712,7 +3649,7 @@ dependencies = [ "indexmap 1.9.3", "lazy_static", "libc", - "mach", + "mach2", "memoffset", "more-asserts", "region", @@ -3720,15 +3657,16 @@ dependencies = [ "serde", "thiserror", "wasmer-types", - "winapi", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-wasix" -version = "0.22.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff24faf9bc4a34e7281db698c8cd0e6449f0dfabc4cf0e8c08f2599da70d4da7" +checksum = "dbfe427dbe359e037e1e33ff13b3a5473706e5679df2dbb0e71b5b46c9bb6ce3" dependencies = [ + "ahash 0.8.11", "anyhow", "async-trait", "base64 0.21.6", @@ -3745,7 +3683,7 @@ dependencies = [ "getrandom", "heapless", "hex", - "http 0.2.11", + "http 1.1.0", "js-sys", "lazy_static", "libc", @@ -3755,11 +3693,11 @@ dependencies = [ "once_cell", "petgraph", "pin-project", + "pin-utils", "rand", "rkyv", "semver", "serde", - "serde_cbor", "serde_derive", "serde_json", "serde_yaml 0.9.34+deprecated", @@ -3771,6 +3709,7 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", + "toml", "tracing", "url", "urlencoding", @@ -3781,22 +3720,22 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "wasmer", - "wasmer-config 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-config", "wasmer-journal", "wasmer-types", "wasmer-wasix-types", "web-sys", "webc", "weezl", - "winapi", + "windows-sys 0.59.0", "xxhash-rust", ] [[package]] name = "wasmer-wasix-types" -version = "0.22.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e6f8e53945f532947482311efb95e7724197f0c4780eeea3b56e0bca79d0bfc" +checksum = "9b9304c02de27468ea4154a31f8758343717d03a29d2a620bc652e8217baab75" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -3897,14 +3836,15 @@ dependencies = [ [[package]] name = "webc" -version = "6.0.0-rc2" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3e2ccb43d303c5bd48f31db7a129481a9aaa5343d623f92951751df190df81" +checksum = "c48441419be082f8d2537c84d8b1f502624d77bc08fbbd09ab17cadfe7f0ac53" dependencies = [ "anyhow", "base64 0.22.1", "bytes", "cfg-if", + "ciborium", "document-features", "flate2", "ignore", @@ -3917,7 +3857,6 @@ dependencies = [ "rand", "semver", "serde", - "serde_cbor", "serde_json", "sha2", "shared-buffer", @@ -3926,7 +3865,7 @@ dependencies = [ "thiserror", "toml", "url", - "wasmer-config 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-config", ] [[package]] @@ -3972,7 +3911,37 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", ] [[package]] @@ -4003,7 +3972,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -4023,17 +4001,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -4044,9 +4023,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -4062,9 +4041,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -4080,9 +4059,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -4098,9 +4083,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -4116,9 +4101,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -4128,9 +4113,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -4146,9 +4131,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -4168,26 +4153,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "wyz" version = "0.5.1" @@ -4229,6 +4194,26 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "zeroize" version = "1.8.1" diff --git a/Cargo.toml b/Cargo.toml index 635ccb6b..4e0c544e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,10 +32,10 @@ tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } url = "2.4.0" virtual-fs = { version = "0.16.0", default-features = false } virtual-net = { version = "0.8.0", default-features = false, features = ["remote"] } -wasm-bindgen = { version = "0.2" } +wasm-bindgen = { version = "=0.2.92" } wasm-bindgen-derive = "0.2.1" -wasm-bindgen-futures = "0.4" -wasm-bindgen-test = "0.3.37" +wasm-bindgen-futures = "0.4.40" +wasm-bindgen-test = "0.3.40" wasmer = { version = "4.3.6", default-features = false, features = ["js", "js-default", "wasm-types-polyfill", "enable-serde"] } wasmer-api = { version = "0.0.34"} wasmer-config = "0.8.0" diff --git a/src/wasmer.rs b/src/wasmer.rs index 2ac78afc..9205687b 100644 --- a/src/wasmer.rs +++ b/src/wasmer.rs @@ -169,7 +169,7 @@ impl Wasmer { webc_fs: Arc::new(webc_fs), when_cached: None, file_system_memory_footprint: 0, - entrypoint_cmd: None, + entrypoint_cmd: Some("entrypoint".to_string()), commands: vec![BinaryPackageCommand::new( "entrypoint".to_string(), metadata, wasm.into(), hash)], additional_host_mapped_directories: vec![], diff --git a/tests/run.test.ts b/tests/run.test.ts index ea5872e2..c2ef85a0 100644 --- a/tests/run.test.ts +++ b/tests/run.test.ts @@ -43,7 +43,7 @@ describe("run", function () { )`; const wasm = wat2wasm(noop); const pkg = await Wasmer.fromWasm(wasm); - const instance = pkg.entrypoint!.run(); + const instance = await pkg.entrypoint!.run(); const output = await instance.wait(); From 0d534461138528fa0dd8a831b17a82130bdad460 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Wed, 2 Oct 2024 19:23:48 +0200 Subject: [PATCH 3/6] Updated to latest wasmer --- Cargo.lock | 235 ++++++++----------------------------------------- Cargo.toml | 13 +-- src/runtime.rs | 9 +- 3 files changed, 50 insertions(+), 207 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 39ed304f..b8d75443 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -142,12 +142,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base64" -version = "0.21.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79fed4cdb43e993fcdadc7e58a09fd0e3e649c4436fa11da71c9f1f3ee7feb9" - [[package]] name = "base64" version = "0.22.1" @@ -614,7 +608,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", - "serde", ] [[package]] @@ -690,30 +683,6 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" -[[package]] -name = "edge-schema" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0966f1fd49610cc67a835124e6fb4d00a36104e1aa34383c5ef5a265ca00ea2a" -dependencies = [ - "anyhow", - "bytesize", - "once_cell", - "parking_lot", - "rand_chacha", - "rand_core", - "schemars", - "serde", - "serde_json", - "serde_path_to_error", - "serde_yaml 0.8.26", - "sparx", - "time", - "url", - "uuid", - "wcgi-host", -] - [[package]] name = "educe" version = "0.4.23" @@ -1023,7 +992,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.1.0", + "http", "indexmap 2.2.6", "slab", "tokio", @@ -1100,21 +1069,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] -name = "hex" -version = "0.4.3" +name = "hermit-abi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] -name = "http" -version = "0.2.11" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" -dependencies = [ - "bytes", - "fnv", - "itoa", -] +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" @@ -1134,7 +1098,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", - "http 1.1.0", + "http", ] [[package]] @@ -1145,21 +1109,11 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http", "http-body", "pin-project-lite", ] -[[package]] -name = "http-serde" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f560b665ad9f1572cfcaf034f7fb84338a7ce945216d64a90fd81f046a3caee" -dependencies = [ - "http 0.2.11", - "serde", -] - [[package]] name = "httparse" version = "1.9.4" @@ -1176,7 +1130,7 @@ dependencies = [ "futures-channel", "futures-util", "h2", - "http 1.1.0", + "http", "http-body", "httparse", "itoa", @@ -1193,7 +1147,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", - "http 1.1.0", + "http", "hyper", "hyper-util", "rustls", @@ -1228,7 +1182,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "http", "http-body", "hyper", "pin-project-lite", @@ -1515,15 +1469,6 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - [[package]] name = "memmap2" version = "0.6.2" @@ -1569,13 +1514,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1758,16 +1704,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - [[package]] name = "parking_lot_core" version = "0.9.9" @@ -2091,13 +2027,13 @@ version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", - "http 1.1.0", + "http", "http-body", "http-body-util", "hyper", @@ -2222,7 +2158,7 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.22.1", + "base64", "rustls-pki-types", ] @@ -2278,7 +2214,6 @@ dependencies = [ "serde", "serde_json", "url", - "uuid", ] [[package]] @@ -2453,18 +2388,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" -dependencies = [ - "indexmap 1.9.3", - "ryu", - "serde", - "yaml-rust", -] - [[package]] name = "serde_yaml" version = "0.9.34+deprecated" @@ -2505,7 +2428,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ "bytes", - "memmap2 0.6.2", + "memmap2", ] [[package]] @@ -2550,15 +2473,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "sparx" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2257c28eacecfc38c658124ed239e7ecfc9b89082c0794b0672420b63b84c6" -dependencies = [ - "byteorder", -] - [[package]] name = "spin" version = "0.9.8" @@ -2776,9 +2690,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -2787,14 +2701,14 @@ dependencies = [ "pin-project-lite", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", @@ -3101,10 +3015,6 @@ name = "uuid" version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" -dependencies = [ - "getrandom", - "serde", -] [[package]] name = "valuable" @@ -3127,8 +3037,6 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "virtual-fs" version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e60ef133d8336b201a1618252518d81f9e9d30fbe27449dab706699a549216bc" dependencies = [ "anyhow", "async-trait", @@ -3153,8 +3061,6 @@ dependencies = [ [[package]] name = "virtual-mio" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8026c9d7575dc9afd8a0907357acb7aa55ec262097fbccae5da42f67773b3c" dependencies = [ "async-trait", "bytes", @@ -3168,12 +3074,10 @@ dependencies = [ [[package]] name = "virtual-net" version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d9551aa47efdb28093f79845d40858baf5075e4b4a09c7d9c8a0edd42f942b" dependencies = [ "anyhow", "async-trait", - "base64 0.21.6", + "base64", "bincode", "bytecheck", "bytes", @@ -3427,8 +3331,6 @@ dependencies = [ [[package]] name = "wasmer" version = "4.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b28d4251f96ece14460328c56ee0525edcf4bbb08748cfd87fef3580ae4d403" dependencies = [ "bytes", "cfg-if", @@ -3448,7 +3350,7 @@ dependencies = [ "wasmer-derive", "wasmer-types", "wasmer-vm", - "wasmparser 0.121.2", + "wasmparser", "wat", "windows-sys 0.59.0", ] @@ -3456,12 +3358,9 @@ dependencies = [ [[package]] name = "wasmer-api" version = "0.0.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697706b2ab3e1c7951a30c26e4e1dd904e71ce7192d737c5f55bf70e1d0e069e" dependencies = [ "anyhow", "cynic", - "edge-schema", "futures", "getrandom", "harsh", @@ -3482,8 +3381,6 @@ dependencies = [ [[package]] name = "wasmer-compiler" version = "4.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "009b8417d51dbca8ac9a640ea999cc924fc59040a81245ecd0e092cb7c45dc10" dependencies = [ "backtrace", "bytes", @@ -3493,7 +3390,7 @@ dependencies = [ "lazy_static", "leb128", "libc", - "memmap2 0.5.10", + "memmap2", "more-asserts", "region", "rkyv", @@ -3512,8 +3409,6 @@ dependencies = [ [[package]] name = "wasmer-config" version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644b7e3547bd7e796d92220f60bf57734914254c6cee56607e80177a3e8a28da" dependencies = [ "anyhow", "bytesize", @@ -3525,7 +3420,7 @@ dependencies = [ "semver", "serde", "serde_json", - "serde_yaml 0.9.34+deprecated", + "serde_yaml", "thiserror", "toml", "url", @@ -3534,8 +3429,6 @@ dependencies = [ [[package]] name = "wasmer-derive" version = "4.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02592d86ac19fb09c972e72edeb3e57ac5c569eac7e77b919b165da014e8c139" dependencies = [ "proc-macro-error", "proc-macro2", @@ -3546,12 +3439,10 @@ dependencies = [ [[package]] name = "wasmer-journal" version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3045807a8a70da47eb06cb55aad673d5774f87f26ee11b7758d63c54b67bc5f4" dependencies = [ "anyhow", "async-trait", - "base64 0.21.6", + "base64", "bincode", "bytecheck", "bytes", @@ -3612,8 +3503,6 @@ dependencies = [ [[package]] name = "wasmer-types" version = "4.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d22a00f1a90e9e66d5427853f41e76d8ab89e03eb3034debd11933607fef56a" dependencies = [ "bytecheck", "enum-iterator", @@ -3634,8 +3523,6 @@ dependencies = [ [[package]] name = "wasmer-vm" version = "4.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87d88e8355157cd730fb81e33c3b4d6849fd44c26d32bf78820638e1d935967b" dependencies = [ "backtrace", "cc", @@ -3663,13 +3550,11 @@ dependencies = [ [[package]] name = "wasmer-wasix" version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbfe427dbe359e037e1e33ff13b3a5473706e5679df2dbb0e71b5b46c9bb6ce3" dependencies = [ "ahash 0.8.11", "anyhow", "async-trait", - "base64 0.21.6", + "base64", "bincode", "blake3", "bytecheck", @@ -3683,7 +3568,7 @@ dependencies = [ "getrandom", "heapless", "hex", - "http 1.1.0", + "http", "js-sys", "lazy_static", "libc", @@ -3700,7 +3585,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_yaml 0.9.34+deprecated", + "serde_yaml", "sha2", "shared-buffer", "tempfile", @@ -3734,8 +3619,6 @@ dependencies = [ [[package]] name = "wasmer-wasix-types" version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b9304c02de27468ea4154a31f8758343717d03a29d2a620bc652e8217baab75" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -3755,16 +3638,6 @@ dependencies = [ "wasmer-types", ] -[[package]] -name = "wasmparser" -version = "0.95.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ea896273ea99b15132414be1da01ab0d8836415083298ecaffbe308eaac87a" -dependencies = [ - "indexmap 1.9.3", - "url", -] - [[package]] name = "wasmparser" version = "0.121.2" @@ -3797,33 +3670,6 @@ dependencies = [ "wast", ] -[[package]] -name = "wcgi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ca8f334eec3a8197bd25a612c74f415b8691d219ee11f1acd20f15a3e2bf77" -dependencies = [ - "http 0.2.11", - "http-serde", - "serde", - "serde_json", - "url", -] - -[[package]] -name = "wcgi-host" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a762cf2b0ed389a2a2fb591d63a398c1a4c0f8bef938cfd040285a3c63b695cc" -dependencies = [ - "http 0.2.11", - "schemars", - "serde", - "tokio", - "wasmparser 0.95.0", - "wcgi", -] - [[package]] name = "web-sys" version = "0.3.66" @@ -3836,12 +3682,12 @@ dependencies = [ [[package]] name = "webc" -version = "6.0.1" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48441419be082f8d2537c84d8b1f502624d77bc08fbbd09ab17cadfe7f0ac53" +checksum = "cdea84cf234555864ca9b7a5084c1a99dbdf2d148035f62a09b19ce5606532c1" dependencies = [ "anyhow", - "base64 0.22.1", + "base64", "bytes", "cfg-if", "ciborium", @@ -4179,15 +4025,6 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63658493314859b4dfdf3fb8c1defd61587839def09582db50b8a4e93afca6bb" -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "yansi" version = "1.0.1" diff --git a/Cargo.toml b/Cargo.toml index 4e0c544e..b11ca5be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ wasmer-api = { version = "0.0.34"} wasmer-config = "0.8.0" wasmer-types = "4.3.6" wasmer-wasix = { version = "0.27.0", default-features = false, features = ["js", "js-default"] } -webc = "6.0.1" +webc = "6.1.0" [dependencies.web-sys] version = "0.3" @@ -107,7 +107,10 @@ wasm-opt = ["--enable-threads", "--enable-bulk-memory", "-Oz"] #virtual-fs = { git = "https://github.com/wasmerio/wasmer", branch = "master" } #wasmer-wasix = { git = "https://github.com/wasmerio/wasmer", branch = "master" } #wasmer = { git = "https://github.com/wasmerio/wasmer", branch = "master" } -# virtual-net = { path = "../wasmer/lib/virtual-net" } -# virtual-fs = { path = "../wasmer/lib/virtual-fs" } -# wasmer-wasix = { path = "../wasmer/lib/wasix" } -# wasmer = { path = "../wasmer/lib/api" } +virtual-net = { path = "../wasmer/lib/virtual-net" } +virtual-fs = { path = "../wasmer/lib/virtual-fs" } +wasmer-wasix = { path = "../wasmer/lib/wasix" } +wasmer = { path = "../wasmer/lib/api" } +wasmer-api = { path = "../wasmer/lib/backend-api" } +wasmer-config = { path = "../wasmer/lib/config" } +wasmer-types = { path = "../wasmer/lib/types" } diff --git a/src/runtime.rs b/src/runtime.rs index 74c6623c..99b7103d 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -249,14 +249,15 @@ struct UnsupportedSource; #[async_trait::async_trait] impl Source for UnsupportedSource { - async fn query(&self, _package: &PackageSource) -> Result, QueryError> { - Err(QueryError::Unsupported) + async fn query(&self, package: &PackageSource) -> Result, QueryError> { + Err(QueryError::Unsupported { query: package.clone()}) } } #[cfg(test)] mod tests { use wasm_bindgen_test::wasm_bindgen_test; + use wasmer::Module; use wasmer_wasix::{Runtime as _, WasiEnvBuilder}; use super::*; @@ -271,7 +272,9 @@ mod tests { #[wasm_bindgen_test] async fn execute_a_trivial_module() { let runtime = Runtime::with_defaults().unwrap().with_default_pool(); - let module = runtime.load_module(TRIVIAL_WAT).await.unwrap(); + // let module = runtime.load_module(TRIVIAL_WAT).await.unwrap(); + + let module = Module::new(&runtime.engine(), TRIVIAL_WAT).unwrap(); WasiEnvBuilder::new("trivial") .runtime(Arc::new(runtime)) From b60f3f5dbfef3fa28c7600dfc68c40670ef5ad67 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Mon, 7 Oct 2024 17:31:39 +0400 Subject: [PATCH 4/6] Enable cwd option --- .github/workflows/release-please.yml | 2 +- Cargo.lock | 28 +++++++++++++--------------- Cargo.toml | 15 ++++++++------- src/options.rs | 14 +++++++++++++- src/wasmer.rs | 7 +++++++ 5 files changed, 42 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 2e056575..1b82f317 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -106,7 +106,7 @@ jobs: run: npm run build working-directory: examples/wasmer.sh - name: Deploy wasmer.sh to wasmer.io - run: wasmer deploy --registry="https://registry.wasmer.io/graphql" --token=${{ secrets.WASMER_CIUSER_PROD_TOKEN }} --non-interactive --no-wait --no-persist-id --publish-package --owner=wasmer-examples + run: wasmer deploy --registry="https://registry.wasmer.io/graphql" --token=${{ secrets.WASMER_CIUSER_PROD_TOKEN }} --non-interactive --no-wait --no-persist-id --publish-package --owner=wasmer continue-on-error: true working-directory: examples/wasmer.sh - name: Install ffmpeg-react dependencies diff --git a/Cargo.lock b/Cargo.lock index b8d75443..0bae1040 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3036,7 +3036,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "virtual-fs" -version = "0.16.0" +version = "0.17.0" dependencies = [ "anyhow", "async-trait", @@ -3060,7 +3060,7 @@ dependencies = [ [[package]] name = "virtual-mio" -version = "0.3.1" +version = "0.4.0" dependencies = [ "async-trait", "bytes", @@ -3073,7 +3073,7 @@ dependencies = [ [[package]] name = "virtual-net" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "async-trait", @@ -3330,7 +3330,7 @@ dependencies = [ [[package]] name = "wasmer" -version = "4.3.7" +version = "4.4.0" dependencies = [ "bytes", "cfg-if", @@ -3357,7 +3357,7 @@ dependencies = [ [[package]] name = "wasmer-api" -version = "0.0.34" +version = "0.1.0" dependencies = [ "anyhow", "cynic", @@ -3380,7 +3380,7 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "4.3.7" +version = "4.4.0" dependencies = [ "backtrace", "bytes", @@ -3408,7 +3408,7 @@ dependencies = [ [[package]] name = "wasmer-config" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "bytesize", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "4.3.7" +version = "4.4.0" dependencies = [ "proc-macro-error", "proc-macro2", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "wasmer-journal" -version = "0.9.0" +version = "0.10.0" dependencies = [ "anyhow", "async-trait", @@ -3502,7 +3502,7 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "4.3.7" +version = "4.4.0" dependencies = [ "bytecheck", "enum-iterator", @@ -3522,7 +3522,7 @@ dependencies = [ [[package]] name = "wasmer-vm" -version = "4.3.7" +version = "4.4.0" dependencies = [ "backtrace", "cc", @@ -3549,7 +3549,7 @@ dependencies = [ [[package]] name = "wasmer-wasix" -version = "0.27.0" +version = "0.28.0" dependencies = [ "ahash 0.8.11", "anyhow", @@ -3618,7 +3618,7 @@ dependencies = [ [[package]] name = "wasmer-wasix-types" -version = "0.27.0" +version = "0.28.0" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -3683,8 +3683,6 @@ dependencies = [ [[package]] name = "webc" version = "6.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdea84cf234555864ca9b7a5084c1a99dbdf2d148035f62a09b19ce5606532c1" dependencies = [ "anyhow", "base64", diff --git a/Cargo.toml b/Cargo.toml index b11ca5be..4941de66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,17 +30,17 @@ toml = "0.8.14" tracing = { version = "0.1", features = ["log", "release_max_level_debug"] } tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } url = "2.4.0" -virtual-fs = { version = "0.16.0", default-features = false } -virtual-net = { version = "0.8.0", default-features = false, features = ["remote"] } +virtual-fs = { version = "0.17.0", default-features = false } +virtual-net = { version = "0.9.0", default-features = false, features = ["remote"] } wasm-bindgen = { version = "=0.2.92" } wasm-bindgen-derive = "0.2.1" wasm-bindgen-futures = "0.4.40" wasm-bindgen-test = "0.3.40" -wasmer = { version = "4.3.6", default-features = false, features = ["js", "js-default", "wasm-types-polyfill", "enable-serde"] } -wasmer-api = { version = "0.0.34"} -wasmer-config = "0.8.0" -wasmer-types = "4.3.6" -wasmer-wasix = { version = "0.27.0", default-features = false, features = ["js", "js-default"] } +wasmer = { version = "4.4.0", default-features = false, features = ["js", "js-default", "wasm-types-polyfill", "enable-serde"] } +wasmer-api = { version = "0.1.0"} +wasmer-config = "0.9.0" +wasmer-types = "4.4.0" +wasmer-wasix = { version = "0.28.0", default-features = false, features = ["js", "js-default"] } webc = "6.1.0" [dependencies.web-sys] @@ -107,6 +107,7 @@ wasm-opt = ["--enable-threads", "--enable-bulk-memory", "-Oz"] #virtual-fs = { git = "https://github.com/wasmerio/wasmer", branch = "master" } #wasmer-wasix = { git = "https://github.com/wasmerio/wasmer", branch = "master" } #wasmer = { git = "https://github.com/wasmerio/wasmer", branch = "master" } +webc = { path = "../pirita/crates/webc" } virtual-net = { path = "../wasmer/lib/virtual-net" } virtual-fs = { path = "../wasmer/lib/virtual-fs" } wasmer-wasix = { path = "../wasmer/lib/wasix" } diff --git a/src/options.rs b/src/options.rs index 53a66c46..9fb39580 100644 --- a/src/options.rs +++ b/src/options.rs @@ -41,6 +41,8 @@ type CommonOptions = { * files. */ mount?: Record; + /** The current working directory. */ + cwd?: string; }; /** @@ -76,6 +78,9 @@ extern "C" { #[wasm_bindgen(typescript_type = "CommonOptions", extends = js_sys::Object)] pub type CommonOptions; + #[wasm_bindgen(method, getter)] + fn cwd(this: &CommonOptions) -> Option; + #[wasm_bindgen(method, getter)] fn args(this: &CommonOptions) -> Option; @@ -97,6 +102,13 @@ impl CommonOptions { } } + pub(crate) fn parse_cwd(&self) -> Result, Error> { + match self.cwd() { + Some(cwd) => Ok(Some(cwd)), + None => Ok(None), + } + } + pub(crate) fn parse_env(&self) -> Result, Error> { match self.env().dyn_ref() { Some(env) => { @@ -116,7 +128,7 @@ impl CommonOptions { return Ok(Vec::new()); }; - let entries = crate::utils::object_entries(&obj)?; + let entries: BTreeMap = crate::utils::object_entries(&obj)?; let mut mounted_directories = Vec::new(); for (key, value) in &entries { diff --git a/src/wasmer.rs b/src/wasmer.rs index 9205687b..82f3eea0 100644 --- a/src/wasmer.rs +++ b/src/wasmer.rs @@ -299,12 +299,19 @@ pub(crate) async fn configure_runner( ), Error, > { + let args = options.parse_args()?; runner.with_args(args); let env = options.parse_env()?; runner.with_envs(env); + tracing::debug!("Setting up CWD"); + if let Some(cwd) = options.parse_cwd()? { + tracing::debug!("CWD FOUND {}", cwd); + runner.with_current_dir(cwd); + } + for (dest, dir) in options.mounted_directories()? { runner.with_mount(dest, Arc::new(dir)); } From 80fe4b0915a5f2c6bfed932f17d29ffe2920ad47 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Mon, 7 Oct 2024 17:31:46 +0400 Subject: [PATCH 5/6] Use DefaultHTTPClient --- src/runtime.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/runtime.rs b/src/runtime.rs index 99b7103d..7e2a58ec 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -6,7 +6,7 @@ use once_cell::sync::Lazy; use virtual_net::VirtualNetworking; use wasmer_config::package::PackageSource; use wasmer_wasix::{ - http::{HttpClient, WebHttpClient}, + http::{HttpClient, WebHttpClient as DefaultHttpClient}, // reqwest::ReqwestHttpClient os::{TtyBridge, TtyOptions}, runtime::{ module_cache::ThreadLocalCache, @@ -86,13 +86,13 @@ impl Runtime { pub(crate) fn with_task_manager(&self, task_manager: Arc) -> Self { let mut runtime = self.clone(); // Update the http client - let mut http_client = WebHttpClient::default(); - http_client - .with_default_header( - reqwest::header::USER_AGENT, - HeaderValue::from_static(crate::USER_AGENT), - ) - .with_task_manager(task_manager.clone()); + let mut http_client = DefaultHttpClient::default(); + // http_client + // .with_default_header( + // reqwest::header::USER_AGENT, + // HeaderValue::from_static(crate::USER_AGENT), + // ) + // .with_task_manager(task_manager.clone()); runtime.http_client = Arc::new(http_client); runtime.task_manager = Some(task_manager); @@ -105,11 +105,11 @@ impl Runtime { } pub(crate) fn new() -> Self { - let mut http_client = WebHttpClient::default(); - http_client.with_default_header( - reqwest::header::USER_AGENT, - HeaderValue::from_static(crate::USER_AGENT), - ); + let mut http_client = DefaultHttpClient::default(); + // http_client.with_default_header( + // reqwest::header::USER_AGENT, + // HeaderValue::from_static(crate::USER_AGENT), + // ); let http_client = Arc::new(http_client); let module_cache = ThreadLocalCache::default(); From 0ec19605c6c82d5da7777159bedcb5a2a2d8378d Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Mon, 7 Oct 2024 17:32:08 +0400 Subject: [PATCH 6/6] Improve wasmer-sh --- examples/wasmer.sh/app.yaml | 10 +- examples/wasmer.sh/index.ts | 45 ++- examples/wasmer.sh/pnpm-lock.yaml | 467 ++++++++++++++++++++++++++++++ examples/wasmer.sh/wasmer.toml | 19 +- 4 files changed, 524 insertions(+), 17 deletions(-) create mode 100644 examples/wasmer.sh/pnpm-lock.yaml diff --git a/examples/wasmer.sh/app.yaml b/examples/wasmer.sh/app.yaml index 513f250e..e238c9f9 100644 --- a/examples/wasmer.sh/app.yaml +++ b/examples/wasmer.sh/app.yaml @@ -1,4 +1,8 @@ ---- -kind: wasmer.io/App.v0 name: wasmer-examples-wasmer-sh -package: wasmer-examples/wasmer-sh +app_id: da_bRbxI9tgUaQK +owner: wasmer +package: . +domains: +- wasmer-examples-wasmer-sh.wasmer.app +- wasmer-sh.wasmer.app +kind: wasmer.io/App.v0 diff --git a/examples/wasmer.sh/index.ts b/examples/wasmer.sh/index.ts index d5942cfd..0d689705 100644 --- a/examples/wasmer.sh/index.ts +++ b/examples/wasmer.sh/index.ts @@ -8,9 +8,10 @@ const encoder = new TextEncoder(); const params = new URLSearchParams(window.location.search); const packageName = params.get("package") || "sharrattj/bash"; -const uses = params.getAll("use"); +const uses = packageName == "sharrattj/bash" ? ["wasmer/neatvi"] : params.getAll("use"); + const args = params.getAll("arg"); -const logFilter = params.get("log") || "warn"; +const logFilter = params.get("log") || "trace"; async function main() { // Note: We dynamically import the Wasmer SDK to make sure the bundler puts @@ -19,7 +20,7 @@ async function main() { // same chunk as @wasmer/sdk, each Web Worker will try to run this code and // crash. // See https://github.com/wasmerio/wasmer-js/issues/373 - const { Wasmer, init } = await import("@wasmer/sdk"); + const { Wasmer, init, Directory } = await import("@wasmer/sdk"); await init({log: logFilter}); @@ -32,7 +33,43 @@ async function main() { term.writeln("Starting..."); const pkg = await Wasmer.fromRegistry(packageName); term.reset(); - const instance = await pkg.entrypoint!.run({ args, uses }); + const home = new Directory(); + await home.writeFile("example.c", + `#include + + int main() { + printf("Hello World from WebAssembly!\\n"); + return 0; + } + `); + await home.writeFile("donut.c", ` +#include +#include + + k;double sin() + ,cos();main(){float A= + 0,B=0,i,j,z[1760];char b[ + 1760];printf("\x1b[2J");for(;; + ){memset(b,32,1760);memset(z,0,7040) + ;for(j=0;6.28>j;j+=0.07)for(i=0;6.28 + >i;i+=0.02){float c=sin(i),d=cos(j),e= + sin(A),f=sin(j),g=cos(A),h=d+2,D=1/(c* + h*e+f*g+5),l=cos (i),m=cos(B),n=s\ +in(B),t=c*h*g-f* e;int x=40+30*D* +(l*h*m-t*n),y= 12+15*D*(l*h*n ++t*m),o=x+80*y, N=8*((f*e-c*d*g + )*m-c*d*e-f*g-l *d*n);if(22>y&& + y>0&&x>0&&80>x&&D>z[o]){z[o]=D;;;b[o]= + ".,-~:;=!*#$@"[N>0?N:0];}}/*#****!!-*/ + printf("\x1b[H");for(k=0;1761>k;k++) + putchar(k%80?b[k]:10);A+=0.04;B+= + 0.02;}}/*****####*******!!=;:~ + ~::==!!!**********!!!==::- + .,~~;;;========;;;:~-. + ..,--------,*/ +`); + + const instance = await pkg.entrypoint!.run({ args, uses, mount: { "/home": home }, cwd: "/home"}); connectStreams(instance, term); } diff --git a/examples/wasmer.sh/pnpm-lock.yaml b/examples/wasmer.sh/pnpm-lock.yaml new file mode 100644 index 00000000..bdf61121 --- /dev/null +++ b/examples/wasmer.sh/pnpm-lock.yaml @@ -0,0 +1,467 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@wasmer/sdk': + specifier: ../.. + version: link:../.. + xterm: + specifier: ^5.3.0 + version: 5.3.0 + xterm-addon-fit: + specifier: ^0.8.0 + version: 0.8.0(xterm@5.3.0) + devDependencies: + vite: + specifier: ^5.0.4 + version: 5.0.8 + +packages: + + '@esbuild/android-arm64@0.19.9': + resolution: {integrity: sha512-q4cR+6ZD0938R19MyEW3jEsMzbb/1rulLXiNAJQADD/XYp7pT+rOS5JGxvpRW8dFDEfjW4wLgC/3FXIw4zYglQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.19.9': + resolution: {integrity: sha512-jkYjjq7SdsWuNI6b5quymW0oC83NN5FdRPuCbs9HZ02mfVdAP8B8eeqLSYU3gb6OJEaY5CQabtTFbqBf26H3GA==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.19.9': + resolution: {integrity: sha512-KOqoPntWAH6ZxDwx1D6mRntIgZh9KodzgNOy5Ebt9ghzffOk9X2c1sPwtM9P+0eXbefnDhqYfkh5PLP5ULtWFA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.19.9': + resolution: {integrity: sha512-KBJ9S0AFyLVx2E5D8W0vExqRW01WqRtczUZ8NRu+Pi+87opZn5tL4Y0xT0mA4FtHctd0ZgwNoN639fUUGlNIWw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.19.9': + resolution: {integrity: sha512-vE0VotmNTQaTdX0Q9dOHmMTao6ObjyPm58CHZr1UK7qpNleQyxlFlNCaHsHx6Uqv86VgPmR4o2wdNq3dP1qyDQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.19.9': + resolution: {integrity: sha512-uFQyd/o1IjiEk3rUHSwUKkqZwqdvuD8GevWF065eqgYfexcVkxh+IJgwTaGZVu59XczZGcN/YMh9uF1fWD8j1g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.19.9': + resolution: {integrity: sha512-WMLgWAtkdTbTu1AWacY7uoj/YtHthgqrqhf1OaEWnZb7PQgpt8eaA/F3LkV0E6K/Lc0cUr/uaVP/49iE4M4asA==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.19.9': + resolution: {integrity: sha512-PiPblfe1BjK7WDAKR1Cr9O7VVPqVNpwFcPWgfn4xu0eMemzRp442hXyzF/fSwgrufI66FpHOEJk0yYdPInsmyQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.19.9': + resolution: {integrity: sha512-C/ChPohUYoyUaqn1h17m/6yt6OB14hbXvT8EgM1ZWaiiTYz7nWZR0SYmMnB5BzQA4GXl3BgBO1l8MYqL/He3qw==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.19.9': + resolution: {integrity: sha512-f37i/0zE0MjDxijkPSQw1CO/7C27Eojqb+r3BbHVxMLkj8GCa78TrBZzvPyA/FNLUMzP3eyHCVkAopkKVja+6Q==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.19.9': + resolution: {integrity: sha512-t6mN147pUIf3t6wUt3FeumoOTPfmv9Cc6DQlsVBpB7eCpLOqQDyWBP1ymXn1lDw4fNUSb/gBcKAmvTP49oIkaA==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.19.9': + resolution: {integrity: sha512-jg9fujJTNTQBuDXdmAg1eeJUL4Jds7BklOTkkH80ZgQIoCTdQrDaHYgbFZyeTq8zbY+axgptncko3v9p5hLZtw==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.19.9': + resolution: {integrity: sha512-tkV0xUX0pUUgY4ha7z5BbDS85uI7ABw3V1d0RNTii7E9lbmV8Z37Pup2tsLV46SQWzjOeyDi1Q7Wx2+QM8WaCQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.19.9': + resolution: {integrity: sha512-DfLp8dj91cufgPZDXr9p3FoR++m3ZJ6uIXsXrIvJdOjXVREtXuQCjfMfvmc3LScAVmLjcfloyVtpn43D56JFHg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.19.9': + resolution: {integrity: sha512-zHbglfEdC88KMgCWpOl/zc6dDYJvWGLiUtmPRsr1OgCViu3z5GncvNVdf+6/56O2Ca8jUU+t1BW261V6kp8qdw==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.19.9': + resolution: {integrity: sha512-JUjpystGFFmNrEHQnIVG8hKwvA2DN5o7RqiO1CVX8EN/F/gkCjkUMgVn6hzScpwnJtl2mPR6I9XV1oW8k9O+0A==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-x64@0.19.9': + resolution: {integrity: sha512-GThgZPAwOBOsheA2RUlW5UeroRfESwMq/guy8uEe3wJlAOjpOXuSevLRd70NZ37ZrpO6RHGHgEHvPg1h3S1Jug==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-x64@0.19.9': + resolution: {integrity: sha512-Ki6PlzppaFVbLnD8PtlVQfsYw4S9n3eQl87cqgeIw+O3sRr9IghpfSKY62mggdt1yCSZ8QWvTZ9jo9fjDSg9uw==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + + '@esbuild/sunos-x64@0.19.9': + resolution: {integrity: sha512-MLHj7k9hWh4y1ddkBpvRj2b9NCBhfgBt3VpWbHQnXRedVun/hC7sIyTGDGTfsGuXo4ebik2+3ShjcPbhtFwWDw==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.19.9': + resolution: {integrity: sha512-GQoa6OrQ8G08guMFgeXPH7yE/8Dt0IfOGWJSfSH4uafwdC7rWwrfE6P9N8AtPGIjUzdo2+7bN8Xo3qC578olhg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.19.9': + resolution: {integrity: sha512-UOozV7Ntykvr5tSOlGCrqU3NBr3d8JqPes0QWN2WOXfvkWVGRajC+Ym0/Wj88fUgecUCLDdJPDF0Nna2UK3Qtg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.19.9': + resolution: {integrity: sha512-oxoQgglOP7RH6iasDrhY+R/3cHrfwIDvRlT4CGChflq6twk8iENeVvMJjmvBb94Ik1Z+93iGO27err7w6l54GQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + + '@rollup/rollup-android-arm-eabi@4.8.0': + resolution: {integrity: sha512-zdTObFRoNENrdPpnTNnhOljYIcOX7aI7+7wyrSpPFFIOf/nRdedE6IYsjaBE7tjukphh1tMTojgJ7p3lKY8x6Q==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.8.0': + resolution: {integrity: sha512-aiItwP48BiGpMFS9Znjo/xCNQVwTQVcRKkFKsO81m8exrGjHkCBDvm9PHay2kpa8RPnZzzKcD1iQ9KaLY4fPQQ==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.8.0': + resolution: {integrity: sha512-zhNIS+L4ZYkYQUjIQUR6Zl0RXhbbA0huvNIWjmPc2SL0cB1h5Djkcy+RZ3/Bwszfb6vgwUvcVJYD6e6Zkpsi8g==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.8.0': + resolution: {integrity: sha512-A/FAHFRNQYrELrb/JHncRWzTTXB2ticiRFztP4ggIUAfa9Up1qfW8aG2w/mN9jNiZ+HB0t0u0jpJgFXG6BfRTA==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-linux-arm-gnueabihf@4.8.0': + resolution: {integrity: sha512-JsidBnh3p2IJJA4/2xOF2puAYqbaczB3elZDT0qHxn362EIoIkq7hrR43Xa8RisgI6/WPfvb2umbGsuvf7E37A==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.8.0': + resolution: {integrity: sha512-hBNCnqw3EVCkaPB0Oqd24bv8SklETptQWcJz06kb9OtiShn9jK1VuTgi7o4zPSt6rNGWQOTDEAccbk0OqJmS+g==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.8.0': + resolution: {integrity: sha512-Fw9ChYfJPdltvi9ALJ9wzdCdxGw4wtq4t1qY028b2O7GwB5qLNSGtqMsAel1lfWTZvf4b6/+4HKp0GlSYg0ahA==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.8.0': + resolution: {integrity: sha512-BH5xIh7tOzS9yBi8dFrCTG8Z6iNIGWGltd3IpTSKp6+pNWWO6qy8eKoRxOtwFbMrid5NZaidLYN6rHh9aB8bEw==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.8.0': + resolution: {integrity: sha512-PmvAj8k6EuWiyLbkNpd6BLv5XeYFpqWuRvRNRl80xVfpGXK/z6KYXmAgbI4ogz7uFiJxCnYcqyvZVD0dgFog7Q==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.8.0': + resolution: {integrity: sha512-mdxnlW2QUzXwY+95TuxZ+CurrhgrPAMveDWI97EQlA9bfhR8tw3Pt7SUlc/eSlCNxlWktpmT//EAA8UfCHOyXg==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-win32-arm64-msvc@4.8.0': + resolution: {integrity: sha512-ge7saUz38aesM4MA7Cad8CHo0Fyd1+qTaqoIo+Jtk+ipBi4ATSrHWov9/S4u5pbEQmLjgUjB7BJt+MiKG2kzmA==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.8.0': + resolution: {integrity: sha512-p9E3PZlzurhlsN5h9g7zIP1DnqKXJe8ZUkFwAazqSvHuWfihlIISPxG9hCHCoA+dOOspL/c7ty1eeEVFTE0UTw==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.8.0': + resolution: {integrity: sha512-kb4/auKXkYKqlUYTE8s40FcJIj5soOyRLHKd4ugR0dCq0G2EfcF54eYcfQiGkHzjidZ40daB4ulsFdtqNKZtBg==} + cpu: [x64] + os: [win32] + + esbuild@0.19.9: + resolution: {integrity: sha512-U9CHtKSy+EpPsEBa+/A2gMs/h3ylBC0H0KSqIg7tpztHerLi6nrrcoUJAkNCEPumx8yJ+Byic4BVwHgRbN0TBg==} + engines: {node: '>=12'} + hasBin: true + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + + postcss@8.4.32: + resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==} + engines: {node: ^10 || ^12 || >=14} + + rollup@4.8.0: + resolution: {integrity: sha512-NpsklK2fach5CdI+PScmlE5R4Ao/FSWtF7LkoIrHDxPACY/xshNasPsbpG0VVHxUTbf74tJbVT4PrP8JsJ6ZDA==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + source-map-js@1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + engines: {node: '>=0.10.0'} + + vite@5.0.8: + resolution: {integrity: sha512-jYMALd8aeqR3yS9xlHd0OzQJndS9fH5ylVgWdB+pxTwxLKdO1pgC5Dlb398BUxpfaBxa4M9oT7j1g503Gaj5IQ==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + + xterm-addon-fit@0.8.0: + resolution: {integrity: sha512-yj3Np7XlvxxhYF/EJ7p3KHaMt6OdwQ+HDu573Vx1lRXsVxOcnVJs51RgjZOouIZOczTsskaS+CpXspK81/DLqw==} + peerDependencies: + xterm: ^5.0.0 + + xterm@5.3.0: + resolution: {integrity: sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg==} + +snapshots: + + '@esbuild/android-arm64@0.19.9': + optional: true + + '@esbuild/android-arm@0.19.9': + optional: true + + '@esbuild/android-x64@0.19.9': + optional: true + + '@esbuild/darwin-arm64@0.19.9': + optional: true + + '@esbuild/darwin-x64@0.19.9': + optional: true + + '@esbuild/freebsd-arm64@0.19.9': + optional: true + + '@esbuild/freebsd-x64@0.19.9': + optional: true + + '@esbuild/linux-arm64@0.19.9': + optional: true + + '@esbuild/linux-arm@0.19.9': + optional: true + + '@esbuild/linux-ia32@0.19.9': + optional: true + + '@esbuild/linux-loong64@0.19.9': + optional: true + + '@esbuild/linux-mips64el@0.19.9': + optional: true + + '@esbuild/linux-ppc64@0.19.9': + optional: true + + '@esbuild/linux-riscv64@0.19.9': + optional: true + + '@esbuild/linux-s390x@0.19.9': + optional: true + + '@esbuild/linux-x64@0.19.9': + optional: true + + '@esbuild/netbsd-x64@0.19.9': + optional: true + + '@esbuild/openbsd-x64@0.19.9': + optional: true + + '@esbuild/sunos-x64@0.19.9': + optional: true + + '@esbuild/win32-arm64@0.19.9': + optional: true + + '@esbuild/win32-ia32@0.19.9': + optional: true + + '@esbuild/win32-x64@0.19.9': + optional: true + + '@rollup/rollup-android-arm-eabi@4.8.0': + optional: true + + '@rollup/rollup-android-arm64@4.8.0': + optional: true + + '@rollup/rollup-darwin-arm64@4.8.0': + optional: true + + '@rollup/rollup-darwin-x64@4.8.0': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.8.0': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.8.0': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.8.0': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.8.0': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.8.0': + optional: true + + '@rollup/rollup-linux-x64-musl@4.8.0': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.8.0': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.8.0': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.8.0': + optional: true + + esbuild@0.19.9: + optionalDependencies: + '@esbuild/android-arm': 0.19.9 + '@esbuild/android-arm64': 0.19.9 + '@esbuild/android-x64': 0.19.9 + '@esbuild/darwin-arm64': 0.19.9 + '@esbuild/darwin-x64': 0.19.9 + '@esbuild/freebsd-arm64': 0.19.9 + '@esbuild/freebsd-x64': 0.19.9 + '@esbuild/linux-arm': 0.19.9 + '@esbuild/linux-arm64': 0.19.9 + '@esbuild/linux-ia32': 0.19.9 + '@esbuild/linux-loong64': 0.19.9 + '@esbuild/linux-mips64el': 0.19.9 + '@esbuild/linux-ppc64': 0.19.9 + '@esbuild/linux-riscv64': 0.19.9 + '@esbuild/linux-s390x': 0.19.9 + '@esbuild/linux-x64': 0.19.9 + '@esbuild/netbsd-x64': 0.19.9 + '@esbuild/openbsd-x64': 0.19.9 + '@esbuild/sunos-x64': 0.19.9 + '@esbuild/win32-arm64': 0.19.9 + '@esbuild/win32-ia32': 0.19.9 + '@esbuild/win32-x64': 0.19.9 + + fsevents@2.3.3: + optional: true + + nanoid@3.3.7: {} + + picocolors@1.0.0: {} + + postcss@8.4.32: + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.0.2 + + rollup@4.8.0: + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.8.0 + '@rollup/rollup-android-arm64': 4.8.0 + '@rollup/rollup-darwin-arm64': 4.8.0 + '@rollup/rollup-darwin-x64': 4.8.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.8.0 + '@rollup/rollup-linux-arm64-gnu': 4.8.0 + '@rollup/rollup-linux-arm64-musl': 4.8.0 + '@rollup/rollup-linux-riscv64-gnu': 4.8.0 + '@rollup/rollup-linux-x64-gnu': 4.8.0 + '@rollup/rollup-linux-x64-musl': 4.8.0 + '@rollup/rollup-win32-arm64-msvc': 4.8.0 + '@rollup/rollup-win32-ia32-msvc': 4.8.0 + '@rollup/rollup-win32-x64-msvc': 4.8.0 + fsevents: 2.3.3 + + source-map-js@1.0.2: {} + + vite@5.0.8: + dependencies: + esbuild: 0.19.9 + postcss: 8.4.32 + rollup: 4.8.0 + optionalDependencies: + fsevents: 2.3.3 + + xterm-addon-fit@0.8.0(xterm@5.3.0): + dependencies: + xterm: 5.3.0 + + xterm@5.3.0: {} diff --git a/examples/wasmer.sh/wasmer.toml b/examples/wasmer.sh/wasmer.toml index c718b23f..4e632c37 100644 --- a/examples/wasmer.sh/wasmer.toml +++ b/examples/wasmer.sh/wasmer.toml @@ -1,20 +1,19 @@ [package] -name = "wasmer-examples/wasmer-sh" -version = "0.1.0" +name = "wasmer/wasmer-sh" +version = "0.4.21" description = "The wasmer.sh website" entrypoint = "wasmer-sh" -[[command]] -name = "wasmer-sh" -runner = "wasi" -module = "wasmer/static-web-server:webserver" - -[command.annotations.wasi] -env = ["SERVER_CONFIG_FILE=/etc/static-web-server/config.toml"] - [dependencies] "wasmer/static-web-server" = "^1" [fs] "/public" = "dist" "/etc/static-web-server" = "etc" + +[[command]] +name = "wasmer-sh" +module = "wasmer/static-web-server:webserver" +runner = "wasi" +[command.annotations.wasi] +env = ["SERVER_CONFIG_FILE=/etc/static-web-server/config.toml"]