diff --git a/Cargo.lock b/Cargo.lock index 00b72a755a9..1b41e48ba82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4782,7 +4782,7 @@ dependencies = [ "tokio", "tracing", "typetag", - "webc 5.0.0-rc.5", + "webc 5.0.0-rc.6", ] [[package]] @@ -5295,7 +5295,7 @@ dependencies = [ "wasmer-middlewares", "wasmer-types", "wasmer-wasix", - "webc 5.0.0-rc.5", + "webc 5.0.0-rc.6", ] [[package]] @@ -5396,7 +5396,7 @@ dependencies = [ "wasmer-wasix-experimental-io-devices", "wasmer-wast", "webc 4.1.1", - "webc 5.0.0-rc.5", + "webc 5.0.0-rc.6", ] [[package]] @@ -5677,7 +5677,7 @@ dependencies = [ "wasmer-toml", "wasmer-wasm-interface", "wasmparser 0.51.4", - "webc 5.0.0-rc.5", + "webc 5.0.0-rc.6", "whoami", ] @@ -5810,7 +5810,7 @@ dependencies = [ "wasmer-wasix-types", "wcgi", "wcgi-host", - "webc 5.0.0-rc.5", + "webc 5.0.0-rc.6", "weezl", "winapi", ] @@ -6142,9 +6142,9 @@ dependencies = [ [[package]] name = "webc" -version = "5.0.0-rc.5" +version = "5.0.0-rc.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418bfd8fc298ce60295203a6960d53af48c8e10c5a021a5e7db8bc06c4830148" +checksum = "aa158c77bd41040f4b9a4b91be63446885ce9b04bc9a5bb457fa586e7a8c9815" dependencies = [ "anyhow", "base64 0.21.0", diff --git a/lib/c-api/Cargo.toml b/lib/c-api/Cargo.toml index 85be4077e78..da8d9e1f083 100644 --- a/lib/c-api/Cargo.toml +++ b/lib/c-api/Cargo.toml @@ -32,7 +32,7 @@ wasmer-middlewares = { version = "=3.2.0-beta.2", path = "../middlewares", optio wasmer-wasix = { version = "0.2.0", path = "../wasi", features = ["host-fs", "host-vnet"], optional = true } wasmer-types = { version = "=3.2.0-beta.2", path = "../types" } virtual-fs = { version = "0.1.1", path = "../vfs", optional = true, default-features = false, features = ["static-fs"] } -webc = { version = "=5.0.0-rc.5", optional = true } +webc = { version = "=5.0.0-rc.6", optional = true } enumset = "1.0.2" cfg-if = "1.0" lazy_static = "1.4" diff --git a/lib/cli/Cargo.toml b/lib/cli/Cargo.toml index b796eee0810..c5b8b023f23 100644 --- a/lib/cli/Cargo.toml +++ b/lib/cli/Cargo.toml @@ -64,7 +64,7 @@ regex = "1.6.0" toml = "0.5.9" url = "2.3.1" libc = { version = "^0.2", default-features = false } -webc = { version = "=5.0.0-rc.5" } +webc = { version = "=5.0.0-rc.6" } # HACK(Michael-F-Bryan): Remove this once a new version of wapm-targz-to-pirita # is published that doesn't have a public dependency on webc webc_v4 = { version = "4", package = "webc" } diff --git a/lib/registry/Cargo.toml b/lib/registry/Cargo.toml index 6abbfbdd7d7..c5a3594f87c 100644 --- a/lib/registry/Cargo.toml +++ b/lib/registry/Cargo.toml @@ -27,7 +27,7 @@ tar = "0.4.38" flate2 = "1.0.24" semver = "1.0.14" lzma-rs = "0.2.0" -webc = { version = "=5.0.0-rc.5", features = ["mmap"] } +webc = { version = "=5.0.0-rc.6", features = ["mmap"] } hex = "0.4.3" tokio = "1.24.0" log = "0.4.17" diff --git a/lib/vfs/Cargo.toml b/lib/vfs/Cargo.toml index 8be9140a428..fe9b31b6864 100644 --- a/lib/vfs/Cargo.toml +++ b/lib/vfs/Cargo.toml @@ -11,7 +11,7 @@ libc = { version = "^0.2", default-features = false, optional = true } thiserror = "1" tracing = { version = "0.1" } typetag = { version = "0.1", optional = true } -webc = { version = "=5.0.0-rc.5", optional = true } +webc = { version = "=5.0.0-rc.6", optional = true } slab = { version = "0.4" } derivative = "2.2.0" anyhow = { version = "1.0.66", optional = true } diff --git a/lib/vfs/src/overlay_fs.rs b/lib/vfs/src/overlay_fs.rs index 3c304bc8de8..34628273173 100644 --- a/lib/vfs/src/overlay_fs.rs +++ b/lib/vfs/src/overlay_fs.rs @@ -475,6 +475,7 @@ fn should_continue(e: FsError) -> bool { mod tests { use std::{path::PathBuf, sync::Arc}; + use bytes::Bytes; use tempfile::TempDir; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use webc::v1::{ParseOptions, WebCOwned}; @@ -658,7 +659,7 @@ mod tests { .unwrap(); } // Set up the secondary file systems - let webc = WebCOwned::parse(PYTHON.to_vec(), &ParseOptions::default()).unwrap(); + let webc = WebCOwned::parse(Bytes::from_static(PYTHON), &ParseOptions::default()).unwrap(); let webc = WebcFileSystem::init_all(Arc::new(webc)); let fs = OverlayFileSystem::new(primary, [webc]); @@ -734,7 +735,7 @@ mod tests { fn load_webc(bytes: &'static [u8]) -> WebcFileSystem { let options = ParseOptions::default(); - let webc = WebCOwned::parse(bytes.into(), &options).unwrap(); + let webc = WebCOwned::parse(Bytes::from_static(bytes), &options).unwrap(); WebcFileSystem::init_all(Arc::new(webc)) } diff --git a/lib/vfs/src/webc_fs.rs b/lib/vfs/src/webc_fs.rs index 2dace6d5119..cab9f07b631 100644 --- a/lib/vfs/src/webc_fs.rs +++ b/lib/vfs/src/webc_fs.rs @@ -448,6 +448,7 @@ fn translate_file_type(f: FsEntryType) -> crate::FileType { #[cfg(test)] mod tests { + use bytes::Bytes; use tokio::io::AsyncReadExt; use webc::v1::{ParseOptions, WebCOwned}; @@ -457,7 +458,7 @@ mod tests { async fn read_a_file_from_the_webc_fs() { let webc: &[u8] = include_bytes!("../../c-api/examples/assets/python-0.1.0.wasmer"); let options = ParseOptions::default(); - let webc = WebCOwned::parse(webc.to_vec(), &options).unwrap(); + let webc = WebCOwned::parse(Bytes::from_static(webc), &options).unwrap(); let fs = WebcFileSystem::init_all(Arc::new(webc)); diff --git a/lib/wasi/Cargo.toml b/lib/wasi/Cargo.toml index 22507610194..97f412cc412 100644 --- a/lib/wasi/Cargo.toml +++ b/lib/wasi/Cargo.toml @@ -27,7 +27,7 @@ bincode = { version = "1.3" } chrono = { version = "^0.4", default-features = false, features = [ "wasmbind", "std", "clock" ], optional = true } derivative = { version = "^2" } bytes = "1" -webc = { version = "=5.0.0-rc.5", default-features = false } +webc = { version = "=5.0.0-rc.6", default-features = false } serde_cbor = { version = "0.11.2", optional = true } anyhow = { version = "1.0.66" } lazy_static = "1.4" diff --git a/lib/wasi/src/runners/container.rs b/lib/wasi/src/runners/container.rs index 3a9a45c4acf..5ac8d62f883 100644 --- a/lib/wasi/src/runners/container.rs +++ b/lib/wasi/src/runners/container.rs @@ -28,7 +28,7 @@ impl WapmContainer { pub fn from_bytes(bytes: Bytes) -> std::result::Result { match webc::detect(bytes.as_ref())? { Version::V1 => { - let webc = WebCOwned::parse(bytes.into(), &ParseOptions::default())?; + let webc = WebCOwned::parse(bytes, &ParseOptions::default())?; Ok(WapmContainer { repr: Repr::V1Owned(Arc::new(webc)), }) diff --git a/lib/wasi/src/runners/emscripten.rs b/lib/wasi/src/runners/emscripten.rs index f0b9cb4ee8e..81b66a7714e 100644 --- a/lib/wasi/src/runners/emscripten.rs +++ b/lib/wasi/src/runners/emscripten.rs @@ -63,7 +63,7 @@ impl crate::runners::Runner for EmscriptenRunner { atom: atom_name, main_args, .. - } = command.get_annotation("emscripten")?.unwrap_or_default(); + } = command.annotation("emscripten")?.unwrap_or_default(); let atom_name = atom_name.context("The atom name is required")?; let atom_bytes = container .get_atom(&atom_name) diff --git a/lib/wasi/src/runners/wasi.rs b/lib/wasi/src/runners/wasi.rs index efb25b8d365..361863ea49b 100644 --- a/lib/wasi/src/runners/wasi.rs +++ b/lib/wasi/src/runners/wasi.rs @@ -164,7 +164,7 @@ impl crate::runners::Runner for WasiRunner { container: &WapmContainer, ) -> Result { let wasi = command - .get_annotation("wasi")? + .annotation("wasi")? .unwrap_or_else(|| Wasi::new(command_name)); let atom_name = &wasi.atom; let atom = container diff --git a/lib/wasi/src/runners/wcgi/runner.rs b/lib/wasi/src/runners/wcgi/runner.rs index 41f540c7415..d47f6de8445 100644 --- a/lib/wasi/src/runners/wcgi/runner.rs +++ b/lib/wasi/src/runners/wcgi/runner.rs @@ -44,7 +44,7 @@ impl WcgiRunner { fn run(&mut self, command_name: &str, ctx: &RunnerContext<'_>) -> Result<(), Error> { let wasi: Wasi = ctx .command() - .get_annotation("wasi") + .annotation("wasi") .context("Unable to retrieve the WASI metadata")? .unwrap_or_else(|| Wasi::new(command_name)); @@ -147,7 +147,7 @@ impl WcgiRunner { wasi: &Wasi, ctx: &RunnerContext<'_>, ) -> Result { - let Wcgi { dialect, .. } = ctx.command().get_annotation("wcgi")?.unwrap_or_default(); + let Wcgi { dialect, .. } = ctx.command().annotation("wcgi")?.unwrap_or_default(); let dialect = match dialect { Some(d) => d.parse().context("Unable to parse the CGI dialect")?,