Skip to content
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

Allow WIT files to import other WIT files #43

Open
Michael-F-Bryan opened this issue Oct 4, 2022 · 0 comments
Open

Allow WIT files to import other WIT files #43

Michael-F-Bryan opened this issue Oct 4, 2022 · 0 comments

Comments

@Michael-F-Bryan
Copy link
Contributor

Michael-F-Bryan commented Oct 4, 2022

At the moment, the wapm CLI expects each set of bindings to be completely self-contained, however it's not uncommon for one WIT file to import types or functionality from another. When packaging a WAPM package, the wapm CLI should recursively include any bindings that are used.

For example, it’s pretty common for the functionality exposed by the host and the guest to share the same types (e.g. errno in WASI).That means you’ll have three WIT files:

  • guest.wit
  • host.wit
  • common.wit

... where both guest.wit and host.wit import records/resources/whatever from common.wit.

At the moment, the only WIT file that gets added to the bundled *.tar.gz is the one specified in your wapm.toml. Therefore, if we tried to generate bindings for a package like the one above, wit-pack would error out with “unable to import common.wit: file not found”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant