From 32f4910bdd616cb995ff3d6338a502436acad3b7 Mon Sep 17 00:00:00 2001 From: Rain Date: Fri, 20 Dec 2024 10:15:42 +0000 Subject: [PATCH 1/2] [spr] initial version Created using spr 1.3.6-beta.1 --- .github/workflows/rust.yml | 10 ++++++++++ .gitignore | 2 +- Cargo.toml | 6 +----- src/config.rs | 1 - src/package.rs | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8adca91..2de3257 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -3,6 +3,9 @@ # name: Rust +env: + RUSTFLAGS: -D warnings + on: push: branches: [ main ] @@ -22,15 +25,22 @@ jobs: components: rustfmt - name: Check style run: cargo fmt -- --check + - name: Check clippy + run: cargo clippy --all-targets --all-features build-and-test: runs-on: ${{ matrix.os }} strategy: matrix: + # 1.81 is the MSRV. + toolchain: [ stable, "1.81" ] os: [ ubuntu-latest, macos-latest ] steps: # actions/checkout@v2 - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 + - uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} - name: Build run: cargo build --tests --verbose - name: Run tests diff --git a/.gitignore b/.gitignore index 088ba6b..321eccd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Generated by Cargo # will have compiled files and executables -/target/ +/target # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html diff --git a/Cargo.toml b/Cargo.toml index a6f130e..5f94e34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,11 +3,7 @@ name = "omicron-zone-package" version = "0.11.1" authors = ["Sean Klein "] edition = "2021" -# -# Report a specific error in the case that the toolchain is too old for -# let-else: -# -rust-version = "1.65.0" +rust-version = "1.81.0" license = "MPL-2.0" repository = "https://github.com/oxidecomputer/omicron-package" description = "Packaging tools for Oxide's control plane software" diff --git a/src/config.rs b/src/config.rs index 041d52c..10fdb02 100644 --- a/src/config.rs +++ b/src/config.rs @@ -113,7 +113,6 @@ impl Config { self.packages .iter() .filter(|(_, pkg)| target.includes_package(pkg)) - .map(|(name, pkg)| (name, pkg)) .collect(), ) } diff --git a/src/package.rs b/src/package.rs index c148076..c4221ce 100644 --- a/src/package.rs +++ b/src/package.rs @@ -215,7 +215,7 @@ pub struct BuildConfig<'a> { static DEFAULT_TARGET: Target = Target(BTreeMap::new()); static DEFAULT_PROGRESS: NoProgress = NoProgress::new(); -impl<'a> Default for BuildConfig<'a> { +impl Default for BuildConfig<'_> { fn default() -> Self { Self { target: &DEFAULT_TARGET, From f61154a1351cc22b06f3393d904a31584944a3d3 Mon Sep 17 00:00:00 2001 From: Rain Date: Fri, 20 Dec 2024 10:23:17 +0000 Subject: [PATCH 2/2] also update pull_request Created using spr 1.3.6-beta.1 --- .github/workflows/rust.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2de3257..04e2f97 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,7 +10,8 @@ on: push: branches: [ main ] pull_request: - branches: [ main ] + # Allow CI to run on all PRs, not just ones targeting main. This allows + # stacked PRs to be tested. jobs: check-style: