From 03afec9283b53e5eea47e1cca95ac6520ee4e494 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Thu, 20 Feb 2025 21:00:34 +0100 Subject: [PATCH 01/10] Update Rust version and revision --- examples/rust/Cargo.toml | 2 +- examples/rust/clippy.toml | 3 ++- examples/rust/rust-toolchain.toml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/rust/Cargo.toml b/examples/rust/Cargo.toml index cd92e7316..43d4cc06f 100644 --- a/examples/rust/Cargo.toml +++ b/examples/rust/Cargo.toml @@ -8,7 +8,7 @@ members = [ [workspace.package] version = "0.0.1" license = "MIT OR Apache-2.0" -edition = "2021" +edition = "2024" [workspace.lints.rust] warnings = "deny" diff --git a/examples/rust/clippy.toml b/examples/rust/clippy.toml index caa289b27..67c6e5f1d 100644 --- a/examples/rust/clippy.toml +++ b/examples/rust/clippy.toml @@ -1,4 +1,5 @@ allow-unwrap-in-tests = true allow-expect-in-tests = true allow-panic-in-tests = true -arithmetic-side-effects-allowed = ["num_bigint::BigInt"] +allow-indexing-slicing-in-tests = true +arithmetic-side-effects-allowed = ["num_bigint::BigInt", "cardano_blockchain_types::Slot"] diff --git a/examples/rust/rust-toolchain.toml b/examples/rust/rust-toolchain.toml index eb1d97945..5bedd373f 100644 --- a/examples/rust/rust-toolchain.toml +++ b/examples/rust/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.83" -profile = "default" \ No newline at end of file +channel = "1.85" +profile = "default" From d0ae1f68e22682d24bd9529a2fd22eecc96d97e0 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Thu, 20 Feb 2025 22:37:08 +0100 Subject: [PATCH 02/10] Apply formatting from 2024 edition --- examples/rust/crates/foo/benches/benchmark.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rust/crates/foo/benches/benchmark.rs b/examples/rust/crates/foo/benches/benchmark.rs index 676602d37..6bb77bdfd 100644 --- a/examples/rust/crates/foo/benches/benchmark.rs +++ b/examples/rust/crates/foo/benches/benchmark.rs @@ -1,5 +1,5 @@ //! Simple benchmark example -use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use criterion::{Criterion, black_box, criterion_group, criterion_main}; /// fibonacci calculates the nth fibonacci number fn fibonacci(n: u64) -> u64 { From ab0a9e72d3e4a51297154f246638ca66f2f62818 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Thu, 20 Feb 2025 23:02:36 +0100 Subject: [PATCH 03/10] Update editions in standard configs --- earthly/rust/stdcfgs/cargo_manifest/project.toml | 2 +- earthly/rust/stdcfgs/cargo_manifest/workspace.toml | 2 +- earthly/rust/stdcfgs/clippy.toml | 3 ++- earthly/rust/stdcfgs/rust-toolchain.toml | 4 ++-- earthly/rust/stdcfgs/rustfmt.toml | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/earthly/rust/stdcfgs/cargo_manifest/project.toml b/earthly/rust/stdcfgs/cargo_manifest/project.toml index f9a409dce..7540160f6 100644 --- a/earthly/rust/stdcfgs/cargo_manifest/project.toml +++ b/earthly/rust/stdcfgs/cargo_manifest/project.toml @@ -1,5 +1,5 @@ [package] -edition = "2021" +edition = "2024" [lints.rust] warnings = "deny" diff --git a/earthly/rust/stdcfgs/cargo_manifest/workspace.toml b/earthly/rust/stdcfgs/cargo_manifest/workspace.toml index a7d731c43..4f9e1bfd6 100644 --- a/earthly/rust/stdcfgs/cargo_manifest/workspace.toml +++ b/earthly/rust/stdcfgs/cargo_manifest/workspace.toml @@ -1,5 +1,5 @@ [workspace.package] -edition = "2021" +edition = "2024" [workspace.lints.rust] warnings = "deny" diff --git a/earthly/rust/stdcfgs/clippy.toml b/earthly/rust/stdcfgs/clippy.toml index caa289b27..67c6e5f1d 100644 --- a/earthly/rust/stdcfgs/clippy.toml +++ b/earthly/rust/stdcfgs/clippy.toml @@ -1,4 +1,5 @@ allow-unwrap-in-tests = true allow-expect-in-tests = true allow-panic-in-tests = true -arithmetic-side-effects-allowed = ["num_bigint::BigInt"] +allow-indexing-slicing-in-tests = true +arithmetic-side-effects-allowed = ["num_bigint::BigInt", "cardano_blockchain_types::Slot"] diff --git a/earthly/rust/stdcfgs/rust-toolchain.toml b/earthly/rust/stdcfgs/rust-toolchain.toml index eb1d97945..5bedd373f 100644 --- a/earthly/rust/stdcfgs/rust-toolchain.toml +++ b/earthly/rust/stdcfgs/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.83" -profile = "default" \ No newline at end of file +channel = "1.85" +profile = "default" diff --git a/earthly/rust/stdcfgs/rustfmt.toml b/earthly/rust/stdcfgs/rustfmt.toml index 905bde2d0..18fac85ed 100644 --- a/earthly/rust/stdcfgs/rustfmt.toml +++ b/earthly/rust/stdcfgs/rustfmt.toml @@ -21,7 +21,7 @@ unstable_features = true # Compatibility: -edition = "2021" +edition = "2024" # Tabs & spaces - Defaults, listed for clarity tab_spaces = 4 From 2dcc770ccafe1a674c7f3706acff3a69a4de891b Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Thu, 20 Feb 2025 23:04:57 +0100 Subject: [PATCH 04/10] Fix --- examples/rust/rustfmt.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rust/rustfmt.toml b/examples/rust/rustfmt.toml index 905bde2d0..18fac85ed 100644 --- a/examples/rust/rustfmt.toml +++ b/examples/rust/rustfmt.toml @@ -21,7 +21,7 @@ unstable_features = true # Compatibility: -edition = "2021" +edition = "2024" # Tabs & spaces - Defaults, listed for clarity tab_spaces = 4 From 4474954701400d6df2ba74db3ab499badaf3eec5 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Thu, 20 Feb 2025 23:11:37 +0100 Subject: [PATCH 05/10] Update rust version in earthly --- earthly/rust/Earthfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/earthly/rust/Earthfile b/earthly/rust/Earthfile index 5d7aa3212..ee4d75384 100644 --- a/earthly/rust/Earthfile +++ b/earthly/rust/Earthfile @@ -31,7 +31,7 @@ rust-base: # This is our base Host toolset, and rustup. # Never use `rust-toolchain.toml` in CI as it breaks builds. # The only toolchain supported is the one installed here. - FROM rust:1.83.0-slim-bookworm + FROM rust:1.85.0-slim-bookworm WORKDIR /root @@ -365,7 +365,7 @@ REMOVE_SOURCE_FINGERPRINTS: # TODO(bkioshn): https://github.com/input-output-hk/catalyst-ci/issues/322 # Installing Rust -# Code reference from [rust1.83.0-slim-bookworm](https://github.com/rust-lang/docker-rust/blob/63f877a36f8ba9d9b4b35cd49df3327264510886/stable/bookworm/slim/Dockerfile) +# Code reference from [rust1.85.0-slim-bookworm](https://github.com/rust-lang/docker-rust/blob/63f877a36f8ba9d9b4b35cd49df3327264510886/stable/bookworm/slim/Dockerfile) INSTALL_RUST: FUNCTION @@ -374,7 +374,7 @@ INSTALL_RUST: ENV RUSTUP_HOME=/usr/local/rustup ENV CARGO_HOME=/usr/local/cargo ENV PATH=/usr/local/cargo/bin:$PATH - ENV RUST_VERSION=1.83.0 + ENV RUST_VERSION=1.85.0 IF [ "$TARGETARCH" = "amd64" ] LET PLATFORM = "x86_64-unknown-linux-gnu" From 8cbc029bcbd945153ff3f60adbfdb6dc446a50e5 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Fri, 21 Feb 2025 09:30:19 +0100 Subject: [PATCH 06/10] Update link --- earthly/rust/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthly/rust/Earthfile b/earthly/rust/Earthfile index ee4d75384..e584d8a11 100644 --- a/earthly/rust/Earthfile +++ b/earthly/rust/Earthfile @@ -365,7 +365,7 @@ REMOVE_SOURCE_FINGERPRINTS: # TODO(bkioshn): https://github.com/input-output-hk/catalyst-ci/issues/322 # Installing Rust -# Code reference from [rust1.85.0-slim-bookworm](https://github.com/rust-lang/docker-rust/blob/63f877a36f8ba9d9b4b35cd49df3327264510886/stable/bookworm/slim/Dockerfile) +# Code reference from [rust1.85.0-slim-bookworm](https://github.com/rust-lang/docker-rust/blob/7001c1a7a222d985a13582ec652f500a3cd40f89/stable/bookworm/slim/Dockerfile) INSTALL_RUST: FUNCTION From 5ae1949c01db03a04eda7c5332b423ab14ed1145 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Fri, 21 Feb 2025 09:44:56 +0100 Subject: [PATCH 07/10] Update cargo-deny version --- earthly/rust/tools/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthly/rust/tools/Earthfile b/earthly/rust/tools/Earthfile index a24b19646..bb20d3c34 100644 --- a/earthly/rust/tools/Earthfile +++ b/earthly/rust/tools/Earthfile @@ -53,7 +53,7 @@ tool-refinery: DO +CARGO_BINSTALL --package=refinery_cli --version=0.8.14 --executable=refinery tool-cargo-deny: - DO +CARGO_BINSTALL --package=cargo-deny --version=0.16.1 + DO +CARGO_BINSTALL --package=cargo-deny --version=0.17.0 tool-cargo-modules: DO +CARGO_BINSTALL --package=cargo-modules --version=0.17.0 --test_param="--help" From 8953d6b46404357c425b0190ed62856213efef9c Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Fri, 21 Feb 2025 09:48:00 +0100 Subject: [PATCH 08/10] Remove slot from exceptions --- earthly/rust/stdcfgs/clippy.toml | 2 +- examples/rust/clippy.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/earthly/rust/stdcfgs/clippy.toml b/earthly/rust/stdcfgs/clippy.toml index 67c6e5f1d..a03fd62fd 100644 --- a/earthly/rust/stdcfgs/clippy.toml +++ b/earthly/rust/stdcfgs/clippy.toml @@ -2,4 +2,4 @@ allow-unwrap-in-tests = true allow-expect-in-tests = true allow-panic-in-tests = true allow-indexing-slicing-in-tests = true -arithmetic-side-effects-allowed = ["num_bigint::BigInt", "cardano_blockchain_types::Slot"] +arithmetic-side-effects-allowed = ["num_bigint::BigInt"] diff --git a/examples/rust/clippy.toml b/examples/rust/clippy.toml index 67c6e5f1d..a03fd62fd 100644 --- a/examples/rust/clippy.toml +++ b/examples/rust/clippy.toml @@ -2,4 +2,4 @@ allow-unwrap-in-tests = true allow-expect-in-tests = true allow-panic-in-tests = true allow-indexing-slicing-in-tests = true -arithmetic-side-effects-allowed = ["num_bigint::BigInt", "cardano_blockchain_types::Slot"] +arithmetic-side-effects-allowed = ["num_bigint::BigInt"] From dcb9daa592dbfa3fb18d7574a5ecff02f6206cbf Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Fri, 21 Feb 2025 21:36:41 +0100 Subject: [PATCH 09/10] Remove the resolver version in examples --- examples/rust/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/rust/Cargo.toml b/examples/rust/Cargo.toml index 43d4cc06f..241b44f52 100644 --- a/examples/rust/Cargo.toml +++ b/examples/rust/Cargo.toml @@ -1,5 +1,4 @@ [workspace] -resolver = "2" members = [ "crates/foo", "crates/bar", From 7eb6f78e9efa4e2e246fd33c8ac5a86aef38ffd3 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Fri, 21 Feb 2025 22:36:20 +0100 Subject: [PATCH 10/10] Use resolver 3 explicitly --- examples/rust/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/rust/Cargo.toml b/examples/rust/Cargo.toml index 241b44f52..f2f93da87 100644 --- a/examples/rust/Cargo.toml +++ b/examples/rust/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "3" members = [ "crates/foo", "crates/bar",