From d6cb5f1eeda6eac45d242b6a8077798cb70b0cb5 Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 19 Jun 2024 11:17:19 +0200 Subject: [PATCH 1/3] CI: update rust toolchain in workflows We decided to unify CI, and make use of latest stable version of rust toolchain for each of the workflows that actually uses it. The only exception is `Rust / min_rust` job, which uses MSRV. --- .github/workflows/authenticate_test.yml | 2 ++ .github/workflows/book.yml | 2 ++ .github/workflows/cassandra.yml | 2 ++ .github/workflows/rust.yml | 4 ++++ .github/workflows/semver_checks.yml | 4 ++++ .github/workflows/serverless.yaml | 3 ++- .github/workflows/tls.yml | 2 ++ 7 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/authenticate_test.yml b/.github/workflows/authenticate_test.yml index be2faaf789..b6a8251661 100644 --- a/.github/workflows/authenticate_test.yml +++ b/.github/workflows/authenticate_test.yml @@ -27,5 +27,7 @@ jobs: options: --health-cmd "cqlsh --username cassandra --password cassandra --debug" --health-interval 5s --health-retries 30 steps: - uses: actions/checkout@v3 + - name: Update rust toolchain + run: rustup update - name: Run tests run: RUST_LOG=trace cargo test --verbose authenticate_superuser -- custom_authentication --ignored diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index 7fed7200e4..4d3caa5062 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -27,6 +27,8 @@ jobs: options: --health-cmd "cqlsh --debug scylladb" --health-interval 5s --health-retries 10 steps: - uses: actions/checkout@v3 + - name: Update rust toolchain + run: rustup update - name: Install mdbook run: cargo install mdbook --no-default-features - name: Build the project diff --git a/.github/workflows/cassandra.yml b/.github/workflows/cassandra.yml index de8ed032bd..4926ece5d6 100644 --- a/.github/workflows/cassandra.yml +++ b/.github/workflows/cassandra.yml @@ -25,6 +25,8 @@ jobs: run: | docker compose -f test/cluster/cassandra/docker-compose.yml up -d --wait # A separate step for building to separate measuring time of compilation and testing + - name: Update rust toolchain + run: rustup update - name: Build the project run: cargo build --verbose --tests --features "full-serialization" - name: Run tests on cassandra diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bae8c8b8b1..d6f9fbfe5f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -26,6 +26,8 @@ jobs: run: | sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr" docker compose -f test/cluster/docker-compose.yml up -d --wait + - name: Update rust toolchain + run: rustup update - name: Print rustc version run: rustc --version - name: Print rustfmt version @@ -98,5 +100,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Update rust toolchain + run: rustup update - name: Compile docs run: RUSTDOCFLAGS=-Dwarnings cargo doc diff --git a/.github/workflows/semver_checks.yml b/.github/workflows/semver_checks.yml index 174d0aa409..976057b125 100644 --- a/.github/workflows/semver_checks.yml +++ b/.github/workflows/semver_checks.yml @@ -56,6 +56,8 @@ jobs: # I don't know any way to do this using checkout action - name: Fetch PR base run: git fetch origin "$PR_BASE" + - name: Update rust toolchain + run: rustup update - name: Install semver-checks # Official action uses binary releases fetched from GitHub # If this pipeline becomes too slow, we should do this too @@ -142,6 +144,8 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v3 + - name: Update rust toolchain + run: rustup update - name: Install semver-checks run: cargo install cargo-semver-checks --no-default-features - name: Run semver-checks to see if it agrees with version updates diff --git a/.github/workflows/serverless.yaml b/.github/workflows/serverless.yaml index 8edc70b821..e8ffc74d6c 100644 --- a/.github/workflows/serverless.yaml +++ b/.github/workflows/serverless.yaml @@ -29,7 +29,8 @@ jobs: run: | ccm create serverless -i 127.0.1. -n 1 --scylla -v release:5.1.6 ccm start --sni-proxy --sni-port 7777 - + - name: Update rust toolchain + run: rustup update - name: Check run: cargo check --verbose - name: Run cloud example diff --git a/.github/workflows/tls.yml b/.github/workflows/tls.yml index 94d3b4926c..65e0721b59 100644 --- a/.github/workflows/tls.yml +++ b/.github/workflows/tls.yml @@ -32,6 +32,8 @@ jobs: working-directory: ./scylla steps: - uses: actions/checkout@v3 + - name: Update rust toolchain + run: rustup update - name: Check run: cargo check --verbose --features "ssl" working-directory: ${{env.working-directory}} From cb332fa203891c9b5d98dd1ddf7933ff032113a9 Mon Sep 17 00:00:00 2001 From: muzarski Date: Tue, 18 Jun 2024 18:37:42 +0200 Subject: [PATCH 2/3] macros: clippy - allow manual unwrap_or_default Clippy complains about the code generated by `darling` crate. This commit silences clippy by allowing to perform manual unwrap_or_default. --- scylla-macros/src/serialize/row.rs | 3 +++ scylla-macros/src/serialize/value.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scylla-macros/src/serialize/row.rs b/scylla-macros/src/serialize/row.rs index fd4649dc56..4b1ff87433 100644 --- a/scylla-macros/src/serialize/row.rs +++ b/scylla-macros/src/serialize/row.rs @@ -1,3 +1,6 @@ +// See: https://github.com/TedDriggs/darling/issues/293 +#![allow(clippy::manual_unwrap_or_default)] + use std::collections::HashMap; use darling::FromAttributes; diff --git a/scylla-macros/src/serialize/value.rs b/scylla-macros/src/serialize/value.rs index 8d2d72044d..b096df7eb9 100644 --- a/scylla-macros/src/serialize/value.rs +++ b/scylla-macros/src/serialize/value.rs @@ -1,3 +1,6 @@ +// See: https://github.com/TedDriggs/darling/issues/293 +#![allow(clippy::manual_unwrap_or_default)] + use std::collections::HashMap; use darling::FromAttributes; From c531974040b27f261e6387557d3b59cc5f70a3f0 Mon Sep 17 00:00:00 2001 From: muzarski Date: Tue, 18 Jun 2024 18:42:07 +0200 Subject: [PATCH 3/3] connection: stop using legacy numeric constant Clippy complains about using `std::i16::MAX`, instead of `i16::MAX`. This commit fixes the issue. --- scylla/src/transport/connection.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scylla/src/transport/connection.rs b/scylla/src/transport/connection.rs index d34824f97e..cd225aae55 100644 --- a/scylla/src/transport/connection.rs +++ b/scylla/src/transport/connection.rs @@ -1826,7 +1826,7 @@ struct StreamIdSet { impl StreamIdSet { fn new() -> Self { - const BITMAP_SIZE: usize = (std::i16::MAX as usize + 1) / 64; + const BITMAP_SIZE: usize = (i16::MAX as usize + 1) / 64; Self { used_bitmap: vec![0; BITMAP_SIZE].into_boxed_slice(), }