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

Add a wasmtime::component::bindgen! macro #5317

Merged
merged 13 commits into from
Dec 6, 2022

Conversation

alexcrichton
Copy link
Member

This PR represents merging the wit-bindgen-gen-host-wasmtime-rust crate from the wit-bindgen repository into this repository. This is made possible by recent infrastructural work around movement of the dependencies involved here, and this is the final process of extracting the macro to this repository. This commit creates a bindgen! macro in the wasmtime::component submodule. which is the wit_bindgen_host_wasmtime_rust::generate macro, more-or-less.

A new crates/wit-bindgen folder is created here with a wasmtime-wit-bindgen crate which is the current contents of the generation in the wit-bindgen repsitory. I opted to not merge the full history here since recent revisions by Pat have removed most of the historical support of lifting/lowering/async/etc so the history isn't really all that interesting. Additionally parts of the wit-bindgen-core and various other crates were merged in here and adapted to just work for this wasmtime generator.

This is intended to be the "final" interface for how developers will work with *.wit files and Wasmtime. This bindgen! macro takes in a *.wit file and will, hopefully, forevermore be how this all works. This is all included in the wasmtime crate when the component-model feature is enabled. Further development of this macro is expected to happen in this repository, not externally. I'll in short order delete the sources in the wit-bindgen repository in favor of the sources here.

Tests have been migrated here, mostly the codegen ones. Otherwise though the component model is already thoroughly tested so the runtime/*/host.rs tests were not migrated. A few small ones have been added to ensure that the generated structure works but otherwise testing is largely left to the already tested embedding API.

@github-actions github-actions bot added the wasi Issues pertaining to WASI label Nov 22, 2022
@github-actions
Copy link

Subscribe to Label Action

cc @kubkon

This issue or pull request has been labeled: "wasi"

Thus the following users have been cc'd because of the following labels:

  • kubkon: wasi

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@alexcrichton
Copy link
Member Author

Of particular note, I've added cargo vet entries for the pulldown-cmark crate as well as the unicase crate pulled in by wit-parser.

alexcrichton added a commit to alexcrichton/witx-bindgen that referenced this pull request Nov 22, 2022
This bindings generator has been moved to the `wasmtime` crate upstream
as part of bytecodealliance/wasmtime#5317.
This is another step along the road of bytecodealliance#395. The Wasmtime-hosted tests
are all removed here as well but may get re-added in the future for
testing as necessary.
alexcrichton added a commit to alexcrichton/witx-bindgen that referenced this pull request Nov 29, 2022
This bindings generator has been moved to the `wasmtime` crate upstream
as part of bytecodealliance/wasmtime#5317.
This is another step along the road of bytecodealliance#395. The Wasmtime-hosted tests
are all removed here as well but may get re-added in the future for
testing as necessary.
@alexcrichton alexcrichton force-pushed the merge-wit-bindgen branch 2 times, most recently from db022c5 to d2e6ccc Compare November 30, 2022 16:46
@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Nov 30, 2022
@github-actions
Copy link

Subscribe to Label Action

cc @peterhuene

This issue or pull request has been labeled: "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

This commit imports the `wit-bindgen-gen-host-wasmtime-rust` crate from
the `wit-bindgen` repository into the upstream Wasmtime repository. I've
chosen to not import the full history here since the crate is relatively
small and doesn't have a ton of complexity. While the history of the
crate is quite long the current iteration of the crate's history is
relatively short so there's not a ton of import there anyway. The
thinking is that this can now continue to evolve in-tree.
Make room for a `wit_bindgen` macro to slot in.
@alexcrichton alexcrichton merged commit 2329ecc into bytecodealliance:main Dec 6, 2022
@alexcrichton alexcrichton deleted the merge-wit-bindgen branch December 6, 2022 19:06
alexcrichton added a commit to bytecodealliance/wit-bindgen that referenced this pull request Dec 6, 2022
This bindings generator has been moved to the `wasmtime` crate upstream
as part of bytecodealliance/wasmtime#5317.
This is another step along the road of #395. The Wasmtime-hosted tests
are all removed here as well but may get re-added in the future for
testing as necessary.
rvolosatovs pushed a commit to bytecodealliance/wrpc that referenced this pull request May 23, 2024
This bindings generator has been moved to the `wasmtime` crate upstream
as part of bytecodealliance/wasmtime#5317.
This is another step along the road of #395. The Wasmtime-hosted tests
are all removed here as well but may get re-added in the future for
testing as necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi Issues pertaining to WASI wasmtime:api Related to the API of the `wasmtime` crate itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants