Skip to content

Conversation

@alexcrichton
Copy link
Member

This commit aims to address #11450 in complementary but somewhat orthogonal ways. First a new Config::gc_support option is added which is hooked up to the CLI as -Wgc-support. This option controls the wasmparser-internal GC_TYPES feature. Its default value, like before, is cfg!(feature = "gc") and additionally enabling it requires the gc crate feature to be enabled.

This commit then additionally updates how wasm features are processed during validating a deserialized module to only require enabled features to be enabled in the host. Previously modules that disabled a feature but the feature was enabled in the host would fail to deserialize. All WebAssembly proposals are additive, however, so it's always ok to disable a feature and then load it into a module that enables the wasm proposal.

Closes #11450

This commit aims to address bytecodealliance#11450 in complementary but somewhat
orthogonal ways. First a new `Config::gc_support` option is added which
is hooked up to the CLI as `-Wgc-support`. This option controls the
wasmparser-internal `GC_TYPES` feature. Its default value, like before,
is `cfg!(feature = "gc")` and additionally enabling it requires the `gc`
crate feature to be enabled.

This commit then additionally updates how wasm features are processed
during validating a deserialized module to only require enabled features
to be enabled in the host. Previously modules that disabled a feature
but the feature was enabled in the host would fail to deserialize. All
WebAssembly proposals are additive, however, so it's always ok to
disable a feature and then load it into a module that enables the wasm
proposal.

Closes bytecodealliance#11450
@alexcrichton alexcrichton requested a review from a team as a code owner August 19, 2025 20:10
@alexcrichton alexcrichton requested review from pchickey and removed request for a team August 19, 2025 20:10
@fitzgen fitzgen added this pull request to the merge queue Aug 19, 2025
Merged via the queue into bytecodealliance:main with commit 3fab18f Aug 19, 2025
44 checks passed
@jsturtevant
Copy link
Contributor

Thanks!

@alexcrichton alexcrichton deleted the refactor-feature-handling branch August 19, 2025 21:24
bongjunj pushed a commit to prosyslab/wasmtime that referenced this pull request Oct 20, 2025
…e#11463)

This commit aims to address bytecodealliance#11450 in complementary but somewhat
orthogonal ways. First a new `Config::gc_support` option is added which
is hooked up to the CLI as `-Wgc-support`. This option controls the
wasmparser-internal `GC_TYPES` feature. Its default value, like before,
is `cfg!(feature = "gc")` and additionally enabling it requires the `gc`
crate feature to be enabled.

This commit then additionally updates how wasm features are processed
during validating a deserialized module to only require enabled features
to be enabled in the host. Previously modules that disabled a feature
but the feature was enabled in the host would fail to deserialize. All
WebAssembly proposals are additive, however, so it's always ok to
disable a feature and then load it into a module that enables the wasm
proposal.

Closes bytecodealliance#11450
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wasmtime run GC=no doesn't seem to disable GC in the host

3 participants