diff --git a/lib/wasi/src/state/capabilities.rs b/lib/wasi/src/capabilities.rs similarity index 100% rename from lib/wasi/src/state/capabilities.rs rename to lib/wasi/src/capabilities.rs diff --git a/lib/wasi/src/http/client_impl.rs b/lib/wasi/src/http/client_impl.rs index 078cdae6acd..6457c44968c 100644 --- a/lib/wasi/src/http/client_impl.rs +++ b/lib/wasi/src/http/client_impl.rs @@ -2,7 +2,7 @@ use std::string::FromUtf8Error; use std::sync::Arc; use crate::bindings::wasix_http_client_v1 as sys; -use crate::{Capabilities, WasiRuntime}; +use crate::{capabilities::Capabilities, WasiRuntime}; use crate::{ http::{DynHttpClient, HttpClientCapabilityV1}, diff --git a/lib/wasi/src/lib.rs b/lib/wasi/src/lib.rs index 927a0f24a6b..bb23dc35660 100644 --- a/lib/wasi/src/lib.rs +++ b/lib/wasi/src/lib.rs @@ -47,6 +47,8 @@ mod syscalls; mod utils; pub mod wapm; +pub mod capabilities; + /// WAI based bindings. mod bindings; @@ -106,7 +108,7 @@ pub use crate::utils::is_wasix_module; pub use crate::{ state::{ - Capabilities, WasiEnv, WasiEnvBuilder, WasiEnvInit, WasiFunctionEnv, WasiInstanceHandles, + WasiEnv, WasiEnvBuilder, WasiEnvInit, WasiFunctionEnv, WasiInstanceHandles, WasiStateCreationError, ALL_RIGHTS, }, syscalls::types, diff --git a/lib/wasi/src/os/console/mod.rs b/lib/wasi/src/os/console/mod.rs index 57fa7e7a51b..094b2d9fe83 100644 --- a/lib/wasi/src/os/console/mod.rs +++ b/lib/wasi/src/os/console/mod.rs @@ -27,8 +27,8 @@ use wasmer_wasi_types::{types::__WASI_STDIN_FILENO, wasi::BusErrno}; use super::{cconst::ConsoleConst, common::*, task::TaskJoinHandle}; use crate::{ bin_factory::{spawn_exec, BinFactory, ModuleCache}, + capabilities::Capabilities, os::task::{control_plane::WasiControlPlane, process::WasiProcess}, - state::Capabilities, VirtualBusError, VirtualTaskManagerExt, WasiEnv, WasiRuntime, }; diff --git a/lib/wasi/src/runners/wcgi/handler.rs b/lib/wasi/src/runners/wcgi/handler.rs index 06a8a5460cc..aa5bd5d47dd 100644 --- a/lib/wasi/src/runners/wcgi/handler.rs +++ b/lib/wasi/src/runners/wcgi/handler.rs @@ -20,9 +20,10 @@ use wasmer_vfs::{FileSystem, PassthruFileSystem, RootFileSystemBuilder, TmpFileS use wcgi_host::CgiDialect; use crate::{ + capabilities::Capabilities, http::HttpClientCapabilityV1, runners::wcgi::{Callbacks, MappedDirectory}, - Capabilities, Pipe, PluggableRuntimeImplementation, VirtualTaskManager, WasiEnv, + Pipe, PluggableRuntimeImplementation, VirtualTaskManager, WasiEnv, }; /// The shared object that manages the instantiaion of WASI executables and diff --git a/lib/wasi/src/state/builder.rs b/lib/wasi/src/state/builder.rs index 2a05886557a..fb86ecc7f15 100644 --- a/lib/wasi/src/state/builder.rs +++ b/lib/wasi/src/state/builder.rs @@ -13,12 +13,12 @@ use wasmer_vfs::{ArcFile, FsError, TmpFileSystem, VirtualFile}; use crate::{ bin_factory::{BinFactory, ModuleCache}, + capabilities::Capabilities, fs::{WasiFs, WasiFsRoot, WasiInodes}, os::task::control_plane::{ControlPlaneConfig, ControlPlaneError, WasiControlPlane}, state::WasiState, syscalls::types::{__WASI_STDERR_FILENO, __WASI_STDIN_FILENO, __WASI_STDOUT_FILENO}, - Capabilities, PluggableRuntimeImplementation, WasiEnv, WasiFunctionEnv, WasiRuntime, - WasiRuntimeError, + PluggableRuntimeImplementation, WasiEnv, WasiFunctionEnv, WasiRuntime, WasiRuntimeError, }; use super::env::WasiEnvInit; diff --git a/lib/wasi/src/state/env.rs b/lib/wasi/src/state/env.rs index d39873f4775..83830d55a47 100644 --- a/lib/wasi/src/state/env.rs +++ b/lib/wasi/src/state/env.rs @@ -18,6 +18,7 @@ use wasmer_wasi_types::{ use crate::{ bin_factory::{BinFactory, ModuleCache}, + capabilities::Capabilities, fs::{WasiFsRoot, WasiInodes}, import_object_for_all_wasi_versions, os::{ @@ -35,7 +36,7 @@ use crate::{ DEFAULT_STACK_SIZE, }; -use super::{Capabilities, WasiState}; +use super::WasiState; /// Various [`TypedFunction`] and [`Global`] handles for an active WASI(X) instance. /// diff --git a/lib/wasi/src/state/mod.rs b/lib/wasi/src/state/mod.rs index 0fca7b274ea..ef3316eb839 100644 --- a/lib/wasi/src/state/mod.rs +++ b/lib/wasi/src/state/mod.rs @@ -16,7 +16,6 @@ #![allow(clippy::cognitive_complexity, clippy::too_many_arguments)] mod builder; -mod capabilities; mod env; mod func_env; mod types; @@ -39,7 +38,6 @@ use wasmer_wasi_types::wasi::{Errno, Fd as WasiFd, Rights, Snapshot0Clockid}; pub use self::{ builder::*, - capabilities::Capabilities, env::{WasiEnv, WasiEnvInit, WasiInstanceHandles}, func_env::WasiFunctionEnv, types::*,