Skip to content

Commit e9e62eb

Browse files
authored
Merge pull request #1542 from nicholasbishop/bishop-test-raw-msrv
Fix uefi-raw MSRV build, and improve CI for MSRV
2 parents b733874 + 482c0f1 commit e9e62eb

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

.github/workflows/msrv_toolchain.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/rust.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,39 @@ jobs:
120120
- name: Checkout sources
121121
uses: actions/checkout@v4
122122
- name: Set toolchain
123-
run: cp .github/workflows/msrv_toolchain.toml rust-toolchain.toml
123+
run: |
124+
# Extract the MSRV using cargo.
125+
msrv=$(cargo metadata --no-deps --format-version=1 | jq --raw-output '.packages[] | select(.name == "uefi") | .rust_version')
126+
echo "MSRV: ${msrv}"
127+
# Set the MSRV in the toolchain config.
128+
sed -i "s:stable:${msrv}:" rust-toolchain.toml
124129
- uses: Swatinem/rust-cache@v2
125130
- name: Build
126131
# Build uefi-test-runner since its dependency tree includes all the
127132
# library packages. Note that xtask isn't used or built here; since it's
128133
# just a dev tool we don't care about the MSRV for that package.
129-
run: cargo build --target x86_64-unknown-uefi -p uefi-test-runner
134+
run: |
135+
cargo --version
136+
cargo build --target x86_64-unknown-uefi -p uefi-test-runner
137+
# The uefi-raw crate has its own MSRV. Check that the crate builds correctly
138+
# with that version of the toolchain.
139+
build_msrv_raw:
140+
name: Build (uefi-raw MSRV)
141+
runs-on: ubuntu-latest
142+
steps:
143+
- name: Checkout sources
144+
uses: actions/checkout@v4
145+
- name: Set toolchain
146+
run: |
147+
# Extract the MSRV using cargo.
148+
msrv=$(cargo metadata --no-deps --format-version=1 | jq --raw-output '.packages[] | select(.name == "uefi-raw") | .rust_version')
149+
echo "MSRV: ${msrv}"
150+
# Set the MSRV in the toolchain config.
151+
sed -i "s:stable:${msrv}:" rust-toolchain.toml
152+
- name: Build
153+
run: |
154+
cargo --version
155+
cargo build -p uefi-raw
130156
# This job requires the nightly channel, but keep it as a separate job from
131157
# `nightly_channel` because it takes a while to run.
132158
build_feature_permutations:

uefi-raw/src/table/system.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::table::configuration::ConfigurationTable;
66
use crate::table::runtime::RuntimeServices;
77
use crate::table::Header;
88
use crate::{Char16, Handle};
9+
use core::mem::size_of;
910
use core::ptr;
1011

1112
#[derive(Clone, Debug, Eq, PartialEq)]

0 commit comments

Comments
 (0)