diff --git a/Cargo.lock b/Cargo.lock index fd7229e05..b83b64943 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -361,14 +361,14 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.66.0" +version = "0.67.0" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.66.0" +version = "0.67.0" dependencies = [ "byteorder", "cranelift-bforest", @@ -385,7 +385,7 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.66.0" +version = "0.67.0" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -393,15 +393,15 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.66.0" +version = "0.67.0" [[package]] name = "cranelift-entity" -version = "0.66.0" +version = "0.67.0" [[package]] name = "cranelift-frontend" -version = "0.66.0" +version = "0.67.0" dependencies = [ "cranelift-codegen", "log", @@ -411,7 +411,7 @@ dependencies = [ [[package]] name = "cranelift-module" -version = "0.66.0" +version = "0.67.0" dependencies = [ "anyhow", "cranelift-codegen", @@ -422,7 +422,7 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.66.0" +version = "0.67.0" dependencies = [ "cranelift-codegen", "raw-cpuid 7.0.3", @@ -431,7 +431,7 @@ dependencies = [ [[package]] name = "cranelift-object" -version = "0.66.0" +version = "0.67.0" dependencies = [ "anyhow", "cranelift-codegen", @@ -442,7 +442,7 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.66.0" +version = "0.67.0" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1145,6 +1145,7 @@ dependencies = [ "nix", "rand 0.6.5", "tempfile", + "tracing", "tracing-subscriber", "wasi-common", ] @@ -2221,9 +2222,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" +checksum = "fe2635952a442a01fd4cb53d98858b5e4bb461b02c0d111f22f31772e3e7a8b2" [[package]] name = "tempfile" @@ -2328,9 +2329,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.15" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41f40ed0e162c911ac6fcb53ecdc8134c46905fdbbae8c50add462a538b495f" +checksum = "6d79ca061b032d6ce30c660fded31189ca0b9922bf483cd70759f13a2d86786c" dependencies = [ "cfg-if", "log", @@ -2340,9 +2341,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99bbad0de3fd923c9c3232ead88510b783e5a4d16a6154adffa3d53308de984c" +checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada" dependencies = [ "proc-macro2 1.0.13", "quote 1.0.6", @@ -2351,9 +2352,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.10" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa83a9a47081cd522c09c81b31aec2c9273424976f922ad61c053b58350b715" +checksum = "5bcf46c1f1f06aeea2d6b81f3c863d0930a596c86ad1920d4e5bad6dd1d7119a" dependencies = [ "lazy_static", ] @@ -2534,7 +2535,7 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasi-common" -version = "0.19.1" +version = "0.20.0" dependencies = [ "anyhow", "cfg-if", @@ -2639,7 +2640,7 @@ dependencies = [ [[package]] name = "wig" -version = "0.19.0" +version = "0.20.0" dependencies = [ "heck", "proc-macro2 1.0.13", @@ -2649,7 +2650,7 @@ dependencies = [ [[package]] name = "wiggle" -version = "0.19.0" +version = "0.20.0" dependencies = [ "thiserror", "tracing", @@ -2659,7 +2660,7 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "0.19.0" +version = "0.20.0" dependencies = [ "anyhow", "heck", @@ -2672,7 +2673,7 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "0.19.0" +version = "0.20.0" dependencies = [ "quote 1.0.6", "syn 1.0.22", @@ -2733,7 +2734,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winx" -version = "0.19.0" +version = "0.20.0" dependencies = [ "bitflags 1.2.1", "cvt", @@ -2758,7 +2759,7 @@ checksum = "da90eac47bf1d7871b75004b9b631d107df15f37669383b23f0b5297bc7516b6" [[package]] name = "yanix" -version = "0.19.0" +version = "0.20.0" dependencies = [ "bitflags 1.2.1", "cfg-if", diff --git a/lucet-module/Cargo.toml b/lucet-module/Cargo.toml index dde5c44ee..16274215f 100644 --- a/lucet-module/Cargo.toml +++ b/lucet-module/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" [dependencies] anyhow = "1.0" -cranelift-entity = { path = "../wasmtime/cranelift/entity", version = "0.66.0" } +cranelift-entity = { path = "../wasmtime/cranelift/entity", version = "0.67.0" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" bincode = "1.1.4" diff --git a/lucet-spectest/Cargo.toml b/lucet-spectest/Cargo.toml index 189325dc1..4969738d0 100644 --- a/lucet-spectest/Cargo.toml +++ b/lucet-spectest/Cargo.toml @@ -25,5 +25,5 @@ serde = "1.0" serde_json = "1.0" clap="2.32" tempfile = "3.0" -target-lexicon = "0.10" +target-lexicon = "0.11" thiserror = "1.0.4" diff --git a/lucet-wasi-sdk/Cargo.toml b/lucet-wasi-sdk/Cargo.toml index e3d7d91f4..569f78db5 100644 --- a/lucet-wasi-sdk/Cargo.toml +++ b/lucet-wasi-sdk/Cargo.toml @@ -19,4 +19,4 @@ thiserror = "1.0.4" anyhow = "1" lucetc = { path = "../lucetc", version = "=0.7.0-dev" } lucet-wasi = { path = "../lucet-wasi", version = "=0.7.0-dev" } -target-lexicon = "0.10" +target-lexicon = "0.11" diff --git a/lucet-wasi/Cargo.toml b/lucet-wasi/Cargo.toml index 65aa815b5..1df325f70 100644 --- a/lucet-wasi/Cargo.toml +++ b/lucet-wasi/Cargo.toml @@ -22,7 +22,8 @@ lucet-wiggle = { path = "../lucet-wiggle", version = "=0.7.0-dev" } libc = "0.2.65" nix = "0.17" rand = "0.6" -wasi-common = { path = "../wasmtime/crates/wasi-common", version = "0.19.0", default-features = false, features = ["wiggle_metadata"] } +wasi-common = { path = "../wasmtime/crates/wasi-common", version = "0.20.0", default-features = false, features = ["wiggle_metadata"] } +tracing = "0.1.19" tracing-subscriber = "0.2.0" [dev-dependencies] diff --git a/lucet-wasi/generate/Cargo.toml b/lucet-wasi/generate/Cargo.toml index 85bf7fd12..cb2a3cd7a 100644 --- a/lucet-wasi/generate/Cargo.toml +++ b/lucet-wasi/generate/Cargo.toml @@ -13,8 +13,8 @@ proc-macro = true [dependencies] lucet-wiggle = { path = "../../lucet-wiggle", version = "0.7.0-dev" } -wasi-common = { path = "../../wasmtime/crates/wasi-common", version = "0.19.0", features = ["wiggle_metadata"] } -wiggle-generate = { path = "../../wasmtime/crates/wiggle/generate", version = "0.19.0" } +wasi-common = { path = "../../wasmtime/crates/wasi-common", version = "0.20.0", features = ["wiggle_metadata"] } +wiggle-generate = { path = "../../wasmtime/crates/wiggle/generate", version = "0.20.0" } syn = { version = "1.0", features = ["full"] } quote = "1.0" proc-macro2 = "1.0" diff --git a/lucet-wasi/generate/src/config.rs b/lucet-wasi/generate/src/config.rs index e362d17ba..3b522a2d8 100644 --- a/lucet-wasi/generate/src/config.rs +++ b/lucet-wasi/generate/src/config.rs @@ -5,11 +5,13 @@ use syn::{ punctuated::Punctuated, Error, Ident, Result, Token, }; +use wiggle_generate::config::ErrorConf; #[derive(Debug, Clone)] pub struct Config { pub ctx_name: Ident, pub constructor: TokenStream, + pub error_conf: Option, pub pre_hook: Option, pub post_hook: Option, } @@ -20,12 +22,14 @@ pub enum ConfigField { Constructor(TokenStream), PreHook(TokenStream), PostHook(TokenStream), + Error(ErrorConf), } mod kw { syn::custom_keyword!(ctx); syn::custom_keyword!(constructor); syn::custom_keyword!(pre_hook); syn::custom_keyword!(post_hook); + syn::custom_keyword!(errors); } impl Parse for ConfigField { @@ -53,6 +57,10 @@ impl Parse for ConfigField { let contents; let _lbrace = braced!(contents in input); Ok(ConfigField::PostHook(contents.parse()?)) + } else if lookahead.peek(kw::errors) { + input.parse::()?; + input.parse::()?; + Ok(ConfigField::Error(input.parse()?)) } else { Err(lookahead.error()) } @@ -65,6 +73,7 @@ impl Config { let mut constructor = None; let mut pre_hook = None; let mut post_hook = None; + let mut error_conf = None; for f in fields { match f { ConfigField::Constructor(c) => { @@ -79,6 +88,9 @@ impl Config { ConfigField::PostHook(c) => { post_hook = Some(c); } + ConfigField::Error(c) => { + error_conf = Some(c); + } } } Ok(Config { @@ -88,6 +100,7 @@ impl Config { constructor: constructor .take() .ok_or_else(|| Error::new(err_loc, "`constructor` field required"))?, + error_conf: error_conf.take(), pre_hook, post_hook, }) diff --git a/lucet-wasi/generate/src/lib.rs b/lucet-wasi/generate/src/lib.rs index f767ca14d..b560a8b5d 100644 --- a/lucet-wasi/generate/src/lib.rs +++ b/lucet-wasi/generate/src/lib.rs @@ -12,7 +12,12 @@ pub fn bindings(args: TokenStream) -> TokenStream { let doc = wasi_common::wasi::metadata::document(); let names = Names::new(&config.ctx_name, quote!(lucet_wiggle)); - let error_transform = wiggle_generate::ErrorTransform::empty(); + let error_transform = if let Some(error_conf) = config.error_conf { + wiggle_generate::ErrorTransform::new(&error_conf, &doc) + .expect("constructing error transform") + } else { + wiggle_generate::ErrorTransform::empty() + }; let modules = doc.modules().map(|module| { let modname = names.module(&module.name); diff --git a/lucet-wasi/src/runtime.rs b/lucet-wasi/src/runtime.rs index d1643212e..dc0a3b06a 100644 --- a/lucet-wasi/src/runtime.rs +++ b/lucet-wasi/src/runtime.rs @@ -1,7 +1,9 @@ use lucet_runtime::{lucet_hostcall_terminate, vmctx::Vmctx}; use lucet_wiggle::{GuestError, GuestPtr}; use std::cell::Ref; +use tracing::debug; use wasi_common::wasi::wasi_snapshot_preview1::WasiSnapshotPreview1; +use wasi_common::Error; use wasi_common::WasiCtx; lucet_wasi_generate::bindings!({ @@ -11,7 +13,9 @@ lucet_wasi_generate::bindings!({ // Describe how to construct the context type. The expression inside the first set // of braces will be used each time LucetWasiCtx needs to be constructed. // `vmctx: &Vmctx` is a free variable at the construction site. - constructor: { LucetWasiCtx { vmctx } } + constructor: { LucetWasiCtx { vmctx } }, + // Need to use the exact same error mapping as wasi-common does: + errors: { errno => Error }, }); pub mod types { @@ -33,9 +37,16 @@ impl<'a> LucetWasiCtx<'a> { } impl<'a> types::GuestErrorConversion for LucetWasiCtx<'a> { - fn into_errno(&self, _e: GuestError) -> types::Errno { - // TODO log error - types::Errno::Inval + fn into_errno(&self, e: GuestError) -> types::Errno { + debug!("Guest error: {:?}", e); + e.into() + } +} + +impl<'a> types::UserErrorConversion for LucetWasiCtx<'a> { + fn errno_from_error(&self, e: Error) -> types::Errno { + debug!("Error: {:?}", e); + e.into() } } @@ -44,11 +55,11 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { &self, argv: &GuestPtr<'b, GuestPtr<'b, u8>>, argv_buf: &GuestPtr<'b, u8>, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi().args_get(argv, argv_buf) } - fn args_sizes_get(&self) -> Result<(types::Size, types::Size), types::Errno> { + fn args_sizes_get(&self) -> Result<(types::Size, types::Size), Error> { self.wasi().args_sizes_get() } @@ -56,15 +67,15 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { &self, environ: &GuestPtr<'b, GuestPtr<'b, u8>>, environ_buf: &GuestPtr<'b, u8>, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi().environ_get(environ, environ_buf) } - fn environ_sizes_get(&self) -> Result<(types::Size, types::Size), types::Errno> { + fn environ_sizes_get(&self) -> Result<(types::Size, types::Size), Error> { self.wasi().environ_sizes_get() } - fn clock_res_get(&self, id: types::Clockid) -> Result { + fn clock_res_get(&self, id: types::Clockid) -> Result { self.wasi().clock_res_get(id) } @@ -72,7 +83,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { &self, id: types::Clockid, precision: types::Timestamp, - ) -> Result { + ) -> Result { self.wasi().clock_time_get(id, precision) } @@ -82,7 +93,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { offset: types::Filesize, len: types::Filesize, advice: types::Advice, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi().fd_advise(fd, offset, len, advice) } @@ -91,27 +102,23 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { fd: types::Fd, offset: types::Filesize, len: types::Filesize, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi().fd_allocate(fd, offset, len) } - fn fd_close(&self, fd: types::Fd) -> Result<(), types::Errno> { + fn fd_close(&self, fd: types::Fd) -> Result<(), Error> { self.wasi().fd_close(fd) } - fn fd_datasync(&self, fd: types::Fd) -> Result<(), types::Errno> { + fn fd_datasync(&self, fd: types::Fd) -> Result<(), Error> { self.wasi().fd_datasync(fd) } - fn fd_fdstat_get(&self, fd: types::Fd) -> Result { + fn fd_fdstat_get(&self, fd: types::Fd) -> Result { self.wasi().fd_fdstat_get(fd) } - fn fd_fdstat_set_flags( - &self, - fd: types::Fd, - flags: types::Fdflags, - ) -> Result<(), types::Errno> { + fn fd_fdstat_set_flags(&self, fd: types::Fd, flags: types::Fdflags) -> Result<(), Error> { self.wasi().fd_fdstat_set_flags(fd, flags) } @@ -120,20 +127,16 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { fd: types::Fd, fs_rights_base: types::Rights, fs_rights_inheriting: types::Rights, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi() .fd_fdstat_set_rights(fd, fs_rights_base, fs_rights_inheriting) } - fn fd_filestat_get(&self, fd: types::Fd) -> Result { + fn fd_filestat_get(&self, fd: types::Fd) -> Result { self.wasi().fd_filestat_get(fd) } - fn fd_filestat_set_size( - &self, - fd: types::Fd, - size: types::Filesize, - ) -> Result<(), types::Errno> { + fn fd_filestat_set_size(&self, fd: types::Fd, size: types::Filesize) -> Result<(), Error> { self.wasi().fd_filestat_set_size(fd, size) } @@ -143,7 +146,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { atim: types::Timestamp, mtim: types::Timestamp, fst_flags: types::Fstflags, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi().fd_filestat_set_times(fd, atim, mtim, fst_flags) } @@ -152,11 +155,11 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { fd: types::Fd, iovs: &types::IovecArray<'_>, offset: types::Filesize, - ) -> Result { + ) -> Result { self.wasi().fd_pread(fd, iovs, offset) } - fn fd_prestat_get(&self, fd: types::Fd) -> Result { + fn fd_prestat_get(&self, fd: types::Fd) -> Result { self.wasi().fd_prestat_get(fd) } @@ -165,7 +168,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { fd: types::Fd, path: &GuestPtr, path_len: types::Size, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi().fd_prestat_dir_name(fd, path, path_len) } @@ -174,15 +177,11 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { fd: types::Fd, ciovs: &types::CiovecArray<'_>, offset: types::Filesize, - ) -> Result { + ) -> Result { self.wasi().fd_pwrite(fd, ciovs, offset) } - fn fd_read( - &self, - fd: types::Fd, - iovs: &types::IovecArray<'_>, - ) -> Result { + fn fd_read(&self, fd: types::Fd, iovs: &types::IovecArray<'_>) -> Result { self.wasi().fd_read(fd, iovs) } @@ -192,11 +191,11 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { buf: &GuestPtr, buf_len: types::Size, cookie: types::Dircookie, - ) -> Result { + ) -> Result { self.wasi().fd_readdir(fd, buf, buf_len, cookie) } - fn fd_renumber(&self, from: types::Fd, to: types::Fd) -> Result<(), types::Errno> { + fn fd_renumber(&self, from: types::Fd, to: types::Fd) -> Result<(), Error> { self.wasi().fd_renumber(from, to) } @@ -205,15 +204,15 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { fd: types::Fd, offset: types::Filedelta, whence: types::Whence, - ) -> Result { + ) -> Result { self.wasi().fd_seek(fd, offset, whence) } - fn fd_sync(&self, fd: types::Fd) -> Result<(), types::Errno> { + fn fd_sync(&self, fd: types::Fd) -> Result<(), Error> { self.wasi().fd_sync(fd) } - fn fd_tell(&self, fd: types::Fd) -> Result { + fn fd_tell(&self, fd: types::Fd) -> Result { self.wasi().fd_tell(fd) } @@ -221,7 +220,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { &self, fd: types::Fd, ciovs: &types::CiovecArray<'_>, - ) -> Result { + ) -> Result { self.wasi().fd_write(fd, ciovs) } @@ -229,7 +228,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { &self, dirfd: types::Fd, path: &GuestPtr<'_, str>, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi().path_create_directory(dirfd, path) } @@ -238,7 +237,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { dirfd: types::Fd, flags: types::Lookupflags, path: &GuestPtr<'_, str>, - ) -> Result { + ) -> Result { self.wasi().path_filestat_get(dirfd, flags, path) } @@ -250,7 +249,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { atim: types::Timestamp, mtim: types::Timestamp, fst_flags: types::Fstflags, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi() .path_filestat_set_times(dirfd, flags, path, atim, mtim, fst_flags) } @@ -262,7 +261,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { old_path: &GuestPtr<'_, str>, new_fd: types::Fd, new_path: &GuestPtr<'_, str>, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi() .path_link(old_fd, old_flags, old_path, new_fd, new_path) } @@ -276,7 +275,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { fs_rights_base: types::Rights, fs_rights_inheriting: types::Rights, fdflags: types::Fdflags, - ) -> Result { + ) -> Result { self.wasi().path_open( dirfd, dirflags, @@ -294,7 +293,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { path: &GuestPtr<'_, str>, buf: &GuestPtr, buf_len: types::Size, - ) -> Result { + ) -> Result { self.wasi().path_readlink(dirfd, path, buf, buf_len) } @@ -302,7 +301,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { &self, dirfd: types::Fd, path: &GuestPtr<'_, str>, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi().path_remove_directory(dirfd, path) } @@ -312,7 +311,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { old_path: &GuestPtr<'_, str>, new_fd: types::Fd, new_path: &GuestPtr<'_, str>, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi().path_rename(old_fd, old_path, new_fd, new_path) } @@ -321,15 +320,11 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { old_path: &GuestPtr<'_, str>, dirfd: types::Fd, new_path: &GuestPtr<'_, str>, - ) -> Result<(), types::Errno> { + ) -> Result<(), Error> { self.wasi().path_symlink(old_path, dirfd, new_path) } - fn path_unlink_file( - &self, - dirfd: types::Fd, - path: &GuestPtr<'_, str>, - ) -> Result<(), types::Errno> { + fn path_unlink_file(&self, dirfd: types::Fd, path: &GuestPtr<'_, str>) -> Result<(), Error> { self.wasi().path_unlink_file(dirfd, path) } @@ -338,7 +333,7 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { in_: &GuestPtr, out: &GuestPtr, nsubscriptions: types::Size, - ) -> Result { + ) -> Result { self.wasi().poll_oneoff(in_, out, nsubscriptions) } @@ -346,15 +341,15 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { lucet_hostcall_terminate!(rval) } - fn proc_raise(&self, _sig: types::Signal) -> Result<(), types::Errno> { - Err(types::Errno::Inval) + fn proc_raise(&self, _sig: types::Signal) -> Result<(), Error> { + Err(Error::Inval) } - fn sched_yield(&self) -> Result<(), types::Errno> { + fn sched_yield(&self) -> Result<(), Error> { Ok(()) } - fn random_get(&self, buf: &GuestPtr, buf_len: types::Size) -> Result<(), types::Errno> { + fn random_get(&self, buf: &GuestPtr, buf_len: types::Size) -> Result<(), Error> { self.wasi().random_get(buf, buf_len) } @@ -363,8 +358,8 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { _fd: types::Fd, _ri_data: &types::IovecArray<'_>, _ri_flags: types::Riflags, - ) -> Result<(types::Size, types::Roflags), types::Errno> { - Err(types::Errno::Inval) + ) -> Result<(types::Size, types::Roflags), Error> { + Err(Error::Inval) } fn sock_send( @@ -372,11 +367,11 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for LucetWasiCtx<'a> { _fd: types::Fd, _si_data: &types::CiovecArray<'_>, _si_flags: types::Siflags, - ) -> Result { - Err(types::Errno::Inval) + ) -> Result { + Err(Error::Inval) } - fn sock_shutdown(&self, _fd: types::Fd, _how: types::Sdflags) -> Result<(), types::Errno> { - Err(types::Errno::Inval) + fn sock_shutdown(&self, _fd: types::Fd, _how: types::Sdflags) -> Result<(), Error> { + Err(Error::Inval) } } diff --git a/lucet-wiggle/Cargo.toml b/lucet-wiggle/Cargo.toml index cb2a4c385..67c825cca 100644 --- a/lucet-wiggle/Cargo.toml +++ b/lucet-wiggle/Cargo.toml @@ -14,7 +14,7 @@ edition = "2018" lucet-wiggle-macro = { path = "./macro", version = "0.7.0-dev" } lucet-wiggle-generate = { path = "./generate", version = "0.7.0-dev" } lucet-runtime = { path = "../lucet-runtime", version = "0.7.0-dev" } -wiggle = { path = "../wasmtime/crates/wiggle", version = "0.19.0" } +wiggle = { path = "../wasmtime/crates/wiggle", version = "0.20.0" } [dev-dependencies] wiggle-test = { path = "../wasmtime/crates/wiggle/test-helpers" } diff --git a/lucet-wiggle/generate/Cargo.toml b/lucet-wiggle/generate/Cargo.toml index c16782486..53671bf77 100644 --- a/lucet-wiggle/generate/Cargo.toml +++ b/lucet-wiggle/generate/Cargo.toml @@ -9,7 +9,7 @@ authors = ["Lucet team "] edition = "2018" [dependencies] -wiggle-generate = { path = "../../wasmtime/crates/wiggle/generate", version = "0.19.0" } +wiggle-generate = { path = "../../wasmtime/crates/wiggle/generate", version = "0.20.0" } lucet-module = { path = "../../lucet-module", version = "0.7.0-dev" } witx = { path = "../../wasmtime/crates/wasi-common/WASI/tools/witx", version = "0.8.4" } quote = "1.0" diff --git a/lucet-wiggle/macro/Cargo.toml b/lucet-wiggle/macro/Cargo.toml index 604d3f71e..e7c124414 100644 --- a/lucet-wiggle/macro/Cargo.toml +++ b/lucet-wiggle/macro/Cargo.toml @@ -13,7 +13,7 @@ proc-macro = true [dependencies] lucet-wiggle-generate = { path = "../generate", version = "0.7.0-dev" } -wiggle-generate = { path = "../../wasmtime/crates/wiggle/generate", version = "0.19.0" } +wiggle-generate = { path = "../../wasmtime/crates/wiggle/generate", version = "0.20.0" } witx = { path = "../../wasmtime/crates/wasi-common/WASI/tools/witx", version = "0.8.4" } syn = { version = "1.0", features = ["full"] } quote = "1.0" diff --git a/lucetc/Cargo.toml b/lucetc/Cargo.toml index 2dc57db62..316658998 100644 --- a/lucetc/Cargo.toml +++ b/lucetc/Cargo.toml @@ -16,14 +16,14 @@ path = "lucetc/main.rs" [dependencies] anyhow = "1" bincode = "1.1.4" -cranelift-codegen = { path = "../wasmtime/cranelift/codegen", version = "0.66.0" } -cranelift-entity = { path = "../wasmtime/cranelift/entity", version = "0.66.0" } -cranelift-native = { path = "../wasmtime/cranelift/native", version = "0.66.0" } -cranelift-frontend = { path = "../wasmtime/cranelift/frontend", version = "0.66.0" } -cranelift-module = { path = "../wasmtime/cranelift/module", version = "0.66.0" } -cranelift-object = { path = "../wasmtime/cranelift/object", version = "0.66.0" } -cranelift-wasm = { path = "../wasmtime/cranelift/wasm", version = "0.66.0" } -target-lexicon = "0.10" +cranelift-codegen = { path = "../wasmtime/cranelift/codegen", version = "0.67.0" } +cranelift-entity = { path = "../wasmtime/cranelift/entity", version = "0.67.0" } +cranelift-native = { path = "../wasmtime/cranelift/native", version = "0.67.0" } +cranelift-frontend = { path = "../wasmtime/cranelift/frontend", version = "0.67.0" } +cranelift-module = { path = "../wasmtime/cranelift/module", version = "0.67.0" } +cranelift-object = { path = "../wasmtime/cranelift/object", version = "0.67.0" } +cranelift-wasm = { path = "../wasmtime/cranelift/wasm", version = "0.67.0" } +target-lexicon = "0.11" lucet-module = { path = "../lucet-module", version = "=0.7.0-dev" } lucet-wiggle-generate = { path = "../lucet-wiggle/generate", version = "=0.7.0-dev" } witx = { path = "../wasmtime/crates/wasi-common/WASI/tools/witx", version = "0.8.5" } diff --git a/wasmtime b/wasmtime index c9ec60dcc..5e08eb3b8 160000 --- a/wasmtime +++ b/wasmtime @@ -1 +1 @@ -Subproject commit c9ec60dcced9b9dabc466c8019ed38ecfccca31a +Subproject commit 5e08eb3b83d78cac545db91f6c6fa65a45a679ab