-
Notifications
You must be signed in to change notification settings - Fork 1.4k
c-api: Create and instantiate a component model linker #10598
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
c-api: Create and instantiate a component model linker #10598
Conversation
Co-authored-by: Tyler Rockwood <[email protected]> Co-authored-by: Jean-Jacques Lafay <[email protected]>
8449883
to
ecd7690
Compare
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.
Thanks! Would you be up for additionally writing tests now that we've got that set up? Ideally through a new C++ API but also optionally through the C API.
Yes! I would like to write tests, but I'm not sure on some things: I tested this locally by writing an "example" host using these functions, and running it with a guest component which doesn't import anything. Also, I'm not sure if I would want to update the C++ API as well in these PRs. Would it make more sense to add tests for the C API now, and if later - when the same functionality gets exposed to C++ API, and a test written for it - made the C test obsolete, remove it? |
My thinking is that most of the tests could use the text format of WebAssembly, meaning the test wasm file would be in-line with the test itself (this is used a lot on the Rust side for testing too). Orchestrating native-language binaries compiled to wasm to be available in the tests is possible but will be a bit of a pain. For location, yeah I'm thinking we'd drop things in |
e1bcd8f
to
5dd2063
Compare
5dd2063
to
4e85b9e
Compare
f382f7d
to
4cb3e1e
Compare
@alexcrichton What do you want in the next PR? |
How about sketching out the My main concern there is that the One example could be that the entire "path" to an item is passed to the C API, where each element in the path is an exported instance layer. That would then call It's not that we can't have inter-related objects in the C API, it's mostly just that I'd prefer to avoid it if possible. |
Next small chunk of #9812.
I'm not sure about the lifetime requirements of
wasmtime_component_linker_instance()
, is there any better way to express this?See previous discussion: #9812 (comment)