Comments (3)
Hi @stevesloka; thanks for the report.
Regarding the first issue: hello.wit does not export wasi:cli/run
, so it's not a CLI command as defined by WASI Preview 2. The only way to run a component targeting a custom world like this is to write a Rust program that uses Wasmtime's component API to instantiate the component and invoke its hello
export. Or use something like https://github.com/rylev/wepl, although I don't think it's been updated to Wasmtime 15 yet. Anyway, if you want to make a CLI command, you'll need to target a world which exports wasi:cli/run
at minimum (and maybe import wasi:cli/stdio
if you want to print to the console).
When I have a few minutes, I'll add a CLI example to the repo for reference.
Regarding the second error: that wasm-tools command is for turning a core module into a component, not vice versa. And there's no way in general to convert a component into a core module, since a component is often made up of multiple core modules. Components generated by componentize-py
are always made up of at least 11 modules.
from componentize-py.
#46 adds a CLI example (and fixes a componentize-py
bug I found when testing it). Unfortunately, there's also a bug in wasmtime-wasi
that prevents wasmtime run
from running the example. That will be fixed when bytecodealliance/wasmtime#7613 is merged.
from componentize-py.
Thanks for the explanation and examples @dicej! I have a better understanding of how this all fits together, thanks for bearing with me through all of it and explaining.
I'm still trying to get the example you have in your PR to work, ran into a different error which I commented on. Once I get an example running locally, I think it will help out my mental model of everything.
from componentize-py.
Related Issues (20)
- Add interface version support HOT 1
- Remove init function and types from the final output
- Use interface package as part of module name in generated bindings HOT 1
- Use `wasi-virt`-based VFS to store Python code
- Download dependencies automatically
- Add support for type aliases
- Optionally produce component which imports libpython311.so, libc.so, etc. instead of bundling them
- time.sleep sleeps indefinitely HOT 3
- re-init random seed(s) on resume
- pyo3_runtime.PanicException: internal error: entered unreachable code HOT 3
- Running component without WASI HOT 2
- Run MyPy on all test code and bindings HOT 1
- Question: Current types limitation HOT 6
- Matrix-math example - ImportError... HOT 4
- List errors which might be raised in function docstrings
- Make the types generated for WIT resources context managers
- feature: add zlib to cpython build HOT 1
- Generated component has dependency on wasi:cli/[email protected] HOT 14
- Create more actionable error for disallowed name for a Python module
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from componentize-py.