From 22b427baa01e92814cf3339c4c096b9a2f7df364 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Fri, 28 Aug 2020 15:42:51 -0700 Subject: [PATCH] use WASI_ROOT env var to specify witx paths to wiggle macros --- crates/wasi-common/src/wasi.rs | 2 +- crates/wasi/src/lib.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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,