You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Empty exported interface fails with “unknown component 1: component index out of bounds” #252
Expected: compilation succeeds and produces a valid component exporting the empty marker interface.
Actual: the command exits with status 1:
AssertionError:
Caused by:
unknown component 1: component index out of bounds (at offset 0xa17228)
Adding an ordinary function export alongside marker does not prevent the failure. Adding a record type inside marker allows compilation to succeed.
Suspected cause: componentize-py 0.25.1 depends on component-init-transform 0.2.0. In its instrument() and initialize() functions, the nested-component copying loops stop when a section range reaches unchecked_range.end. An empty nested component has no section payload before End, so the loop appears to consume the following outer section instead.
While testing componentize-py 0.25.1, I found two more issues:
1. Repeated bindings generation fails
Running componentize-py -d world.wit -w calc bindings . twice with a non-empty exported interface fails on the second run with AssertionError: File exists (os error 17). Removing wit_world/exports fixes it. Direct world-level function exports work fine.
Activity
dicej commentedon Oct 27, 2026
Thanks for reporting this, @mandesero. I'll investigate when I get a chance, hopefully by the end of this week.
mandesero commentedon Oct 27, 2026
Thanks, @dicej!
While testing componentize-py 0.25.1, I found two more issues:
1. Repeated bindings generation fails
Running
componentize-py -d world.wit -w calc bindings .twice with a non-empty exported interface fails on the second run withAssertionError: File exists (os error 17). Removingwit_world/exportsfixes it. Direct world-level function exports work fine.2. Empty resource generates invalid Python
For:
Generated
wit_world/exports/handles.pycontainsclass Token(Protocol):without a body orpass, causing anIndentationError.Are these bugs or intentional limitations? If bugs, could you open separate issues for them?
dicej commentedon Oct 27, 2026
Thanks. I've opened #253 for item 1 and will look into item 2 when I investigate the original issue.
fix issues regarding empty WIT interfaces and resources (#254)