Skip to content

Migrate from standalone Wizer to wasmtime-wizer #246

@avrabe

Description

@avrabe

Summary

The standalone Wizer project has been merged upstream into Wasmtime as of v39.0.0 (November 20, 2025).

Current State

Our tools/wizer_initializer is currently a placeholder implementation that:

  • Detects WebAssembly component vs module format
  • Has the architecture for component → module → wizer → component workflow
  • Does NOT actually perform pre-initialization (returns input as-is)

The wizer crate dependency was never added due to complex dependency conflicts with Cranelift/Wasmtime in Bazel's crate_universe.

New Upstream Solution

Wasmtime v39.0.0+ provides:

CLI: wasmtime wizer

wasmtime wizer --init-func wizer-initialize input.wasm -o output.wasm

Crate: wasmtime-wizer

  • Available as part of the Wasmtime ecosystem
  • Better maintained as part of the main Wasmtime project
  • Integrated with Wasmtime's component model support

Breaking Changes

  • Init function name changed from wizer.initialize to wizer-initialize (compatible with components)
  • The component-init project was also merged into this

Proposed Migration

Option 1: Use wasmtime wizer CLI (Recommended)

Since we already have a Wasmtime toolchain (//toolchains:wasmtime_toolchain), we can:

  1. Update wasm_component_wizer_library rule to invoke wasmtime wizer subcommand
  2. Remove the wizer_initializer Rust tool (keep checksum_updater as separate package)
  3. Update init function references from wizer.initialize to wizer-initialize

Option 2: Use wasmtime-wizer crate

If library-level integration is needed:

  1. Add wasmtime-wizer to crate dependencies
  2. Implement actual pre-initialization in wizer_initializer
  3. Handle component model integration

Tasks

  • Evaluate which option best fits the project needs
  • Update wasm/wasm_component_wizer_library.bzl to use wasmtime wizer
  • Split checksum_updater into separate package (it has different dependencies)
  • Update documentation for new init function name
  • Test with existing wizer examples
  • Remove deprecated wizer_initializer tool once migration complete

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions