From c0c4834c643ea8e90e5ad5e539db7b5ec60e9690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Gaspard?= Date: Wed, 6 Jan 2021 23:48:18 +0100 Subject: [PATCH] wasi-nn: rebuild if the witx files change --- Cargo.lock | 1 + crates/wasi-nn/Cargo.toml | 3 +++ crates/wasi-nn/build.rs | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index dc2ec4c24e..3df60a0186 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2727,6 +2727,7 @@ dependencies = [ "log", "openvino", "thiserror", + "walkdir", "wasmtime", "wasmtime-runtime", "wasmtime-wasi", diff --git a/crates/wasi-nn/Cargo.toml b/crates/wasi-nn/Cargo.toml index c05fd1d052..6811ded172 100644 --- a/crates/wasi-nn/Cargo.toml +++ b/crates/wasi-nn/Cargo.toml @@ -25,5 +25,8 @@ wiggle = { path = "../wiggle", version = "0.21.0" } openvino = "0.1.5" thiserror = "1.0" +[build-dependencies] +walkdir = "2.3" + [badges] maintenance = { status = "experimental" } diff --git a/crates/wasi-nn/build.rs b/crates/wasi-nn/build.rs index aeced29a0f..189b9513a6 100644 --- a/crates/wasi-nn/build.rs +++ b/crates/wasi-nn/build.rs @@ -7,4 +7,9 @@ fn main() { // This is necessary for Wiggle/Witx macros. let wasi_root = PathBuf::from("./spec").canonicalize().unwrap(); println!("cargo:rustc-env=WASI_ROOT={}", wasi_root.display()); + + // Also automatically rebuild if the Witx files change + for entry in walkdir::WalkDir::new(wasi_root) { + println!("cargo:rerun-if-changed={}", entry.unwrap().path().display()); + } }