diff --git a/crates/augurs-prophet/build.rs b/crates/augurs-prophet/build.rs index 9b127c4..d68dca6 100644 --- a/crates/augurs-prophet/build.rs +++ b/crates/augurs-prophet/build.rs @@ -126,8 +126,18 @@ fn copy_wasmstan() -> Result<(), Box> { } fn handle_wasmstan() -> Result<(), Box> { + let _result = Ok::<(), Box>(()); #[cfg(feature = "wasmstan")] - copy_wasmstan()?; + let _result = copy_wasmstan(); + + if std::env::var("DOCS_RS").is_ok() { + // In docs.rs we won't have (or need) the wasmstan file in the current directory, + // so we should just create an empty one so the build doesn't fail. + create_empty_files(&["prophet-wasmstan.wasm"])?; + } else { + // Otherwise, fail the build if there was an error. + _result?; + } Ok(()) }