diff --git a/CHANGELOG.md b/CHANGELOG.md index 75b9caf83..550af78f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Fix installation instructions for `ink_linting` - [#1546](https://github.com/paritytech/cargo-contract/pull/1546) + ## [4.0.1] ### Fixed diff --git a/README.md b/README.md index b03cd3549..0fcfdd9c2 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,15 @@ Modern releases of gcc and clang, as well as Visual Studio 2019+ should work. - Step 2: `cargo install --force --locked cargo-contract`. -- Step 3: Install `dylint` for linting. +- Step 3: Install dependencies for linting. - (MacOS) `brew install openssl` - - `cargo install cargo-dylint dylint-link`. + - ``` + export TOOLCHAIN_VERSION=nightly-2023-12-28 + rustup install $TOOLCHAIN_VERSION + rustup component add rust-src --toolchain $TOOLCHAIN_VERSION + rustup run $TOOLCHAIN_VERSION cargo install cargo-dylint dylint-link + ``` - Step 4: (**Optional**) Install [Docker Engine](https://docs.docker.com/engine/install) to be able to produce verifiable builds. diff --git a/crates/build/src/lib.rs b/crates/build/src/lib.rs index b51cd68ba..b0ece9cb3 100644 --- a/crates/build/src/lib.rs +++ b/crates/build/src/lib.rs @@ -628,8 +628,11 @@ fn check_dylint_requirements(_working_dir: Option<&Path>) -> Result<()> { String::from_utf8_lossy(&output.stdout).contains(linting::TOOLCHAIN_VERSION), format!( "Toolchain `{0}` was not found!\n\ - This specific version is required to provide additional source code analysis.\n\n - You can install it by executing `rustup install {0}`.", + This specific version is required to provide additional source code analysis.\n\n\ + You can install it by executing:\n\ + rustup install {0}\n\ + rustup component add rust-src --toolchain {0}\n\ + rustup run {0} cargo install cargo-dylint dylint-link", linting::TOOLCHAIN_VERSION, ) .to_string() @@ -637,8 +640,11 @@ fn check_dylint_requirements(_working_dir: Option<&Path>) -> Result<()> { } else { anyhow::bail!(format!( "Toolchain `{0}` was not found!\n\ - This specific version is required to provide additional source code analysis.\n\n - Install `rustup` according to https://rustup.rs/ and then run: `rustup install {0}`.", + This specific version is required to provide additional source code analysis.\n\n\ + Install `rustup` according to https://rustup.rs/ and then run:\ + rustup install {0}\n\ + rustup component add rust-src --toolchain {0}\n\ + rustup run {0} cargo install cargo-dylint dylint-link", linting::TOOLCHAIN_VERSION, ) .to_string()