Files
vectorcraft/crates/plugins/Cargo.toml
T
dotCooCoo b0fba57f4a Plug-ins: the host checks the WebAssembly features a plug-in uses
Plugin::load now validates each module with wasmparser and a fixed list
of WebAssembly features before wasmi reads it: mutable globals, sign
extension, saturating conversions, multi-value, bulk memory, reference
types, tail calls, extended constant expressions and floats. A module
that uses any other feature is refused, so a wasmi upgrade, a change to
its defaults or one of its crate features turned on elsewhere in the
build does not change what a plug-in may use. wasmi's Config is set to
the same list for every setter it has in this build.

The list is the set wasmi accepted before, without multi-memory. A
second memory was already refused by the one-memory limit; its error
now says "multiple memories". No module that loaded before is refused.

wasmparser 0.228.0 is the version wasmi 2.0.0 already uses.

A new test loads a plug-in that uses each listed feature and checks
that modules using SIMD, relaxed SIMD, memory64, a second memory,
custom page sizes, wide arithmetic, threads, exceptions, legacy
exceptions, function references or garbage collection are refused with
an error that names the feature.

docs/plugins.md lists the whole set; it named only four of the allowed
features before.
2026-11-20 17:25:01 -08:00

33 lines
1.1 KiB
TOML

[package]
name = "vectorcraft-plugins"
description = "Sandboxed WebAssembly plug-ins for VectorCraft: a resource-limited wasmi host for object filters and live effects"
version.workspace = true
edition.workspace = true
license.workspace = true
[lints]
workspace = true
[dependencies]
vectorcraft-geom = { workspace = true }
vectorcraft-color = { workspace = true }
vectorcraft-doc = { workspace = true }
log = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
# The pixels of a small image a filter asks to read, as RGBA in base64.
craft-image-codecs = { workspace = true }
craft-vectorcraft-format = { workspace = true }
# The SHA-256 of a module, which the install prompt shows and a grant records.
sha2 = { version = "0.10", default-features = false }
thiserror = { workspace = true }
wasmi = { workspace = true }
wasmparser = { workspace = true }
# The monotonic clock of run deadlines and the first-view budget: `std::time::Instant` on the
# desktop, the page's `performance.now()` in the web build. It is MIT OR Apache-2.0 and already in
# the build through eframe.
web-time = "1"
[dev-dependencies]
wat = { workspace = true }