Cargo Features

[dependencies]
wasmtime = { version = "21.0.1", default-features = false, features = ["cranelift", "winch", "incremental-cache", "profiling", "parallel-compilation", "cache", "async", "pooling-allocator", "all-arch", "component-model", "wmemcheck", "demangle", "coredump", "debug-builtins", "runtime", "gc", "threads", "addr2line", "std", "wat"] }

=============================================================================

Features for the Wasmtime crate.

This section contains the compile-time features of the wasmtime crate. These features can be used to add more functionality and APIs exposed from the crate's API. Most of them are enabled by default. Disabling features can be done to cut down on binary size by disabling features that are not required for a particular embedding.

default = addr2line, async, cache, component-model, coredump, cranelift, debug-builtins, demangle, gc, parallel-compilation, pooling-allocator, profiling, runtime, std, threads, wat

These default features are set whenever wasmtime is added without default-features = false somewhere in the dependency tree.

cranelift default = std

An on-by-default feature enabling runtime compilation of WebAssembly modules with the Cranelift compiler. Cranelift is the default compilation backend of Wasmtime. If disabled then WebAssembly modules can only be created from precompiled WebAssembly modules.

Enables wasmtime-cranelift

Affects serialization::append_compiler_info, func::create_array_call_function

winch = std

Enables support for winch, the WebAssembly baseline compiler. The Winch compiler strategy in Config will be available. It is currently in active development and shouldn't be used in production applications.

Enables wasmtime-winch

Affects serialization::append_compiler_info, func::create_array_call_function

incremental-cache = std

Enables support for incremental compilation cache to be enabled in Config.

Enables incremental-cache of optional wasmtime-cranelift

profiling default = std

Enables support for profiling guest modules.

Enables fxprof-processed-profile ^0.6.0 and ittapi, serde_json and wasmtime-jit-debug, thread of rustix

parallel-compilation default = std

Enables parallel compilation of WebAssembly code.

Enables rayon

cache default = std

Enables support for automatic cache configuration to be enabled in Config.

Enables wasmtime-cache

async default = runtime, std

Enables support for "async stores" as well as defining host functions as async fn and calling functions asynchronously.

Enables async-trait, wasmtime-fiber, async of optional wasmtime-component-macro

Affects limits::ResourceLimiterAsync, store::CallHookHandler, store::AsyncCx, gc_runtime::collect_async, pooling::InstanceLimits.total_stacks, allocator::InstanceAllocatorImpl.allocate_fiber_stack, allocator::InstanceAllocatorImpl.deallocate_fiber_stack, vm::commit_stack_pages, vm::reset_stack_pages_to_zero

pooling-allocator default = runtime, std

Enables support for the pooling instance allocation strategy

Affects config::PoolingAllocationConfig, gc_runtime::GcHeap.reset, vm::commit_table_pages, vm::decommit_table_pages, vm::commit_table_pages, vm::decommit_table_pages, vm::commit_table_pages, vm::decommit_table_pages, vm::commit_table_pages, vm::decommit_table_pages, vm::commit_stack_pages, vm::reset_stack_pages_to_zero

all-arch

Enables support for all architectures in Cranelift, allowing cross-compilation using the wasmtime crate's API, notably the Engine::precompile_module function.

Enables all-arch of optional wasmtime-cranelift and optional wasmtime-winch

component-model default

Enables in-progress support for the component model. Note that this feature is in-progress, buggy, and incomplete. This is primarily here for internal testing purposes.

Enables encoding_rs, semver, wasmtime-component-macro, and wasmtime-component-util, component-model of wasmtime-environ, optional wasmtime-cranelift, and optional wasmtime-winch

Affects allocator::InstanceAllocatorImpl.validate_component_impl, allocator::InstanceAllocator.validate_component, vm::component, vm::Store.component_calls, runtime::component

wmemcheck = std

Enables wasmtime-wmemcheck, wmemcheck of wasmtime-environ and optional wasmtime-cranelift

demangle default = std

Enables support for demangling WebAssembly function names at runtime in errors such as backtraces.

Enables demangle of wasmtime-environ

coredump default = runtime, std

Enable support for generating core dumps on traps.

Enables wasm-encoder ^0.207.0

debug-builtins default = std

Export some symbols from the final binary to assist in debugging Cranelift-generated code with native debuggers like GDB and LLDB.

Enables wasmtime-jit-debug

Affects vm::debug_builtins

runtime default async coredump pooling-allocator

Enable support for executing compiled Wasm modules.

Enables mach2, memfd, memoffset, psm, and cc, smallvec, wasmtime-asm-macros, wasmtime-jit-icache-coherence, wasmtime-slab, wasmtime-versioned-export-macros, and windows-sys, mm of rustix

gc default

Enable support for garbage collection-related things.

This Cargo feature is required to compile or run Wasm that uses any of the following Wasm proposals:

When a compiler Cargo feature (cranelift or winch) is enabled, this feature gates the ability to compile Wasm that uses those proposals.

When the runtime Cargo feature is enabled, this feature gates the ability to load and run Wasm that uses those proposals.

Enables gc of optional wasmtime-cranelift and wasmtime-environ

Affects pooling::InstanceLimits.total_gc_heaps, allocator::InstanceAllocatorImpl.allocate_gc_heap, allocator::InstanceAllocatorImpl.deallocate_gc_heap

threads default = std

Enable runtime support for the WebAssembly threads proposal.

Enables threads of optional wasmtime-cranelift

addr2line default = std

Controls whether backtraces will attempt to parse DWARF information in WebAssembly modules and components to provide filenames and line numbers in stack traces.

Enables addr2line ^0.21.0 and gimli ^0.28.0

Affects instantiate::SymbolizeContext

std default addr2line async cache coredump cranelift debug-builtins demangle incremental-cache? parallel-compilation pooling-allocator profiling threads winch? wmemcheck?

Enables support for the Rust standard library, enabling APIs that require types and traits from Rust's std such as Path and Error.

Many features of the Wasmtime crate implicitly require this std feature. This will be automatically enabled if necessary.

Enables use-std of postcard, std of object ^0.33 and once_cell, std of wasmtime-environ and optional wasmtime-component-macro

Affects serialization::detect_precompiled_file

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

wat default