Skip to content

Commit

Permalink
Enable Wasm sign_ext (#1189)
Browse files Browse the repository at this point in the history
* Enable Wasm sign_ext

* Bump substrate crates

* Add warning when building with new rustc

* Stable toolchain

* Revert "Stable toolchain"

This reverts commit aa2a2e6.

---------

Co-authored-by: Andrew Jones <ascjones@gmail.com>
  • Loading branch information
athei and ascjones committed Aug 21, 2023
1 parent 6a5ed49 commit ed2c687
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ rustc_version = "0.4.0"
scale = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"] }
toml = "0.7.3"
tracing = "0.1.37"
parity-wasm = "0.45.0"
parity-wasm = { version = "0.45.0", features = ["sign_ext"] }
semver = { version = "1.0.17", features = ["serde"] }
serde = { version = "1", default-features = false, features = ["derive"] }
serde_json = "1.0.96"
Expand Down
12 changes: 12 additions & 0 deletions crates/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ fn exec_cargo_for_onchain_target(
// Allow nightly features on a stable toolchain
env.push(("RUSTC_BOOTSTRAP", Some("1".to_string())))
}

// newer rustc versions might emit unsupported instructions
if rustc_version::version_meta()?.semver >= Version::new(1, 70, 0) {
maybe_println!(
verbosity,
"{} {}",
"warning:".yellow().bold(),
"You are using a rustc version that might emit unsupported wasm instructions. Build using a version lower than 1.70.0 to make sure your contract will deploy."
.bold()
);
}

// the linker needs our linker script as file
let rustflags = target.rustflags();
if matches!(target, Target::RiscV) {
Expand Down
4 changes: 2 additions & 2 deletions crates/transcode/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ thiserror = "1.0.40"
[dev-dependencies]
assert_matches = "1.5.0"
ink = "4.2.0"
sp-core = "20.0.0"
sp-keyring = "23.0.0"
sp-core = "21.0.0"
sp-keyring = "24.0.0"

[features]
# This `std` feature is required for testing using an inline contract's metadata, because `ink!` annotates the metadata
Expand Down

0 comments on commit ed2c687

Please sign in to comment.