Skip to content

Commit

Permalink
Fail the build if xbuild fails (#41)
Browse files Browse the repository at this point in the history
* Fail the build if xbuild fails

* Debug log now redundant

* Add wasm-opt to release notes
  • Loading branch information
ascjones authored Feb 26, 2020
1 parent ec118ff commit 2e8f9e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Version 0.4.0 (2020-02-26)

- Minimize contract wasm binary size:
- Run `wasm-opt` on the contract Wasm binary.
- Uses [`cargo-xbuild`](https://github.com/rust-osdev/cargo-xbuild) to build custom sysroot crates without panic string
bloat.
- Automatically removes the `rlib` crate type from `Cargo.toml`, removing redundant metadata.
Expand Down
4 changes: 3 additions & 1 deletion src/cmd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ fn build_cargo_project(crate_metadata: &CrateMetadata, verbosity: Option<Verbosi
let exit_status = xargo_lib::build(args, "build", Some(config))
.map_err(|e| anyhow::anyhow!("{}", e))
.context("Building with xbuild")?;
log::debug!("xargo exit status: {:?}", exit_status);
if !exit_status.success() {
anyhow::bail!("xbuild failed with status {}", exit_status)
}
Ok(())
};

Expand Down

0 comments on commit 2e8f9e6

Please sign in to comment.