diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1bf625b589..f24170844a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -321,10 +321,6 @@ jobs: env: RUST_BACKTRACE: 1 - # Test the component-model related functionality which is gated behind a - # compile-time feature - - run: cargo test --test all --features component-model component_model - # Build and test the wasi-nn module. test_wasi_nn: name: Test wasi-nn module diff --git a/Cargo.toml b/Cargo.toml index d7effe372d..e50cd24b43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ rustix = { version = "0.35.6", features = ["mm", "param"] } [dev-dependencies] # depend again on wasmtime to activate its default features for tests -wasmtime = { path = "crates/wasmtime", version = "0.40.0" } +wasmtime = { path = "crates/wasmtime", version = "0.40.0", features = ['component-model'] } env_logger = "0.9.0" filecheck = "0.5.0" tempfile = "3.1.0" diff --git a/crates/runtime/src/component.rs b/crates/runtime/src/component.rs index a8cf3309de..58f0f85006 100644 --- a/crates/runtime/src/component.rs +++ b/crates/runtime/src/component.rs @@ -617,19 +617,3 @@ impl InstanceFlags { self.0 } } - -#[cfg(test)] -mod tests { - use super::*; - use std::mem::size_of; - - #[test] - fn size_of_vmcomponent_flags() { - let component = Component::default(); - let offsets = VMComponentOffsets::new(size_of::<*mut u8>() as u8, &component); - assert_eq!( - size_of::(), - usize::from(offsets.size_of_vmcomponent_flags()) - ); - } -} diff --git a/crates/wasmtime/src/component/func.rs b/crates/wasmtime/src/component/func.rs index 58b0d0624c..83db620cd5 100644 --- a/crates/wasmtime/src/component/func.rs +++ b/crates/wasmtime/src/component/func.rs @@ -189,13 +189,12 @@ impl Func { /// string: /// /// ``` - /// # use wasmtime::component::{Func, Value}; + /// # use wasmtime::component::Func; /// # use wasmtime::Store; /// # fn foo(func: &Func, mut store: Store<()>) -> anyhow::Result<()> { - /// let typed = func.typed::<(&str,), Value, _>(&store)?; + /// let typed = func.typed::<(&str,), String, _>(&store)?; /// let ret = typed.call(&mut store, ("Hello, ",))?; - /// let ret = ret.cursor(&store); - /// println!("returned string was: {}", ret.to_str()?); + /// println!("returned string was: {}", ret); /// # Ok(()) /// # } /// ``` diff --git a/tests/all/component_model.rs b/tests/all/component_model.rs index 6c73ddfd35..2c5a0f7e63 100644 --- a/tests/all/component_model.rs +++ b/tests/all/component_model.rs @@ -90,6 +90,14 @@ const REALLOC_AND_FREE: &str = r#" fn engine() -> Engine { let mut config = Config::new(); config.wasm_component_model(true); + + // When pooling allocator tests are skipped it means we're in qemu. The + // component model tests create a disproportionate number of instances so + // try to cut down on virtual memory usage by avoiding 4G reservations. + if crate::skip_pooling_allocator_tests() { + config.static_memory_maximum_size(0); + config.dynamic_memory_guard_size(0); + } Engine::new(&config).unwrap() } diff --git a/tests/all/main.rs b/tests/all/main.rs index 5bf8992fc3..19390ced02 100644 --- a/tests/all/main.rs +++ b/tests/all/main.rs @@ -1,7 +1,6 @@ mod async_functions; mod call_hook; mod cli_tests; -#[cfg(feature = "component-model")] mod component_model; mod custom_signal_handler; mod debug; diff --git a/tests/all/wast.rs b/tests/all/wast.rs index 1ef00c6f3d..e59b290e79 100644 --- a/tests/all/wast.rs +++ b/tests/all/wast.rs @@ -33,7 +33,6 @@ fn run_wast(wast: &str, strategy: Strategy, pooling: bool) -> anyhow::Result<()> .wasm_memory64(memory64) .cranelift_debug_verifier(true); - #[cfg(feature = "component-model")] cfg.wasm_component_model(feature_found(wast, "component-model")); if feature_found(wast, "canonicalize-nan") {