From 1bd6db323c741ba0dfb5150884cf9e588ace221e Mon Sep 17 00:00:00 2001 From: Ivan Velickovic Date: Mon, 5 Jan 2026 15:54:02 +1100 Subject: [PATCH 1/2] ci: run style check with expected Rust toolchain The current way these style checks work means that they are based on the GitHub provided Rust toolchain rather than the one we expect. This would be fine except the rules (mainly for Clippy) seems to change every couple of weeks which is kind of annoying. Since it changes so often it means that CI fails on PRs on unrelated bits of code. Change the CI to use the Nix flake instead like we do when we build the SDK itself. Signed-off-by: Ivan Velickovic --- .github/workflows/pr.yml | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8e843b39e..124227f87 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -14,36 +14,16 @@ jobs: uses: seL4/ci-actions/.github/workflows/pr.yml@master clippy_check: - runs-on: ubuntu-latest - # Make sure CI fails on all warnings, including Clippy lints - env: - RUSTFLAGS: "-Dwarnings" + runs-on: [self-hosted, macos, ARM64] steps: - uses: actions/checkout@v4 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run Clippy - run: cd tool/microkit && cargo clippy --all-targets --all-features + # Make sure CI fails on all warnings, including Clippy lints + run: nix develop --ignore-environment -c bash -c "cd tool/microkit && cargo-clippy --all-targets --all-features -- -D warnings" rustfmt_check: - runs-on: ubuntu-latest + runs-on: [self-hosted, macos, ARM64] steps: - uses: actions/checkout@v4 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run rustfmt - run: cd tool/microkit && cargo fmt --check + run: nix develop --ignore-environment -c bash -c "cd tool/microkit && cargo-fmt --check" From e13846ab5c639f6f51c01c3f62bc6188f4ba5806 Mon Sep 17 00:00:00 2001 From: Ivan Velickovic Date: Tue, 6 Jan 2026 08:43:16 +1100 Subject: [PATCH 2/2] tool: fix clippy Signed-off-by: Ivan Velickovic --- tool/microkit/src/elf.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/microkit/src/elf.rs b/tool/microkit/src/elf.rs index 5f342f86a..d6f551c9f 100644 --- a/tool/microkit/src/elf.rs +++ b/tool/microkit/src/elf.rs @@ -220,7 +220,7 @@ impl ElfFile { pub fn from_path(path: &Path) -> Result { let bytes = match fs::read(path) { Ok(bytes) => bytes, - Err(err) => return Err(format!("failed to read ELF: {}", err)), + Err(err) => return Err(format!("failed to read ELF: {err}")), }; let magic = &bytes[0..4]; @@ -241,7 +241,7 @@ impl ElfFile { hdr_size = std::mem::size_of::(); word_size = 64; } - _ => return Err(format!("invalid class '{}'", class)), + _ => return Err(format!("invalid class '{class}'")), }; // Now need to read the header into a struct