Make the cargo-run tool auto-install its wasm-opt build dependency (#4256)

* Allow auto downloading wasm-opt

* Fix for mac

* Review
This commit is contained in:
Timon
2026-06-21 20:17:54 +00:00
committed by GitHub
parent a72ac39059
commit d753ce26f7
9 changed files with 327 additions and 69 deletions
+3 -4
View File
@@ -8,7 +8,7 @@ use std::path::Path;
use std::process::ExitCode;
use std::time::Duration;
const EXCLUDED_DIRECTORIES: &[&str] = &["target", ".git", "frontend/node_modules", "frontend/dist", "frontend/wrapper/pkg"];
const EXCLUDED_DIRECTORIES: &[&str] = &["target", ".git", "frontend/node_modules", "frontend/dist", "frontend/wrapper/pkg", "tools"];
const INCLUDED_EXTENSIONS: &[&str] = &["rs"];
const DEBOUNCE: Duration = Duration::from_millis(500);
@@ -23,17 +23,16 @@ fn main() -> ExitCode {
return ExitCode::FAILURE;
}
};
println!("Watching for changes...");
loop {
std::thread::park();
}
}
pub struct WatchGuard {
struct WatchGuard {
_debouncer: Debouncer<RecommendedWatcher, RecommendedCache>,
}
pub fn watch(steps: impl IntoIterator<Item = Expression>) -> Result<WatchGuard, Error> {
fn watch(steps: impl IntoIterator<Item = Expression>) -> Result<WatchGuard, Error> {
let steps: Vec<Expression> = steps.into_iter().collect();
let root = std::env::current_dir()
.and_then(|p| p.canonicalize())