Move back to only one WASI submodule (#1434)
* Move back to only one WASI submodule This commit fixes the issue where we have two WASI submodules for build reasons in this repository. The fix was to place the submodule in the `wasi-common` crate, and then anyone using the `wig` crate has to be sure to define a `WASI_ROOT` env var in a build script to be able to parse witx files. With all that in place `wasi-common` becomes the source of truth for the witx files we're parsing, and crates like `wasmtime-wasi` use build-scripts shenanigans to read the same witx files. This should hopefully get us so we're compatible with publishing and still only have one submodule! * rustfmt
This commit is contained in:
@@ -3,21 +3,17 @@ use proc_macro2::TokenStream;
|
||||
use quote::{format_ident, quote};
|
||||
|
||||
pub fn define(args: TokenStream) -> TokenStream {
|
||||
let (path, phase) = utils::witx_path_from_args(args);
|
||||
let path = utils::witx_path_from_args(args);
|
||||
let doc = match witx::load(&[&path]) {
|
||||
Ok(doc) => doc,
|
||||
Err(e) => {
|
||||
panic!("error opening file {}: {}", path, e);
|
||||
panic!("error opening file {}: {}", path.display(), e);
|
||||
}
|
||||
};
|
||||
|
||||
let mut ret = TokenStream::new();
|
||||
|
||||
let old = match phase.as_str() {
|
||||
"snapshot" => false,
|
||||
"old/snapshot_0" => true,
|
||||
s => panic!("unsupported phase: {}", s),
|
||||
};
|
||||
let old = true;
|
||||
|
||||
for module in doc.modules() {
|
||||
for func in module.funcs() {
|
||||
|
||||
Reference in New Issue
Block a user