Stream: git-wasmtime

Topic: wasmtime / issue #12783 c-api: `gc` feature unconditional...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2026 at 12:25):

leonm1 opened issue #12783:

In the c-api crate, the c-api specifies wasmtime as a dependency and explicitly enumerates its default features. Cargo permits overriding the features in a subdependency by explicitly passing the subdependency and a set of features, such as this:

[dependencies]
wasmtime = {version = "42.0.1", default-features = false, features = ['std', 'runtime']}
wasmtime-c-api-impl = {version = "42.0.1", features = ['cranelift']}

However, this is not able to _disable_ explicitly selected features of subdependencies (as default-features = false only applies to the features in the wasmtime crate's own Cargo.toml).

wasmtime's c-api crate already includes a feature to toggle gc, so the explicit inclusion of gc in the wasmtime's features is unnecessary. The fix would be to avoid specifying features for the wasmtime dependency in the c-api crate's Cargo.toml.

This change could be made backwards compatible by enabling the wasmtime c-api crate's gc feature by default, which would transitively enable wasmtime's gc feature in a way that could be disabled by consumers.

Related: https://github.com/proxy-wasm/proxy-wasm-cpp-host/pull/502#discussion_r2873328850

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2026 at 15:52):

alexcrichton commented on issue #12783:

Thanks for the report! This is indeed currently the case, and it should be fine to change this whenever. It's ok to break back-compat, that's why Wasmtime has major version releases every month.

The fix for this is, in theory:

Happy to review/help with a PR if anyone's interested!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2026 at 15:52):

alexcrichton added the wasmtime:c-api label to Issue #12783.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2026 at 15:55):

alexcrichton added the wasm-proposal:gc label to Issue #12783.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2026 at 20:47):

tolumide-ng commented on issue #12783:

Happy to pick this up, thank you :smile:

view this post on Zulip Wasmtime GitHub notifications bot (Mar 19 2026 at 23:03):

tolumide-ng commented on issue #12783:

Thank you @alexcrichton! I’m still getting familiar with the codebase, but I’ve opened a PR:https://github.com/bytecodealliance/wasmtime/pull/12805.
It seems wasmtime's gc enables properties that would otherwise have to be implemented manually when gc is disabled (e.g., RootScope). At the moment, I have enabled the gc feature by default while allowing downstream users to disable it, preserving backward compatibility. What do you think?

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 21:15):

alexcrichton closed issue #12783:

In the c-api crate, the c-api specifies wasmtime as a dependency and explicitly enumerates its default features. Cargo permits overriding the features in a subdependency by explicitly passing the subdependency and a set of features, such as this:

[dependencies]
wasmtime = {version = "42.0.1", default-features = false, features = ['std', 'runtime']}
wasmtime-c-api-impl = {version = "42.0.1", features = ['cranelift']}

However, this is not able to _disable_ explicitly selected features of subdependencies (as default-features = false only applies to the features in the wasmtime crate's own Cargo.toml).

wasmtime's c-api crate already includes a feature to toggle gc, so the explicit inclusion of gc in the wasmtime's features is unnecessary. The fix would be to avoid specifying features for the wasmtime dependency in the c-api crate's Cargo.toml.

This change could be made backwards compatible by enabling the wasmtime c-api crate's gc feature by default, which would transitively enable wasmtime's gc feature in a way that could be disabled by consumers.

Related: https://github.com/proxy-wasm/proxy-wasm-cpp-host/pull/502#discussion_r2873328850


Last updated: Apr 12 2026 at 23:10 UTC