diff --git a/CHANGELOG.md b/CHANGELOG.md index f98c3e79d0b61ad4a401948f15994e4560463e95..13fc238a6d36eaf3771278171e611b3694c4aff0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# Version 0.6.1 (2020-05-12) + +- Fix LTO regressions in nightly toolchain [#52](https://github.com/paritytech/cargo-contract/pull/52) + # Version 0.6.0 (2020-03-25) - First release to crates.io diff --git a/Cargo.lock b/Cargo.lock index 1679b110405c45aa00937f3a964978ef4222c42f..583740a0981fb78b9416e019a85de385bf885218 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -288,7 +288,7 @@ checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" [[package]] name = "cargo-contract" -version = "0.6.0" +version = "0.6.1" dependencies = [ "anyhow", "assert_matches", @@ -320,9 +320,9 @@ dependencies = [ [[package]] name = "cargo-xbuild" -version = "0.5.28" +version = "0.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cf1fcfab5ef1b3aeacb5bc16c248ecc4ef9e3e81ed96087e3801b81b305ca0" +checksum = "c6c11ec6bf11f95578c3698b9dab2d605df796e32886d65431b87a434691b8c5" dependencies = [ "cargo_metadata", "error-chain", diff --git a/Cargo.toml b/Cargo.toml index fe4d4e62eee717c8cf3a76e038ba3a0781b0d220..603a7be47546dbe0ae4ebbf3c05d1c58938273b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-contract" -version = "0.6.0" +version = "0.6.1" authors = ["Parity Technologies "] build = "build.rs" edition = "2018" @@ -29,7 +29,7 @@ codec = { package = "parity-scale-codec", version = "1.2" } which = "3.1.0" colored = "1.9" toml = "0.5.4" -cargo-xbuild = "0.5.26" +cargo-xbuild = "0.5.31" rustc_version = "0.2.3" serde_json = "1.0" tempfile = "3.1.0" diff --git a/src/cmd/build.rs b/src/cmd/build.rs index 0537b19af4b7fccdf1ee09e9728bf8b298801d28..ea25295ebf802fed95b214130a445da7f54ec0a4 100644 --- a/src/cmd/build.rs +++ b/src/cmd/build.rs @@ -138,7 +138,9 @@ fn build_cargo_project(crate_metadata: &CrateMetadata, verbosity: Option Result<&mut Self> { + let profile = self + .toml + .entry("profile") + .or_insert(value::Value::Table(Default::default())); + let release = profile + .as_table_mut() + .ok_or(anyhow::anyhow!("profile should be a table"))? + .entry("release") + .or_insert(value::Value::Table(Default::default())); + let lto = release + .as_table_mut() + .ok_or(anyhow::anyhow!("release should be a table"))? + .entry("lto") + .or_insert(enabled.into()); + *lto = enabled.into(); + Ok(self) + } + /// Remove a value from the `[lib] crate-types = []` section /// /// If the value does not exist, does nothing.