diff --git a/Cargo.toml b/Cargo.toml index fb9524391..fef70dfed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ glob = "0.2.11" [features] default = ["fast-tests"] -vfs = ["wasmer-runtime-abi", "wasmer-runtime-core/vfs", "wasmer-emscripten/vfs", "wasmer-clif-backend/vfs", "wasmer-llvm-backend/vfs"] +vfs = ["wasmer-runtime-abi", "wasmer-emscripten/vfs"] debug = ["wasmer-clif-backend/debug", "wasmer-runtime-core/debug"] # This feature will allow cargo test to run much faster fast-tests = [] diff --git a/lib/clif-backend/Cargo.toml b/lib/clif-backend/Cargo.toml index 5e68f96af..1f08b8b1e 100644 --- a/lib/clif-backend/Cargo.toml +++ b/lib/clif-backend/Cargo.toml @@ -37,4 +37,3 @@ wasmer-win-exception-handler = { path = "../win-exception-handler", version = "0 [features] debug = ["wasmer-runtime-core/debug"] -vfs = ["wasmer-runtime-core/vfs"] diff --git a/lib/clif-backend/src/module.rs b/lib/clif-backend/src/module.rs index a0929e03b..521f41cef 100644 --- a/lib/clif-backend/src/module.rs +++ b/lib/clif-backend/src/module.rs @@ -51,7 +51,6 @@ impl Module { namespace_table: StringTable::new(), name_table: StringTable::new(), - #[cfg(feature = "vfs")] custom_sections: HashMap::new(), }, } diff --git a/lib/emscripten/Cargo.toml b/lib/emscripten/Cargo.toml index 3506e564f..43831fa8a 100644 --- a/lib/emscripten/Cargo.toml +++ b/lib/emscripten/Cargo.toml @@ -32,4 +32,4 @@ glob = "0.2.11" [features] clif = [] llvm = [] -vfs = ["wasmer-runtime-core/vfs", "wasmer-clif-backend/vfs", "wasmer-llvm-backend/vfs", "wasmer-runtime-abi"] +vfs = ["wasmer-runtime-abi"] diff --git a/lib/llvm-backend/Cargo.toml b/lib/llvm-backend/Cargo.toml index f4ff1dc96..1b3edbb7e 100644 --- a/lib/llvm-backend/Cargo.toml +++ b/lib/llvm-backend/Cargo.toml @@ -28,4 +28,3 @@ wabt = "0.7.4" [features] debug = ["wasmer-runtime-core/debug"] disasm = ["capstone"] -vfs = ["wasmer-runtime-core/vfs"] diff --git a/lib/llvm-backend/src/read_info.rs b/lib/llvm-backend/src/read_info.rs index 0324fb9c3..596e06b52 100644 --- a/lib/llvm-backend/src/read_info.rs +++ b/lib/llvm-backend/src/read_info.rs @@ -18,7 +18,6 @@ use wasmparser::{ SectionCode, Type as WpType, }; -#[cfg(feature = "vfs")] use hashbrown::HashMap; pub fn read_module(wasm: &[u8]) -> Result<(ModuleInfo, CodeSectionReader), BinaryReaderError> { @@ -46,7 +45,6 @@ pub fn read_module(wasm: &[u8]) -> Result<(ModuleInfo, CodeSectionReader), Binar namespace_table: StringTable::new(), name_table: StringTable::new(), - #[cfg(feature = "vfs")] custom_sections: HashMap::new(), }; diff --git a/lib/runtime-abi/Cargo.toml b/lib/runtime-abi/Cargo.toml index 6737d167f..8b8f03620 100644 --- a/lib/runtime-abi/Cargo.toml +++ b/lib/runtime-abi/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/wasmerio/wasmer" edition = "2018" [dependencies] -wasmer-runtime-core = { path = "../runtime-core", features = ["vfs"] } +wasmer-runtime-core = { path = "../runtime-core" } hashbrown = "0.1" failure = "0.1" tar = "0.4" diff --git a/lib/runtime-core/Cargo.toml b/lib/runtime-core/Cargo.toml index 6ba8c0e56..e186e26e5 100644 --- a/lib/runtime-core/Cargo.toml +++ b/lib/runtime-core/Cargo.toml @@ -45,4 +45,3 @@ field-offset = "0.1.1" [features] debug = [] -vfs = [] diff --git a/lib/runtime-core/src/error.rs b/lib/runtime-core/src/error.rs index 63297554f..46fae102e 100644 --- a/lib/runtime-core/src/error.rs +++ b/lib/runtime-core/src/error.rs @@ -8,7 +8,6 @@ pub type LinkResult = std::result::Result>; pub type RuntimeResult = std::result::Result; pub type CallResult = std::result::Result; pub type ResolveResult = std::result::Result; -#[cfg(feature = "vfs")] pub type ParseResult = std::result::Result; /// This is returned when the chosen compiler is unable to @@ -448,13 +447,11 @@ impl Into for MemoryProtectionError { } } -#[cfg(feature = "vfs")] #[derive(Debug)] pub enum ParseError { BinaryReadError, } -#[cfg(feature = "vfs")] impl From for ParseError { fn from(_: wasmparser::BinaryReaderError) -> Self { ParseError::BinaryReadError diff --git a/lib/runtime-core/src/lib.rs b/lib/runtime-core/src/lib.rs index 83b9e110b..c780dfd87 100644 --- a/lib/runtime-core/src/lib.rs +++ b/lib/runtime-core/src/lib.rs @@ -67,14 +67,9 @@ pub fn compile_with( compiler: &dyn backend::Compiler, ) -> CompileResult { let token = backend::Token::generate(); - compiler.compile(wasm, token).map(|inner| { - #[cfg(feature = "vfs")] - let inner = { - let mut inner = inner; - let inner_info: &mut crate::module::ModuleInfo = &mut inner.info; - inner_info.import_custom_sections(wasm).unwrap(); - inner - }; + compiler.compile(wasm, token).map(|mut inner| { + let inner_info: &mut crate::module::ModuleInfo = &mut inner.info; + inner_info.import_custom_sections(wasm).unwrap(); module::Module::new(Arc::new(inner)) }) } diff --git a/lib/runtime-core/src/module.rs b/lib/runtime-core/src/module.rs index 5bf2df172..04a8b3b9a 100644 --- a/lib/runtime-core/src/module.rs +++ b/lib/runtime-core/src/module.rs @@ -57,12 +57,10 @@ pub struct ModuleInfo { pub namespace_table: StringTable, pub name_table: StringTable, - #[cfg(feature = "vfs")] pub custom_sections: HashMap>, } impl ModuleInfo { - #[cfg(feature = "vfs")] pub fn import_custom_sections(&mut self, wasm: &[u8]) -> crate::error::ParseResult<()> { let mut parser = wasmparser::ModuleReader::new(wasm)?; while !parser.eof() { diff --git a/lib/runtime-core/src/vm.rs b/lib/runtime-core/src/vm.rs index 4e4d697ea..08f6c270f 100644 --- a/lib/runtime-core/src/vm.rs +++ b/lib/runtime-core/src/vm.rs @@ -592,7 +592,6 @@ mod vm_ctx_tests { namespace_table: StringTable::new(), name_table: StringTable::new(), - #[cfg(feature = "vfs")] custom_sections: HashMap::new(), }, }