From 04cb965769a79d2f1a0b1e1d1ab7b942e7b3708a Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Wed, 7 Feb 2024 16:29:42 +0100 Subject: [PATCH 01/10] Add workaround for ismd issue --- .github/workflows/ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a937ffe3..70ec93d43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -176,14 +176,18 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Install nightly toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2024-02-07 + - name: Install stable toolchain uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2023-12-28 + toolchain: stable default: true - target: wasm32-unknown-unknown - components: rust-src, clippy - name: Cache uses: Swatinem/rust-cache@v2 From cc4e6ae02c62d15db1f91a0ed293f073a6ffd866 Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Wed, 7 Feb 2024 16:43:08 +0100 Subject: [PATCH 02/10] Add rust-src toolchain component --- .github/workflows/ci.yml | 1 + crates/build/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70ec93d43..a3f5bfb2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,6 +188,7 @@ jobs: profile: minimal toolchain: stable default: true + components: rust-src - name: Cache uses: Swatinem/rust-cache@v2 diff --git a/crates/build/src/lib.rs b/crates/build/src/lib.rs index b6189f07c..9fcec4805 100644 --- a/crates/build/src/lib.rs +++ b/crates/build/src/lib.rs @@ -116,7 +116,7 @@ const VERSION: &str = env!("CARGO_PKG_VERSION"); pub(crate) mod linting { /// Toolchain used to build ink_linting: /// https://github.com/paritytech/ink/blob/master/linting/rust-toolchain.toml - pub const TOOLCHAIN_VERSION: &str = "nightly-2023-12-28"; + pub const TOOLCHAIN_VERSION: &str = "nightly-2024-02-07"; /// Git repository with ink_linting libraries pub const GIT_URL: &str = "https://github.com/paritytech/ink/"; /// Git revision number of the linting crate From 375f162fef2279530868fa831fc4c274feb37f53 Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Wed, 7 Feb 2024 17:13:58 +0100 Subject: [PATCH 03/10] Add lint to build command --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3f5bfb2a..a126460f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,6 +181,7 @@ jobs: with: profile: minimal toolchain: nightly-2024-02-07 + components: cargo-dylint, dylint-link - name: Install stable toolchain uses: actions-rs/toolchain@v1 @@ -198,6 +199,6 @@ jobs: cargo -vV && cargo run --profile debug-ci -- contract --version && cargo run --profile debug-ci -- contract new --target-dir ${{ runner.temp }} foobar && - cargo run --profile debug-ci -- contract build --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && + cargo run --profile debug-ci -- contract build --lint --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && cargo run --profile debug-ci -- contract check --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && cargo run --profile debug-ci -- contract build --manifest-path=${{ runner.temp }}/foobar/Cargo.toml --release From 5440540047659310ba1325fdd545edd199fed564 Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Wed, 7 Feb 2024 17:59:52 +0100 Subject: [PATCH 04/10] Toolchain revert --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a126460f3..ffc092b0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,7 +180,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2024-02-07 + toolchain: nightly-2023-12-28 components: cargo-dylint, dylint-link - name: Install stable toolchain @@ -199,6 +199,8 @@ jobs: cargo -vV && cargo run --profile debug-ci -- contract --version && cargo run --profile debug-ci -- contract new --target-dir ${{ runner.temp }} foobar && - cargo run --profile debug-ci -- contract build --lint --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && + # Disable linting due to issue with stdismd + #cargo run --profile debug-ci -- contract build --lint --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && + cargo run --profile debug-ci -- contract build --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && cargo run --profile debug-ci -- contract check --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && cargo run --profile debug-ci -- contract build --manifest-path=${{ runner.temp }}/foobar/Cargo.toml --release From 52012e5797ce491dcb4584060e4cf3ddccf8532e Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Wed, 7 Feb 2024 18:01:49 +0100 Subject: [PATCH 05/10] Revert toolchain in code --- crates/build/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/build/src/lib.rs b/crates/build/src/lib.rs index 9fcec4805..b6189f07c 100644 --- a/crates/build/src/lib.rs +++ b/crates/build/src/lib.rs @@ -116,7 +116,7 @@ const VERSION: &str = env!("CARGO_PKG_VERSION"); pub(crate) mod linting { /// Toolchain used to build ink_linting: /// https://github.com/paritytech/ink/blob/master/linting/rust-toolchain.toml - pub const TOOLCHAIN_VERSION: &str = "nightly-2024-02-07"; + pub const TOOLCHAIN_VERSION: &str = "nightly-2023-12-28"; /// Git repository with ink_linting libraries pub const GIT_URL: &str = "https://github.com/paritytech/ink/"; /// Git revision number of the linting crate From f33e13e90f2d0aa8ef460e7c07539d8a2ba44eec Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Wed, 7 Feb 2024 18:12:54 +0100 Subject: [PATCH 06/10] Fix components --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffc092b0c..8b0111871 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,7 +181,6 @@ jobs: with: profile: minimal toolchain: nightly-2023-12-28 - components: cargo-dylint, dylint-link - name: Install stable toolchain uses: actions-rs/toolchain@v1 @@ -189,7 +188,7 @@ jobs: profile: minimal toolchain: stable default: true - components: rust-src + components: rust-src, cargo-dylint, dylint-link - name: Cache uses: Swatinem/rust-cache@v2 From 6d11368b86d696a5a9b469fd102b146d9f903865 Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Wed, 7 Feb 2024 18:20:17 +0100 Subject: [PATCH 07/10] Install dylint crates --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b0111871..6ec2e804d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,13 +188,15 @@ jobs: profile: minimal toolchain: stable default: true - components: rust-src, cargo-dylint, dylint-link + components: rust-src - name: Cache uses: Swatinem/rust-cache@v2 - name: Check Template run: >- + # The linter requires two crates + cargo install cargo-dylint dylint-link cargo -vV && cargo run --profile debug-ci -- contract --version && cargo run --profile debug-ci -- contract new --target-dir ${{ runner.temp }} foobar && From 59f7370f8dc88cce47d3315f02c4042ffa55cc97 Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Wed, 7 Feb 2024 18:24:44 +0100 Subject: [PATCH 08/10] fix typo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ec2e804d..7f307911f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,7 +200,7 @@ jobs: cargo -vV && cargo run --profile debug-ci -- contract --version && cargo run --profile debug-ci -- contract new --target-dir ${{ runner.temp }} foobar && - # Disable linting due to issue with stdismd + # Disable linting due to issue with stdsimd #cargo run --profile debug-ci -- contract build --lint --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && cargo run --profile debug-ci -- contract build --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && cargo run --profile debug-ci -- contract check --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && From ca49bf39e22183dbd460c0308323686fb31a7ffe Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Mon, 12 Feb 2024 12:49:44 +0100 Subject: [PATCH 09/10] Add test with use of nightly compiler --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f307911f..f0760aec2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,8 +200,8 @@ jobs: cargo -vV && cargo run --profile debug-ci -- contract --version && cargo run --profile debug-ci -- contract new --target-dir ${{ runner.temp }} foobar && - # Disable linting due to issue with stdsimd - #cargo run --profile debug-ci -- contract build --lint --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && cargo run --profile debug-ci -- contract build --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && + # build with linting, nightly toolchain is used + cargo run --profile debug-ci -- contract build --lint --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && cargo run --profile debug-ci -- contract check --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && cargo run --profile debug-ci -- contract build --manifest-path=${{ runner.temp }}/foobar/Cargo.toml --release From e097889af3ff554ae5b1eceba52771e439d1a107 Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Mon, 12 Feb 2024 14:38:18 +0100 Subject: [PATCH 10/10] Remove build without linting --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0760aec2..fdf2d01cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,8 +200,7 @@ jobs: cargo -vV && cargo run --profile debug-ci -- contract --version && cargo run --profile debug-ci -- contract new --target-dir ${{ runner.temp }} foobar && - cargo run --profile debug-ci -- contract build --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && - # build with linting, nightly toolchain is used + # Build with linting cargo run --profile debug-ci -- contract build --lint --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && cargo run --profile debug-ci -- contract check --manifest-path=${{ runner.temp }}/foobar/Cargo.toml && cargo run --profile debug-ci -- contract build --manifest-path=${{ runner.temp }}/foobar/Cargo.toml --release