Skip to content

Commit

Permalink
Merge pull request #3753 from wasmerio/upgrade-webc
Browse files Browse the repository at this point in the history
Upgrade webc from webc 5.0.0-rc.5 to webc 5.0.0-rc.6
  • Loading branch information
Michael Bryan authored Apr 8, 2023
2 parents c742ae9 + 71bcb9c commit e59b243
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 20 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/c-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lib/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion lib/registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lib/vfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
5 changes: 3 additions & 2 deletions lib/vfs/src/overlay_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -734,7 +735,7 @@ mod tests {

fn load_webc(bytes: &'static [u8]) -> WebcFileSystem<WebCOwned> {
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))
}

Expand Down
3 changes: 2 additions & 1 deletion lib/vfs/src/webc_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand All @@ -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));

Expand Down
2 changes: 1 addition & 1 deletion lib/wasi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lib/wasi/src/runners/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl WapmContainer {
pub fn from_bytes(bytes: Bytes) -> std::result::Result<Self, WebcParseError> {
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)),
})
Expand Down
2 changes: 1 addition & 1 deletion lib/wasi/src/runners/emscripten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/wasi/src/runners/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl crate::runners::Runner for WasiRunner {
container: &WapmContainer,
) -> Result<Self::Output, Error> {
let wasi = command
.get_annotation("wasi")?
.annotation("wasi")?
.unwrap_or_else(|| Wasi::new(command_name));
let atom_name = &wasi.atom;
let atom = container
Expand Down
4 changes: 2 additions & 2 deletions lib/wasi/src/runners/wcgi/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -147,7 +147,7 @@ impl WcgiRunner {
wasi: &Wasi,
ctx: &RunnerContext<'_>,
) -> Result<Handler, Error> {
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")?,
Expand Down

0 comments on commit e59b243

Please sign in to comment.