diff --git a/crates/wasi-common/src/wasi.rs b/crates/wasi-common/src/wasi.rs index f35055ffa8..f8b4aab780 100644 --- a/crates/wasi-common/src/wasi.rs +++ b/crates/wasi-common/src/wasi.rs @@ -4,7 +4,7 @@ use crate::WasiCtx; wiggle::from_witx!({ - witx: ["WASI/phases/snapshot/witx/wasi_snapshot_preview1.witx"], + witx: ["$WASI_ROOT/phases/snapshot/witx/wasi_snapshot_preview1.witx"], ctx: WasiCtx, }); diff --git a/crates/wasi/src/lib.rs b/crates/wasi/src/lib.rs index d6f8e4fad8..1e812ba033 100644 --- a/crates/wasi/src/lib.rs +++ b/crates/wasi/src/lib.rs @@ -9,8 +9,9 @@ pub use wasi_common::{WasiCtx, WasiCtxBuilder}; wasmtime_wiggle::wasmtime_integration!({ // The wiggle code to integrate with lives here: target: wasi_common::wasi, - // This must be the same witx document as used above: - witx: ["../wasi-common/WASI/phases/snapshot/witx/wasi_snapshot_preview1.witx"], + // This must be the same witx document as used above. This should be ensured by + // the `WASI_ROOT` env variable, which is set in wasi-common's `build.rs`. + witx: ["$WASI_ROOT/phases/snapshot/witx/wasi_snapshot_preview1.witx"], // This must be the same ctx type as used for the target: ctx: WasiCtx, // This macro will emit a struct to represent the instance,