[PATCH v2 0/6] ci: improvements to our Rust infrastructure
From: Patrick Steinhardt <hidden>
Date: 2025-10-08 06:27:28
Hi, this small patch series introduces some improvements for our Rust infrastructure. Most importantly, it introduces a couple of static analysis checks to verify consistent formatting, use Clippy for linting and to verify our minimum supported Rust version. Furthermore, this series also introduces support for building with Rust enabled on Windows. The series is built on top of 45547b60ac (Merge branch 'master' of https://github.com/j6t/gitk, 2025-10-05) with ps/rust-balloon at e425c40aa0 (ci: enable Rust for breaking-changes jobs, 2025-10-02) and ps/gitlab-ci-windows-improvements at 3c4925c3f5 (t8020: fix test failure due to indeterministic tag sorting, 2025-10-02) merged into it. Changes in v2: - Adjust comments for `encode_varint()` and `decode_varint()` based on brian's feedback. - Some small improvements to commit messages. - Not changed is the default column limit used by Rust. I think using the column limit of 100 used by the Rust ecosystem is sensible, but if there is a majority advocating for a limit of 80 I'll adapt this. - Link to v1: https://lore.kernel.org/r/20251007-b4-pks-ci-rust-v1-0-394502abe7ea@pks.im (local) Thanks! Patrick --- Patrick Steinhardt (6): ci: deduplicate calls to `apt-get update` ci: check formatting of our Rust code rust/varint: add safety comments ci: check for common Rust mistakes via Clippy ci: verify minimum supported Rust version rust: support for Windows .github/workflows/main.yml | 15 +++++++++++++++ .gitlab-ci.yml | 13 ++++++++++++- Cargo.toml | 1 + Makefile | 14 ++++++++++++-- ci/install-dependencies.sh | 17 +++++++++++++---- ci/run-rust-checks.sh | 22 ++++++++++++++++++++++ meson.build | 4 ++++ src/cargo-meson.sh | 11 +++++++++-- src/varint.rs | 15 +++++++++++++++ 9 files changed, 103 insertions(+), 9 deletions(-) Range-diff versus v1: 1: 26bd2c3713 ! 1: fa3ba52997 ci: deduplicate calls to `apt-get update` @@ Commit message only required to perform job-specific tasks. In both steps we use `apt-get update` to update our repository sources. - This is unecessary though: all platforms that use Aptitude would have + This is unnecessary though: all platforms that use Aptitude would have already executed this command in the distro-specific step anyway. Drop the redundant calls. 2: 5116c20fd1 ! 2: 89e7b67d5c ci: check formatting of our Rust code @@ Commit message ci: check formatting of our Rust code Introduce a CI check that verifies that our Rust code is well-formatted. - This check uses rustfmt(1), which is the de-facto standard in the Rust - world. + This check uses `cargo fmt`, which is a wrapper around rustfmt(1) that + executes formatting for all Rust source files. rustfmt(1) itself is the + de-facto standard for formatting code in the Rust ecosystem. The rustfmt(1) tool allows to tweak the final format in theory. In practice though, the Rust ecosystem has aligned on style "editions". 3: 5b4c3303b7 < -: ---------- rust/varint: add safety comments -: ---------- > 3: 3c91ec55dc rust/varint: add safety comments 4: 68925b41c0 = 4: 481500d7b8 ci: check for common Rust mistakes via Clippy 5: c3f0943066 = 5: 09e73796ec ci: verify minimum supported Rust version 6: 0f968950a8 = 6: acd460fac5 rust: support for Windows --- base-commit: 8c8e270f2aba359479c4c2b4ab3c62726e5dac9d change-id: 20251007-b4-pks-ci-rust-8422e6a8196e