Support lists of WIT directories on the CLI.#1368
Support lists of WIT directories on the CLI.#1368alexcrichton merged 1 commit intobytecodealliance:mainfrom
Conversation
f53bc1c to
a598bb2
Compare
| let mut main_packages = Vec::new(); | ||
| for wit in &opts.wit { | ||
| let (pkg, _files) = resolve.push_path(wit)?; | ||
| main_packages.push(pkg); | ||
| } |
There was a problem hiding this comment.
Ah this reminds me one of the reasons I found this tricky to do before. The ideal implementation in my head is such that there's no order dependency of arguments on the CLI and the implementation internally would figure out how to slurp up all the WITs. As-implemented here, however, while later arguments could refer to WITs of earlier arguments it's not possible the other way around due to the explicit order of push_path.
Internally Resolve has everything necessary to do all the topo-sorting and everything, but it's not exposed currently through a push_many support or anything like that.
This is probably fine to have as a TODO, however, as this equally affects the paths argument in the Rust macro. Perhaps worth documenting though in the meantime and having an issue on wasm-tools to fill out at some point?
There was a problem hiding this comment.
Ah. In my current use cases, this ordering requirement isn't a problem, but I agree we should think about lifting this requirement. I've now added documentation to this PR, and filed bytecodealliance/wasm-tools#2292.
|
I think you should be able to fix most CI by switching to a git dep instead of using Would you like to have a release of wasm-tools to keep on the path of integrating this? |
a598bb2 to
67217f6
Compare
Accept multiple WIT paths in the wit-bindgen CLI, using the same logic as the multiple WIT paths accepted by the `path` parameter in the Rust bindgen macro. Also, document that list-of-WIT interfaces, in the Rust macro and now the wit-bindgen CLI, have a topological ordering requirement which may be lifted in the future.
67217f6 to
fd33cfe
Compare
Accept multiple WIT paths in the wit-bindgen CLI, using the same logic as the multiple WIT paths accepted by the
pathparameter in the Rust bindgen macro.Also, document that list-of-WIT interfaces, in the Rust macro and now the wit-bindgen CLI, have a topological ordering requirement which may be lifted in the future.