-
Notifications
You must be signed in to change notification settings - Fork 197
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
Document semantics of use
in deps/
#1046
Comments
Thanks for the report! This is a case where a bad error message is leading you astray of the root cause of what's happening, and it's something we should fix! The problem is that you've placed the Alternatively you can also copy the whole original directory wholesale (the entire top-level Does that at least help resolve the immediate issue? This is definitely something worth fixing at the underlying parsing layer to improve the error message here. |
That does fix things, thanks! I think this is mostly a documentation issue. Did I miss anything that explains how the special |
The best documentation for WIT is probably here where the official specification is here, but I suspect that neither is necessarily up-to-date or rigorous about the Perhaps the best course of action for now, would you mind opening an issue in https://github.com/bytecodealliance/wasm-tools? That's where all this parsing happens and the changes would happen in |
I'd like to use
wit-bindgen
to generate Rust bindings forwasi:cli/[email protected]
, but I'm confused about the semantics of theuse
statement from within a dependency, and would like to at least clarify the documentation.Here's what I did:
wit/
, and try to generate the bindings withwit-bindgen rust wit/ --world command
. This fails withpackage not found
...wasi:io/[email protected]
(imported here).wit/
calleddeps/
, and copy the WIT file contents of the IO directory there. Running the samewit-bindgen
command, now I get a new error:interface or world `error` not found in package
(referring to this line).Here's the directory structure for reference. File 1 (imports.wit) references file 2 (deps/world.wit), which references file 3, which should reference 4, but
wit-bingen
if failing to resolve that last one.I'm not sure how to proceed since the structure of the
deps/
subfolder is under-documented, especially how it relates to the 3 different types of external references in WIT:include
,import
, anduse
. The world callederror
is found in the same package asstreams.wit
, yetwit-bindgen
cannot find it. I also tried moving it to the top-levelwit/
directory (and changing the package name), but that didn't work either.What am I doing wrong?
The text was updated successfully, but these errors were encountered: