Skip to content

c-api: gc feature unconditionally enabled in wasmtime crate #12783

@leonm1

Description

@leonm1

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: proxy-wasm/proxy-wasm-cpp-host#502 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    wasm-proposal:gcIssues with the implementation of the gc wasm proposalwasmtime:c-apiIssues pertaining to the C API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions