Closed eliabieri closed 1 year ago
Hi @eliabieri. Thanks for reporting this.
I just opened https://github.com/bytecodealliance/componentize-py/pull/32, which should fix the panic. I'll publish a 0.4.3 release with the fix soon.
Also, you'll need to rename widget/widget.py to something else (e.g. widget/app.py) because componentize-py
gets confused when there's two widget modules in the path (the one you wrote and the one that gets generated from widget.wit).
With both of the above changes, I was able to build the component successfully. I haven't tried running it yet, since I'm not sure how to set up the appropriate host environment. If you have trouble with that, please let me know how to reproduce it, and I'll be happy to help debug.
One more thing: you might need to add a from widget import types
line to your code. See https://github.com/bytecodealliance/componentize-py#known-limitations for details.
Thank you, @dicej. ✨ Thanks to your superfast and detailed response, I was now able to build the component.
The component cannot be instantiated yet in my setup, but that most likely another issue. Going to resolve this issue and open up another one if other problems arise.
I ran into the following issue:
Steps to reproduce
Prerequisites: Poetry 1) Clone repo
git clone --recurse-submodules git@github.com:eliabieri/wg_display_widget_py.git
2) Install dependenciespoetry install
3) Generate bindingspoetry run componentize-py --wit-path wg_display_widget_wit/wit --world widget bindings .
4) Generate componentpoetry run componentize-py --wit-path wg_display_widget_wit/wit --world widget componentize --output widget.wasm --python-path widget widget