Skip to content

Commit

Permalink
Fix wasm-builder not exiting if compilation fails (paritytech#3439)
Browse files Browse the repository at this point in the history
This PR fixes a subtle bug in `wasm-builder` first introduced in
paritytech#1851 (sorry, my bad! I
should have caught this during review) where the status code of the
`cargo` subprocess is not properly checked, which results in builds
silently succeeding when they shouldn't (that is: if we successfully
build a runtime blob, and then modify the code so that it won't compile,
and recompile it again, then the build will succeed and silently use the
*old* blob).

cc @athei This is the bug you were seeing.

[edit]Also fixes a similar PolkaVM-specific bug where I accidentally
used the wrong comparison operator.[/edit]
  • Loading branch information
koute authored and girazoki committed Feb 22, 2024
1 parent 78b3dc9 commit 2d54310
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion substrate/utils/wasm-builder/src/wasm_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ fn build_bloaty_blob(
println!("{} {}", colorize_info_message("Using rustc version:"), cargo_cmd.rustc_version());

// Use `process::exit(1)` to have a clean error output.
if build_cmd.status().map(|s| s.success()).is_err() {
if !matches!(build_cmd.status().map(|s| s.success()), Ok(true)) {
process::exit(1);
}
}
Expand Down

0 comments on commit 2d54310

Please sign in to comment.