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:
Alex Crichton
2020-03-30 14:45:23 -05:00
committed by GitHub
parent 78772cf5e1
commit 968cd76163
21 changed files with 42 additions and 49 deletions

View File

@@ -8,7 +8,7 @@ use crate::old::snapshot_0::wasi::*;
use std::{convert::TryInto, io, mem, slice};
use wig::witx_host_types;
witx_host_types!("old/snapshot_0" "wasi_unstable");
witx_host_types!("phases/old/snapshot_0/witx/wasi_unstable.witx");
pub(crate) unsafe fn ciovec_to_host(ciovec: &__wasi_ciovec_t) -> io::IoSlice {
let slice = slice::from_raw_parts(ciovec.buf as *const u8, ciovec.buf_len);

View File

@@ -9,7 +9,7 @@ pub mod wasi;
pub mod wasi32;
pub mod hostcalls {
wig::define_hostcalls!("old/snapshot_0" "wasi_unstable");
wig::define_hostcalls!("phases/old/snapshot_0/witx/wasi_unstable.witx");
}
pub use ctx::{WasiCtx, WasiCtxBuilder};

View File

@@ -8,7 +8,7 @@
use wig::witx_wasi_types;
witx_wasi_types!("old/snapshot_0" "wasi_unstable");
witx_wasi_types!("phases/old/snapshot_0/witx/wasi_unstable.witx");
pub type WasiResult<T> = Result<T, WasiError>;

View File

@@ -12,4 +12,4 @@ use wig::witx_wasi32_types;
pub type uintptr_t = u32;
pub type size_t = u32;
witx_wasi32_types!("old/snapshot_0" "wasi_unstable");
witx_wasi32_types!("phases/old/snapshot_0/witx/wasi_unstable.witx");