Skip to content

Publish C API crate to crates.io #7735

Description

@maxbrunsfeld

Feature

It would be useful to me to be able to download wasmtime-c-api from crates.io, instead of from GitHub.

Benefit

I maintain a C library (Tree-sitter) that uses Wasmtime via the C API. Tree-sitter also has Rust bindings. The Tree-sitter Rust crate has a Cargo dependency on both wasmtime and wasmtime-c-api (previous discussion). Right now, those dependencies specify Git revisions, not version numbers, because wasmtime-c-api is not available on crates.io.

It would be useful if those two cargo dependencies could both be expressed in terms of version numbers, as opposed to git/rev dependencies. That way, consumers of tree-sitter would have more flexibility in terms of which versions of wasmtime were compiled into their binaries.

Implementation

It looks like there is automation for publishing various crates to crates.io, in the publish.rs script. I think that wasmtime-c-api could be added to the list of "public crates" which are published whenever a v tag is pushed.

Alternatives

  • Don't support this use case of combining C and Rust, since it's uncommon. If a C library depends on wasmtime, and that C library has Rust bindings, that Rust crate should not try to use Cargo to build and link Wasmtime.
  • Suggest that such crates should download and compile the wasmtime-c-api programmatically in a custom build script, as opposed to using a Cargo dependency.
  • Some other person or organization publish the wasmtime C API to crates.io. Don't do it as part of a Wasmtime workflow.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions