-
Notifications
You must be signed in to change notification settings - Fork 22
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 interface version support #19
Comments
dicej
added a commit
that referenced
this issue
Nov 1, 2023
This fixes various issues: - Broken generated code indentation for resources in some cases - Type annotations that refer to non-yet-declared types confuse CPython, so we disable them - However, MyPy has no trouble with them, so we enable them by default for the `bindings` subcommand - Support WIT version annotations (i.e. pass them through to the generated component) - This partially addresses #19, but doesn't support importing or exporting multiple versions of the same interface - Update the `http` example to match `wasi:[email protected]` - Update to Wasmtime 14 and the latest `wit-parser`, `wit-component`, etc. - and update the WASI preview 1 adapter to match This also bumps the version to 0.6.0. Note that I've had to remove the `matrix-math` example since `wasmtime-py` does not yet support resources. Although the example itself doesn't use them, the new WASI Preview 1 adapter pulls them in as WASI Preview 2 imports, and there's no feasible way to work around that. Ideally, we'd provide the option to allow users to supply their own adapter, in which case we could use a pre-resource version of the adapter. However, that won't work given that pre-initialization is central to how `componentize-py` works. Hopefully we can bring back this example in the future, e.g. when `wasmtime-py` adds support for resources. Signed-off-by: Joel Dice <[email protected]>
dicej
added a commit
that referenced
this issue
Nov 1, 2023
This fixes various issues: - Broken generated code indentation for resources in some cases - Type annotations that refer to non-yet-declared types confuse CPython, so we disable them - However, MyPy has no trouble with them, so we enable them by default for the `bindings` subcommand - Support WIT version annotations (i.e. pass them through to the generated component) - This partially addresses #19, but doesn't support importing or exporting multiple versions of the same interface - Update the `http` example to match `wasi:[email protected]` - Update to Wasmtime 14 and the latest `wit-parser`, `wit-component`, etc. - and update the WASI preview 1 adapter to match This also bumps the version to 0.6.0. Note that I've had to remove the `matrix-math` example since `wasmtime-py` does not yet support resources. Although the example itself doesn't use them, the new WASI Preview 1 adapter pulls them in as WASI Preview 2 imports, and there's no feasible way to work around that. Ideally, we'd provide the option to allow users to supply their own adapter, in which case we could use a pre-resource version of the adapter. However, that won't work given that pre-initialization is central to how `componentize-py` works. Hopefully we can bring back this example in the future, e.g. when `wasmtime-py` adds support for resources. Signed-off-by: Joel Dice <[email protected]> bundle `poll_loop.py` to make it available during pre-init This module is useful enough that it makes sense to bundle it as part of `componentize-py`. Eventually, we may want to distribute it via PyPI as a helper library, but we'll settle for bundling for now. It shouldn't add any overhead for apps that don't `import` it. Signed-off-by: Joel Dice <[email protected]>
dicej
added a commit
that referenced
this issue
Nov 1, 2023
This fixes various issues: - Broken generated code indentation for resources in some cases - Type annotations that refer to non-yet-declared types confuse CPython, so we disable them - However, MyPy has no trouble with them, so we enable them by default for the `bindings` subcommand - Support WIT version annotations (i.e. pass them through to the generated component) - This partially addresses #19, but doesn't support importing or exporting multiple versions of the same interface - Update the `http` example to match `wasi:[email protected]` - Update to Wasmtime 14 and the latest `wit-parser`, `wit-component`, etc. - and update the WASI preview 1 adapter to match This also bumps the version to 0.6.0. Note that I've had to remove the `matrix-math` example since `wasmtime-py` does not yet support resources. Although the example itself doesn't use them, the new WASI Preview 1 adapter pulls them in as WASI Preview 2 imports, and there's no feasible way to work around that. Ideally, we'd provide the option to allow users to supply their own adapter, in which case we could use a pre-resource version of the adapter. However, that won't work given that pre-initialization is central to how `componentize-py` works. Hopefully we can bring back this example in the future, e.g. when `wasmtime-py` adds support for resources. Signed-off-by: Joel Dice <[email protected]> bundle `poll_loop.py` to make it available during pre-init This module is useful enough that it makes sense to bundle it as part of `componentize-py`. Eventually, we may want to distribute it via PyPI as a helper library, but we'll settle for bundling for now. It shouldn't add any overhead for apps that don't `import` it. Signed-off-by: Joel Dice <[email protected]>
dicej
added a commit
that referenced
this issue
Nov 1, 2023
* various updates to support `wasi:[email protected]` This fixes various issues: - Broken generated code indentation for resources in some cases - Type annotations that refer to non-yet-declared types confuse CPython, so we disable them - However, MyPy has no trouble with them, so we enable them by default for the `bindings` subcommand - Support WIT version annotations (i.e. pass them through to the generated component) - This partially addresses #19, but doesn't support importing or exporting multiple versions of the same interface - Update the `http` example to match `wasi:[email protected]` - Update to Wasmtime 14 and the latest `wit-parser`, `wit-component`, etc. - and update the WASI preview 1 adapter to match This also bumps the version to 0.6.0. Note that I've had to remove the `matrix-math` example since `wasmtime-py` does not yet support resources. Although the example itself doesn't use them, the new WASI Preview 1 adapter pulls them in as WASI Preview 2 imports, and there's no feasible way to work around that. Ideally, we'd provide the option to allow users to supply their own adapter, in which case we could use a pre-resource version of the adapter. However, that won't work given that pre-initialization is central to how `componentize-py` works. Hopefully we can bring back this example in the future, e.g. when `wasmtime-py` adds support for resources. Signed-off-by: Joel Dice <[email protected]> bundle `poll_loop.py` to make it available during pre-init This module is useful enough that it makes sense to bundle it as part of `componentize-py`. Eventually, we may want to distribute it via PyPI as a helper library, but we'll settle for bundling for now. It shouldn't add any overhead for apps that don't `import` it. Signed-off-by: Joel Dice <[email protected]> * update `http` example doc comments Signed-off-by: Joel Dice <[email protected]> --------- Signed-off-by: Joel Dice <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Per https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#package-declaration, if the WIT interface has an interface, it needs to be encoded in the component type identifier for that interface.
The text was updated successfully, but these errors were encountered: