-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fill out more of the C++ API for components #11889
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
Merged
alexcrichton
merged 18 commits into
bytecodealliance:main
from
alexcrichton:more-cpp-component-apis
Oct 21, 2025
Merged
Fill out more of the C++ API for components #11889
alexcrichton
merged 18 commits into
bytecodealliance:main
from
alexcrichton:more-cpp-component-apis
Oct 21, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just a bare-bones API for now with functionality that's possible to fill out. Notably instantiation and defining functions is not yet possible in C++. Some more feature-parity is also added with the core linkers as well.
Upon reflection I realize that this is not actually necessary and is otherwise a duplicate of the functionality in `wasi.h`. All of the functionality in `wasi.h` is already supported to power WASIp2-defined APIs in a linker, which is enabled by the `WasiView` trait redirecting to the `WasiView for WasiP1Ctx` implementation. This is similar to how the `wasmtime` CLI works where a P1 context is always created and then it's conditionally used for either core wasm or components. Effectively this is a deletion of duplicate functionality in the C API but no underlying functionality is lost. Translating information to preexisting WASI calls will work the same as using the wasip2 APIs before.
All the pieces are now in place to use the C++ API in testing.
today is not that day.
pchickey
approved these changes
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know C++ well enough to give this a useful review, but I'll rubber-stamp it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This series of commits builds on #11880 in the same manner to build out the C++ API for components. The general design of the API is effectively the same as that for core wasm and reflects the functionailty of components currently in the C API. Component support at this time is not overly comprehensive but there's enough to instantiate and work with components.
This PR is split into a series of commits where each commit individually should pass all tests. They're logically all part of adding C++ support for components, however, and the end goal was to effectively rewrite all the C tests into C++ which is accomplished in this PR.