From 2a322ee603196ea3c3ddf0a237561be2170d82fd Mon Sep 17 00:00:00 2001 From: aien-spark Date: Wed, 4 Nov 2026 19:53:42 -0600 Subject: [PATCH] build: declare MSRV 1.88, pin it, and add an MSRV CI job The locked dependency set needs rustc 1.88 (time 0.3.55, time-core, time-macros); zeroize, blake3, hashbrown and others use edition 2024, which cargo before 1.85 cannot parse. Declare rust-version = "1.88", pin 1.88.0 in rust-toolchain.toml, and add .github/workflows/msrv.yml that checks the two agree and runs build, test and clippy --locked on that toolchain. Fixes #13 Signed-off-by: aien-spark --- .github/workflows/msrv.yml | 28 ++++++++++++++++++++++++++++ AGENTS.md | 4 ++-- Cargo.toml | 1 + README.md | 2 ++ rust-toolchain.toml | 8 ++++++++ 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/msrv.yml create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml new file mode 100644 index 0000000..3578195 --- /dev/null +++ b/.github/workflows/msrv.yml @@ -0,0 +1,28 @@ +name: msrv + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +jobs: + msrv: + name: build and test on the MSRV + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v4 + - name: rust-version in Cargo.toml matches rust-toolchain.toml + run: | + msrv=$(sed -n 's/^rust-version = "\(.*\)"$/\1/p' Cargo.toml) + pin=$(sed -n 's/^channel = "\(.*\)"$/\1/p' rust-toolchain.toml) + echo "Cargo.toml rust-version=$msrv rust-toolchain.toml channel=$pin" + case "$pin" in "$msrv"|"$msrv".*) ;; *) echo "mismatch"; exit 1 ;; esac + - name: install the pinned toolchain + run: rustup toolchain install "$(sed -n 's/^channel = "\(.*\)"$/\1/p' rust-toolchain.toml)" --profile minimal --component clippy + - run: rustc --version && cargo --version + - run: cargo build --locked + - run: cargo test --locked + - run: cargo clippy --release --locked -- -D warnings diff --git a/AGENTS.md b/AGENTS.md index bc47235..3c586d6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,7 +20,7 @@ cd aien-edge cargo build --release # writes target/release/aien-edge ``` -Needs a stable Rust toolchain. `Cargo.lock` is committed. aarch64 builds run on a 64-bit Raspberry Pi OS. +Needs Rust 1.88 or newer: `rust-version = "1.88"` in `Cargo.toml`, and `rust-toolchain.toml` pins 1.88.0 so rustup selects it here. 1.88 is the oldest release that builds the locked dependencies (`time` 0.3.55 needs 1.88; several crates use edition 2024). When a dependency update raises that floor, raise `rust-version`, the `rust-toolchain.toml` channel and this line together. `Cargo.lock` is committed. aarch64 builds run on a 64-bit Raspberry Pi OS. ## Configuration @@ -42,7 +42,7 @@ target/release/aien-edge # serves until stopped; SIGHUP reloads e - Running the binary opens network listeners. For a local run use a config without `[tls]`, a non-privileged `http_listen`, and a `[[site]]` root that holds a built site with `index.html`. - Deploying (`README.md`, "Deploy on the Pi") needs a Raspberry Pi with systemd, sudo, ports 80 and 443 forwarded to it, and DNS pointing at it. `deploy/aien-edge.service` runs it with `DynamicUser=yes`, `CAP_NET_BIND_SERVICE` only and a read-only `/srv/sites`. -- There are no CI workflows in this repository. Run the three cargo commands above before opening a pull request. +- `.github/workflows/msrv.yml` checks that `rust-version` matches the `rust-toolchain.toml` channel, then runs `cargo build`, `cargo test` and `cargo clippy --release -- -D warnings` with `--locked` on that toolchain for every pull request and push to `main`. Run the three cargo commands above before opening a pull request. ## Conventions diff --git a/Cargo.toml b/Cargo.toml index a3184e0..b8d06cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "aien-edge" version = "0.1.0" edition = "2021" +rust-version = "1.88" description = "Native Rust edge server for AIEN static sites: in-memory precompressed assets, virtual hosts, and automatic Let's Encrypt TLS" license = "AGPL-3.0-or-later" authors = ["Drake Stapleton "] diff --git a/README.md b/README.md index 9c02c0c..a5fece9 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ Not measured on a Pi. ## Build and test +Needs Rust 1.88 or newer (`rust-version` in `Cargo.toml`). `rust-toolchain.toml` pins 1.88.0, so rustup uses that release in this directory. The `msrv` workflow builds, tests and lints on it with `--locked` for every pull request. + ```bash cargo test cargo clippy --release -- -D warnings diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..6e2f168 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,8 @@ +[toolchain] +# Pinned to the minimum supported Rust version, which must equal +# `rust-version` in Cargo.toml. 1.88 is the oldest release that builds the +# locked dependency set (time 0.3.55 requires 1.88; zeroize, blake3 and +# others use edition 2024, which needs 1.85). +channel = "1.88.0" +profile = "minimal" +components = ["clippy"]