Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-osdev/uefi-rs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: uefi-v0.29.0
Choose a base ref
...
head repository: rust-osdev/uefi-rs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 316 changed files with 21,394 additions and 10,405 deletions.
5 changes: 3 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# If your shell has direnv support, it will automatically open a "nix-shell".
use nix
# If your shell has direnv support, it will automatically open a Nix shell with
# all relevant dependencies to develop this project.
use flake
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# If you are a frequent contributor to uefi-rs and would like to be featured in
# the sponsors section, please contact the maintainers.
github: phip1611
1 change: 1 addition & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comment: false
6 changes: 4 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"config:recommended",
"schedule:weekly"
],
"lockFileMaintenance": {
@@ -11,7 +11,9 @@
"rangeStrategy": "update-lockfile",
"packageRules": [
{
"matchPackageNames": ["crate-ci/typos"],
"matchPackageNames": [
"crate-ci/typos"
],
"automerge": true
}
]
39 changes: 24 additions & 15 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ name: Book
on:
push:
branches: [main]
tags: ['*']
permissions:
contents: write
# Adapted from:
@@ -21,24 +22,32 @@ jobs:
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Deploy GitHub Pages
run: |
cd book
mdbook build
git worktree add gh-pages gh-pages
# Configure git user so that `git commit` works.
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
# Get the highest `uefi` release tag.
highest_tag="$(git tag --list | grep uefi-v | sort -V | tail -1)"
# Create a worktree for the tag.
git worktree add wt-tag refs/tags/"${highest_tag}"
# Create a worktree for the `gh-pages` branch.
git worktree add wt-gh-pages gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
# Place the book under a "HEAD" directory so that we can later
# add other versions (e.g. "stable" or "v0.17") without breaking
# URLs.
rm -rf HEAD
mv ../book HEAD
git add HEAD
# Add an index in the root to redirect to HEAD. If we eventually
# serve multiple versions, this can be changed to a real index.
cp ../head_redirect.html index.html
git add index.html
git -C wt-gh-pages update-ref -d refs/heads/gh-pages
# Build the book for the tag. Don't use `--dest-dir` because it will
# delete the destination directory including the worktree checkout's
# ".git".
mdbook build wt-tag/book
# Copy output to the destination directory. Note the "/." is needed at
# the end of the source path so that hidden files are included.
cp -r wt-tag/book/book/. wt-gh-pages
# Commit and push.
cd wt-gh-pages
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force
21 changes: 9 additions & 12 deletions .github/workflows/developer_productivity.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ on:
push:
pull_request:
jobs:
# Job to run change detection
# Job to run change detection for Nix-related files
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step.
@@ -19,32 +19,29 @@ jobs:
filters: |
nix-src:
- 'nix/**'
- 'shell.nix'
- 'flake.nix'
- 'flake.lock'
# This is a convenience test to verify that the toolchain provided by
# shell.nix is valid and can build + run the integration test.
#
# It only runs if the "nix-src" output of the "changes" job is true.
nix_shell_toolchain:
name: "Nix toolchain: `cargo xtask run` works"
name: "Nix shell toolchain: `cargo xtask run` works"
needs: changes
if: ${{ needs.changes.outputs.nix-src == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: cachix/install-nix-action@v27
with:
# This channel is only required to invoke "nix-shell".
# Everything inside that nix-shell will use a pinned version of nixpkgs.
nix_path: nixpkgs=channel:nixos-23.05
- uses: cachix/install-nix-action@v31
# Dedicated step to separate all the
# "copying path '/nix/store/...' from 'https://cache.nixos.org'."
# messages from the actual build output. This job takes ~60secs.
# messages from the actual build output.
- name: Prepare Nix Store
run: nix-shell --pure --run "cargo --version"
run: nix develop --command bash -c "cargo --version"
- name: Run VM tests
run: |
COMMAND="cargo xtask run --target x86_64 --headless --ci --tpm=v1"
echo "Executing in nix shell: $COMMAND"
nix-shell --pure --run "$COMMAND"
echo "Executing in Nix shell: $COMMAND"
nix develop --command bash -c "$COMMAND"
3 changes: 0 additions & 3 deletions .github/workflows/msrv_toolchain.toml

This file was deleted.

36 changes: 34 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -3,8 +3,40 @@ on: [merge_group, push, pull_request]
jobs:
spellcheck:
name: Spellcheck
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Executes "typos ."
- uses: crate-ci/typos@v1.22.9
- uses: crate-ci/typos@v1.34.0
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- uses: Swatinem/rust-cache@v2
# Dedicated step to separate all the
# "copying path '/nix/store/...' from 'https://cache.nixos.org'."
# messages from the actual build output.
- name: Prepare Nix Store
run: nix develop --command echo
# A dedicated step removes spam from the actual job.
- name: Build cargo xtask
run: cargo xtask help >/dev/null
# Executing this in a Nix shell ensures that all our checks run as all
# required tooling exists.
- name: Check formatting
run: |
CMD="cargo xtask fmt --check"
nix develop --command bash -c "$CMD"
- name: Run clippy
run: |
rustup component add clippy
cargo xtask clippy --warnings-as-errors
- name: Run cargo doc (without unstable)
run: cargo xtask doc --warnings-as-errors --document-private-items
- name: Verify generated code is up-to-date
run: cargo xtask gen-code --check
- name: Run additional checks on the uefi-raw package
run: cargo xtask check-raw
110 changes: 74 additions & 36 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -13,10 +13,13 @@ on:
- cron: '0 0 * * 0-6'
env:
RUSTFLAGS: -D warnings
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test_aarch64:
name: Integration Test (AArch64)
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -44,7 +47,7 @@ jobs:
timeout-minutes: 4
test_ia32:
name: Integration Test (IA-32)
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -78,27 +81,6 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Run cargo test (without unstable)
run: cargo xtask test
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Run cargo fmt
run: |
rustup component add rustfmt
cargo fmt --all -- --check
- name: Run clippy
run: |
rustup component add clippy
cargo xtask clippy --warnings-as-errors
- name: Run cargo doc (without unstable)
run: cargo xtask doc --warnings-as-errors --document-private-items
- name: Verify generated code is up-to-date
run: cargo xtask gen-code --check
- name: Run additional checks on the uefi-raw package
run: cargo xtask check-raw
# Run the build with our current stable MSRV (specified in
# ./msrv_toolchain.toml). This serves to check that we don't
# accidentally start relying on a new feature without intending
@@ -111,23 +93,44 @@ 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
# 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:
name: Build (feature permutations)
runs-on: ubuntu-latest
env:
# TODO: temporarily allow warnings to not be errors on nightly due to
# incorrect dead_code lint.
# https://github.com/rust-osdev/uefi-rs/issues/1205
RUSTFLAGS: ""
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -136,14 +139,10 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo xtask build --feature-permutations
# Nightly + unstable feature
nightly_channel:
name: Build (nightly + unstable feature)
name: Nightly (build, test, doc)
runs-on: ubuntu-latest
env:
# TODO: temporarily allow warnings to not be errors on nightly due to
# incorrect dead_code lint.
# https://github.com/rust-osdev/uefi-rs/issues/1205
RUSTFLAGS: ""
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -163,7 +162,46 @@ jobs:
# Skip testing uefi-macros on nightly because the tests that check the
# compiler error output produce different output on stable vs nightly.
run: cargo xtask test --unstable --skip-macro-tests
miri:
name: Unit + Doc Tests (Miri)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Enable nightly toolchain
run: cp .github/workflows/nightly_toolchain.toml rust-toolchain.toml
- uses: Swatinem/rust-cache@v2
- name: Run unit tests and doctests under Miri
run: |
rustup component add miri
cargo xtask miri
# Builds a Rust standard binary using the `std` impl for UEFI, rather than
# creating a `no_std` + `no_main` binary.
build_standard_uefi_binary:
name: Build Standard Binary (nightly)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set toolchain
run: cp .github/workflows/nightly_toolchain.toml rust-toolchain.toml
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --target x86_64-unknown-uefi --verbose -p uefi-std-example
coverage:
name: Test Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo xtask cov --lcov
- name: Upload code coverage
uses: codecov/codecov-action@v5.4.3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: target/lcov
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@

# Integration test output by QEMU.
integration-test-debugcon.log
ovmf-firmware-debugcon.log
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -17,4 +17,6 @@ extend-ignore-identifiers-re = [
HD = "HD"

[default.extend-identifiers]
# We sometimes use "typ" as "type" is a reserved keyword
typ = "typ"

Loading