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

Update the C API with module linking support #2472

Merged

Conversation

alexcrichton
Copy link
Member

This commit does everything necessary (ideally) to support the module
linking proposal in the C API. The changes here are:

  • New wasm_{module,instance}type_t types and accessors
  • New wasm_{module,instance}_type functions
  • Conversions between wasm_extern_t and wasm_{instance,module}_t, as
    well as wasm_externtype_t and the new types.
  • Addition of WASM_EXTERN_{MODULE,INSTANCE} constants
  • New wasm_config_t modifier to enable/disable module linking

With these functions it should be possible to pass instances/modules to
instances and also acquire them from exports. Altogether this should
enable everything for module linking.

An important point for this is that I've opted to add all these items
under the wasm_* name prefix instead of wasmtime_*. I've done this
since they're all following the idioms of existing APIs and while not
standard the intention would be to standardize them (unlike many other
Wasmtime-specific APIs).

cc #2094

alexcrichton added a commit to alexcrichton/wasmtime-py that referenced this pull request Dec 3, 2020
This updates the Python extension with the API support added in
bytecodealliance/wasmtime#2472. Most of the changes here were pretty
straightforward!
@alexcrichton
Copy link
Member Author

It's worth noting that I tested this against bytecodealliance/wasmtime-py#47 as well to ensure it doesn't at least immediately segfault.

@github-actions github-actions bot added the wasmtime:c-api Issues pertaining to the C API. label Dec 3, 2020
@github-actions
Copy link

github-actions bot commented Dec 3, 2020

Subscribe to Label Action

cc @peterhuene

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

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

  • peterhuene: wasmtime:c-api

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

Learn more.

This commit does everything necessary (ideally) to support the module
linking proposal in the C API. The changes here are:

* New `wasm_{module,instance}type_t` types and accessors
* New `wasm_{module,instance}_type` functions
* Conversions between `wasm_extern_t` and `wasm_{instance,module}_t`, as
  well as `wasm_externtype_t` and the new types.
* Addition of `WASM_EXTERN_{MODULE,INSTANCE}` constants
* New `wasm_config_t` modifier to enable/disable module linking

With these functions it should be possible to pass instances/modules to
instances and also acquire them from exports. Altogether this should
enable everything for module linking.

An important point for this is that I've opted to add all these items
under the `wasm_*` name prefix instead of `wasmtime_*`. I've done this
since they're all following the idioms of existing APIs and while not
standard the intention would be to standardize them (unlike many other
Wasmtime-specific APIs).

cc bytecodealliance#2094
Copy link
Member

@peterhuene peterhuene left a comment

Choose a reason for hiding this comment

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

Looks good. I'll file an issue in the .NET repo for ingesting these changes.

@alexcrichton alexcrichton merged commit 41caf67 into bytecodealliance:main Dec 3, 2020
@alexcrichton alexcrichton deleted the module-linking-c-api branch December 3, 2020 21:51
alexcrichton added a commit to bytecodealliance/wasmtime-py that referenced this pull request Dec 3, 2020
This updates the Python extension with the API support added in
bytecodealliance/wasmtime#2472. Most of the changes here were pretty
straightforward!
alexcrichton added a commit to alexcrichton/wasmtime-go that referenced this pull request Dec 3, 2020
This commit binds the support added in bytecodealliance/wasmtime#2472 to
bring support for the module linking to this Go extension. The support
here is similar to bytecodealliance/wasmtime-py#47, which is hooking up
modules/instances to `Extern` as well as adding dedicated
instance/module types.
alexcrichton added a commit to bytecodealliance/wasmtime-go that referenced this pull request Dec 4, 2020
* Implement module linking proposal

This commit binds the support added in bytecodealliance/wasmtime#2472 to
bring support for the module linking to this Go extension. The support
here is similar to bytecodealliance/wasmtime-py#47, which is hooking up
modules/instances to `Extern` as well as adding dedicated
instance/module types.

* Update bazel build

* Try to fix a Windows CI issue
X-leaf7 added a commit to X-leaf7/wasmtime-go that referenced this pull request Jun 24, 2024
* Implement module linking proposal

This commit binds the support added in bytecodealliance/wasmtime#2472 to
bring support for the module linking to this Go extension. The support
here is similar to bytecodealliance/wasmtime-py#47, which is hooking up
modules/instances to `Extern` as well as adding dedicated
instance/module types.

* Update bazel build

* Try to fix a Windows CI issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:c-api Issues pertaining to the C API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants