* Remove the module linking implementation in Wasmtime This commit removes the experimental implementation of the module linking WebAssembly proposal from Wasmtime. The module linking is no longer intended for core WebAssembly but is instead incorporated into the component model now at this point. This means that very large parts of Wasmtime's implementation of module linking are no longer applicable and would change greatly with an implementation of the component model. The main purpose of this is to remove Wasmtime's reliance on the support for module-linking in `wasmparser` and tooling crates. With this reliance removed we can move over to the `component-model` branch of `wasmparser` and use the updated support for the component model. Additionally given the trajectory of the component model proposal the embedding API of Wasmtime will not look like what it looks like today for WebAssembly. For example the core wasm `Instance` will not change and instead a `Component` is likely to be added instead. Some more rationale for this is in #3941, but the basic idea is that I feel that it's not going to be viable to develop support for the component model on a non-`main` branch of Wasmtime. Additionaly I don't think it's viable, for the same reasons as `wasm-tools`, to support the old module linking proposal and the new component model at the same time. This commit takes a moment to not only delete the existing module linking implementation but some abstractions are also simplified. For example module serialization is a bit simpler that there's only one module. Additionally instantiation is much simpler since the only initializer we have to deal with are imports and nothing else. Closes #3941 * Fix doc link * Update comments
60 lines
1.4 KiB
Rust
60 lines
1.4 KiB
Rust
mod async_functions;
|
|
mod call_hook;
|
|
mod cli_tests;
|
|
mod custom_signal_handler;
|
|
mod debug;
|
|
mod epoch_interruption;
|
|
mod externals;
|
|
mod fuel;
|
|
mod func;
|
|
mod funcref;
|
|
mod gc;
|
|
mod globals;
|
|
mod host_funcs;
|
|
mod iloop;
|
|
mod import_calling_export;
|
|
mod import_indexes;
|
|
mod instance;
|
|
mod invoke_func_via_table;
|
|
mod limits;
|
|
mod linker;
|
|
mod memory;
|
|
mod memory_creator;
|
|
mod module;
|
|
mod module_serialize;
|
|
mod name;
|
|
mod pooling_allocator;
|
|
mod relocs;
|
|
mod stack_overflow;
|
|
mod store;
|
|
mod table;
|
|
mod traps;
|
|
mod wast;
|
|
|
|
/// A helper to compile a module in a new store with reference types enabled.
|
|
pub(crate) fn ref_types_module(
|
|
source: &str,
|
|
) -> anyhow::Result<(wasmtime::Store<()>, wasmtime::Module)> {
|
|
use wasmtime::*;
|
|
|
|
let _ = env_logger::try_init();
|
|
|
|
let mut config = Config::new();
|
|
config.wasm_reference_types(true);
|
|
|
|
let engine = Engine::new(&config)?;
|
|
let store = Store::new(&engine, ());
|
|
|
|
let module = Module::new(&engine, source)?;
|
|
|
|
Ok((store, module))
|
|
}
|
|
|
|
/// A helper determining whether the pooling allocator tests should be skipped.
|
|
pub(crate) fn skip_pooling_allocator_tests() -> bool {
|
|
// There are a couple of issues when running the pooling allocator tests under QEMU:
|
|
// - high memory usage that may exceed the limits imposed by the environment (e.g. CI)
|
|
// - https://github.com/bytecodealliance/wasmtime/pull/2518#issuecomment-747280133
|
|
std::env::var("WASMTIME_TEST_NO_HOG_MEMORY").is_ok()
|
|
}
|