Skip to content

Commit

Permalink
wasm-builder: Disable building when running on docs.rs (#1540)
Browse files Browse the repository at this point in the history
This pull request changes the `wasm-builder` to skip building the wasm
files when the build process is running on docs.rs.
  • Loading branch information
bkchr authored Sep 13, 2023
1 parent 61be78c commit f1994c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion substrate/utils/wasm-builder/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f1994c8

Please sign in to comment.