0

Problem Description I cloned the polkadot-v1.8.0 branch of the Frontier repository and am attempting to build the Substrate chain using Cargo. However, I'm encountering issues with mismatched library versions and Rust toolchain compatibility.

Steps to Reproduce

  1. git clone --branch polkadot-v1.8.0 https://github.com/polkadot-evm/frontier.git
  2. Remove the Cargo.lock file Or Add new library e.g, pallet-insecure-radomness-collective-flip
  3. Run cargo build --release to build the project

Error Details When I run the build, Cargo fetches the latest version of some dependencies, including scale-codec, which updates to version 3.7.0. However, the Cargo.toml file for the polkadot-v1.8.0 branch specifies a specific version, scale-codec = "3.6.4". This version mismatch is causing build issues, as the newer version of scale-codec requires Rust 1.79, while the rust-toolchain.toml file for this branch specifies Rust 1.77.

Error Encountered: When using Rust 1.77 (as specified in the rust-toolchain.toml file), the dependencies are resolved incorrectly (fetching version 3.7.0 instead of 3.6.4). When I manually upgrade to Rust 1.79 (by modifying the rust-toolchain.toml file), I encounter the following error:

error[E0658]: use of unstable library feature 'error_in_core'

The Cargo.toml specifies that the version for scale-codec should be 3.6.4:

scale-codec = { package = "parity-scale-codec", version = "3.6.4", default-features = false, features = ["derive"] }

However, when I build the project, Cargo pulls in version 3.7.0, causing the Rust version mismatch.

1 Answer 1

0
  1. Don't delete the Cargo.lock and use cargo .. --locked to prevent the dependencies update.
  2. If you go the "downgrade" approach and see use of unstable library feature 'error_in_core', try using a nightly toolchain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.