Skip to content

Commit 021c778

Browse files
authored
Bump MSRV to 1.85 and read it from Cargo.toml in CI (#7)
A transitive dependency (getrandom 0.4.1 via tempfile/prost-build) now requires Rust 1.85+ (edition2024). Since this is a library crate, Cargo.lock is not committed, so CI resolves the latest compatible versions which broke the 1.83 build. Bump rust-version in Cargo.toml to 1.85 and update the CI test matrix to read the MSRV from Cargo.toml rather than hardcoding it, preventing future drift.
1 parent 3c22464 commit 021c778

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/workflows/test.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,21 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [ubuntu-latest, macos-latest]
20-
rust: [stable, 1.83.0]
20+
rust: [stable, msrv]
2121
steps:
2222
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
- name: Determine Rust version
24+
id: rust-version
25+
run: |
26+
if [ "${{ matrix.rust }}" = "msrv" ]; then
27+
MSRV=$(grep '^rust-version' Cargo.toml | sed 's/.*"\(.*\)"/\1/')
28+
echo "toolchain=${MSRV}" >> "$GITHUB_OUTPUT"
29+
else
30+
echo "toolchain=${{ matrix.rust }}" >> "$GITHUB_OUTPUT"
31+
fi
2332
- uses: dtolnay/rust-toolchain@stable # Action's stable branch. No SHA pinning - repo doesn't publish releases.
2433
with:
25-
toolchain: ${{ matrix.rust }}
34+
toolchain: ${{ steps.rust-version.outputs.toolchain }}
2635
- name: Install protoc (Ubuntu)
2736
if: runner.os == 'Linux'
2837
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "mcpd-plugins-sdk"
33
version = "0.0.1"
44
edition = "2021"
5-
rust-version = "1.83"
5+
rust-version = "1.85"
66
authors = ["Mozilla AI"]
77
license = "Apache-2.0"
88
description = "Rust SDK for building mcpd plugins"

0 commit comments

Comments
 (0)