-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
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.