From 5602b1b86e098273d56150ccbcf403ecf40b3abb Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 16 Feb 2025 15:41:14 -0500 Subject: [PATCH 1/3] uefi-raw: Fix MSRV build `size_of` wasn't added to the prelude until 1.80, but the uefi-raw MSRV is currently 1.70. --- uefi-raw/src/table/system.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/uefi-raw/src/table/system.rs b/uefi-raw/src/table/system.rs index d25df1f0d..3faaee536 100644 --- a/uefi-raw/src/table/system.rs +++ b/uefi-raw/src/table/system.rs @@ -6,6 +6,7 @@ use crate::table::configuration::ConfigurationTable; use crate::table::runtime::RuntimeServices; use crate::table::Header; use crate::{Char16, Handle}; +use core::mem::size_of; use core::ptr; #[derive(Clone, Debug, Eq, PartialEq)] From 8341c0c17265c48ef77c8f9918b5c218b99b2d47 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 16 Feb 2025 15:35:56 -0500 Subject: [PATCH 2/3] ci: Change MSRV job to read MSRV from cargo Delete msrv_toolchain.toml, and instead read the MSRV from cargo and copy it to rust-toolchain.toml. This ensures the job is checking the same MSRV set in Cargo.toml, and reduces the number of places that the MSRV needs to be manually updated when we change it. --- .github/workflows/msrv_toolchain.toml | 3 --- .github/workflows/rust.yml | 11 +++++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) delete mode 100644 .github/workflows/msrv_toolchain.toml diff --git a/.github/workflows/msrv_toolchain.toml b/.github/workflows/msrv_toolchain.toml deleted file mode 100644 index 8ff6e69dd..000000000 --- a/.github/workflows/msrv_toolchain.toml +++ /dev/null @@ -1,3 +0,0 @@ -[toolchain] -channel = "1.81" -targets = ["aarch64-unknown-uefi", "i686-unknown-uefi", "x86_64-unknown-uefi"] diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 580394855..8c731352a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -120,13 +120,20 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 - name: Set toolchain - run: cp .github/workflows/msrv_toolchain.toml rust-toolchain.toml + run: | + # Extract the MSRV using cargo. + msrv=$(cargo metadata --no-deps --format-version=1 | jq --raw-output '.packages[] | select(.name == "uefi") | .rust_version') + echo "MSRV: ${msrv}" + # Set the MSRV in the toolchain config. + sed -i "s:stable:${msrv}:" rust-toolchain.toml - uses: Swatinem/rust-cache@v2 - name: Build # Build uefi-test-runner since its dependency tree includes all the # library packages. Note that xtask isn't used or built here; since it's # just a dev tool we don't care about the MSRV for that package. - run: cargo build --target x86_64-unknown-uefi -p uefi-test-runner + run: | + cargo --version + cargo build --target x86_64-unknown-uefi -p uefi-test-runner # This job requires the nightly channel, but keep it as a separate job from # `nightly_channel` because it takes a while to run. build_feature_permutations: From 482c0f12ff8338ae60b821a215b7227b6042c34a Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 16 Feb 2025 15:34:29 -0500 Subject: [PATCH 3/3] ci: Add job to check the MSRV build of uefi-raw The `uefi-raw` package has a lower MSRV than the `uefi` package, so it needs to be tested separately. --- .github/workflows/rust.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8c731352a..32eea8415 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -134,6 +134,25 @@ jobs: run: | cargo --version cargo build --target x86_64-unknown-uefi -p uefi-test-runner + # The uefi-raw crate has its own MSRV. Check that the crate builds correctly + # with that version of the toolchain. + build_msrv_raw: + name: Build (uefi-raw MSRV) + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Set toolchain + run: | + # Extract the MSRV using cargo. + msrv=$(cargo metadata --no-deps --format-version=1 | jq --raw-output '.packages[] | select(.name == "uefi-raw") | .rust_version') + echo "MSRV: ${msrv}" + # Set the MSRV in the toolchain config. + sed -i "s:stable:${msrv}:" rust-toolchain.toml + - name: Build + run: | + cargo --version + cargo build -p uefi-raw # This job requires the nightly channel, but keep it as a separate job from # `nightly_channel` because it takes a while to run. build_feature_permutations: