Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust: add option for path to wit-bindgen runtime. #619

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

peterhuene
Copy link
Member

This PR adds an optional path to the wit-bindgen runtime to use for Rust code generation.

This will allow a different crate from wit-bindgen to generate bindings while also re-exporting wit-bindgen::rt at a known path for the generated code to use.

This change adds an optional path to the `wit-bindgen` runtime to use for Rust
code generation.

This will allow a different crate from `wit-bindgen` to generate bindings while
also re-exporting `wit-bindgen::rt` at a known path for the generated code to
use.
Copy link
Contributor

@pchickey pchickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! can you add a test which invokes this with e.g. pub mod my_rt { pub use wit_bindgen::rt::*;}?

@peterhuene
Copy link
Member Author

I've added a runtime_path option to the generate! macro so we can set it via a test, which I've also added.

@peterhuene
Copy link
Member Author

@alexcrichton thoughts on doing a release that might include this change?

This will enable cargo-component to migrate to using a wit-bindgen::generate!-style macro ahead of the resource changes and we've also rev'd the wasm-tools dependencies in main, which would be nice to have for downstream crates to sync on.

I realize that we'll want a release in the (near?) future to support resources, but an interim release would definitely help me out.

@alexcrichton
Copy link
Member

Sounds good to me! I'll send a version bump to this repo which will be good to pull in the wasm-tools update regardless.

@alexcrichton alexcrichton merged commit 4e2dcd4 into bytecodealliance:main Jul 14, 2023
@peterhuene peterhuene deleted the runtime-path branch July 14, 2023 21:36
@alexcrichton
Copy link
Member

Posted a bump at #620

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.

3 participants