wasm-builder: Disable building when running on docs.rs (#1540)

This pull request changes the `wasm-builder` to skip building the wasm
files when the build process is running on docs.rs.
This commit is contained in:
Bastian Köcher
2023-09-13 21:53:05 +02:00
committed by GitHub
parent 61be78c621
commit f1994c8690
+4 -1
View File
@@ -203,7 +203,10 @@ fn generate_crate_skip_build_env_name() -> String {
/// Checks if the build of the WASM binary should be skipped.
fn check_skip_build() -> bool {
env::var(crate::SKIP_BUILD_ENV).is_ok() ||
env::var(generate_crate_skip_build_env_name()).is_ok()
env::var(generate_crate_skip_build_env_name()).is_ok() ||
// If we are running in docs.rs, let's skip building.
// https://docs.rs/about/builds#detecting-docsrs
env::var("DOCS_RS").is_ok()
}
/// Provide a dummy WASM binary if there doesn't exist one.