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
add support for targeting multiple worlds with a single component (#76)
A while back, I added support for `componentize-py.toml` files in Python
packages, which allows developers to embed WIT files in their Python packages
and also specify where the bindings should be generated with respect to the
Python module hierarchy. This is useful when publishing SDK packages for a WIT
world, which may include additional, handwritten code on top of the generated
bindings. However, it wasn't possible to use more than one such package at a
time, nor was it possible to use such a package and _also_ target an additional,
application-level WIT world beyond those defined in the package.
This commit removes those instructions, allowing the user to specify multiple
worlds (up to one per package, plus one additional, application-level world)
when generating a component. Since those worlds might overlap, we merge them
together using `wit_parser::Resolve::merge` and then generate bindings for each
world such that the bindings for a given world may alias bindings generated for
an earlier world.
This required quite a bit of refactoring, and the code responsible for juggling
all the WIT directories, worlds, and bindings is a bit awkward since it's trying
to handle a wide range of use cases. It also needs more (automated) testing.
In short, it's not fully baked yet, but I want to get a pre-release out so folks
can try it while I clean things up.
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
0 commit comments