()
| 79 | steps.push(cmd!("wasm-opt", "-O3", "-g", &wasm_file, "-o", &wasm_file)); |
| 80 | } |
| 81 | |
| 82 | steps |
| 83 | } |
| 84 | |
| 85 | pub fn clean_wasm() -> bool { |
| 86 | let wasm_target_dir = target_dir().join(WASM_TARGET); |
| 87 | eprintln!("The Wasm build emitted undefined `env` imports, a sign of corrupt incremental artifacts (typically from an interrupted build)."); |
| 88 | eprintln!("Fixing by wiping `{}` and rebuilding...", wasm_target_dir.display()); |
| 89 | match std::fs::remove_dir_all(&wasm_target_dir) { |
| 90 | Ok(()) => {} |
| 91 | Err(e) if e.kind() == std::io::ErrorKind::NotFound => {} |
| 92 | Err(e) => eprintln!("warning: could not fully clean `{}`: {e}", wasm_target_dir.display()), |
| 93 | } |
| 94 | true |
nothing calls this directly
no test coverage detected