From 54641e6fd496b410470d45d098085400fbfb4814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Demay?= Date: Thu, 21 May 2026 14:15:33 +0000 Subject: [PATCH 1/2] chore: add mise for unified tool versioning Replace the bespoke `taiki-e/install-action` step for cargo-sort and the `cargo install canbench` step with a single `jdx/mise-action` step driven by a new `mise.toml` pinning Rust, cargo-sort, and canbench. Local development uses the same versions via `mise install`, addressing DEFI-2821. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 20 +++++++++++++------- README.md | 19 ++++++++++++------- mise.toml | 4 ++++ 3 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 mise.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55b816af..d69fb661 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,17 +22,19 @@ jobs: - name: 'Checkout' uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - name: 'Setup mise' + uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 + with: + # Disable cache to avoid issues with wasm32 target + # See https://github.com/jdx/mise-action/issues/215 + cache: false + - name: 'Check code' run: | cargo fmt --all -- --check cargo clippy --locked --verbose --tests --benches --workspace -- -D clippy::all cargo clippy --locked --verbose --target wasm32-unknown-unknown -p cksol_minter -- -D clippy::all - - name: 'Install cargo-sort' - uses: taiki-e/install-action@97a5807a604e12de3a13b52d868ebecaeeea757c # v2.75.4 - with: - tool: cargo-sort@2.0.1 - - name: 'Check Cargo.toml' run: cargo sort --workspace --check @@ -72,8 +74,12 @@ jobs: - name: 'Checkout' uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: 'Install canbench' - run: cargo install canbench --version 0.4.1 --locked + - name: 'Setup mise' + uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 + with: + # Disable cache to avoid issues with wasm32 target + # See https://github.com/jdx/mise-action/issues/215 + cache: false - name: 'Run benchmarks' run: cd minter && canbench --less-verbose diff --git a/README.md b/README.md index 5e37b8f6..fae4fa41 100644 --- a/README.md +++ b/README.md @@ -243,17 +243,22 @@ icp canister call -e prod cksol_minter withdrawal_status \ ### Prerequisites -- [Rust](https://rustup.rs/) — the correct toolchain version is pinned in `rust-toolchain.toml`. -- [`ic-wasm`](https://github.com/dfinity/ic-wasm) version 0.3.5 — used for Wasm post-processing. -- `jq` — used by `./scripts/build` to generate Wasm metadata. -- `gzip` — used by `./scripts/build` to compress the output Wasm. - -Install the Rust toolchain and `ic-wasm` by running: +Install [`mise`](https://mise.jdx.dev/) and then provision the pinned toolchain +(Rust 1.93.0 with the `wasm32-unknown-unknown` target, `cargo-sort`, `canbench`): ```sh -./scripts/bootstrap +mise install ``` +Tool versions are defined in [`mise.toml`](./mise.toml) so local and CI +environments stay in sync. + +Additionally: + +- [`ic-wasm`](https://github.com/dfinity/ic-wasm) version 0.3.5 — used for Wasm post-processing. Install via `./scripts/bootstrap`. +- `jq` — used by `./scripts/build` to generate Wasm metadata. +- `gzip` — used by `./scripts/build` to compress the output Wasm. + ### Building Build the minter Wasm: diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000..433ce964 --- /dev/null +++ b/mise.toml @@ -0,0 +1,4 @@ +[tools] +rust = { version = "1.93.0", components = "rustfmt,clippy", targets = "wasm32-unknown-unknown" } +"cargo:cargo-sort" = "2.0.1" +"cargo:canbench" = "0.4.1" From f6a4a78e993b2cb6c51876dff70d26234aa9f93f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Demay?= Date: Fri, 22 May 2026 07:47:13 +0000 Subject: [PATCH 2/2] chore: rely on rust-toolchain.toml for Rust version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the duplicate `rust = …` pin from `mise.toml` and enable mise's idiomatic-version-file setting so the Rust version is read from `rust-toolchain.toml`. Addresses review feedback on dfinity/evm-rpc-canister#589. Co-Authored-By: Claude Opus 4.7 (1M context) --- mise.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index 433ce964..fe7d2868 100644 --- a/mise.toml +++ b/mise.toml @@ -1,4 +1,6 @@ [tools] -rust = { version = "1.93.0", components = "rustfmt,clippy", targets = "wasm32-unknown-unknown" } "cargo:cargo-sort" = "2.0.1" "cargo:canbench" = "0.4.1" + +[settings] +idiomatic_version_file_enable_tools = ["rust"]