Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm64 Build and Packaging Improvements #35

Merged
merged 7 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
- dev
- release

target_triple:
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc

steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -44,15 +48,15 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
targets: ${{ matrix.target_triple }}

- name: Run Cargo Build
run: cargo build --locked --profile ${{ matrix.cargo_profile }} --workspace
run: cargo +${{ matrix.rust_toolchain }} build --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace

- name: Install Cargo Make
uses: taiki-e/install-action@v2
with:
tool: cargo-make

- name: Build and Package Sample KMDF Driver
run: cargo make --cwd .\crates\sample-kmdf-driver --profile ${{ matrix.cargo_profile }}
continue-on-error: true # FIXME: Packaging tools in non-ewdk environments are not found
- name: Build and Package Sample Drivers
run: cargo make default +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }}
2 changes: 1 addition & 1 deletion .github/workflows/code-formatting-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
components: rustfmt

- name: Run Cargo Format
run: cargo fmt --all -- --check
run: cargo +nightly fmt --all -- --check

taplo-fmt:
name: .toml Formatting Check
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
- dev
- release

target_triple:
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc

steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -44,10 +48,23 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
targets: ${{ matrix.target_triple }}

- name: Run Cargo Doc
run: cargo doc --locked --profile ${{ matrix.cargo_profile }}
# proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --exclude wdk-macros

- name: Run Cargo Doc (--features nightly)
if: matrix.rust_toolchain == 'nightly'
run: cargo doc --locked --profile ${{ matrix.cargo_profile }} --features nightly
# proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --exclude wdk-macros --features nightly

- name: Run Cargo Doc w/ proc-macro crates
if: matrix.target_triple == 'x86_64-pc-windows-msvc'
# cargo doc can only generate documentation for proc-macro crates when --target is not specified due to a cargo doc bug: https://github.com/rust-lang/cargo/issues/7677
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }}

- name: Run Cargo Doc w/ proc-macro crates (--features nightly)
if: ${{ matrix.target_triple == 'x86_64-pc-windows-msvc' && matrix.rust_toolchain == 'nightly' }}
# cargo doc can only generate documentation for proc-macro crates when --target is not specified due to a cargo doc bug: https://github.com/rust-lang/cargo/issues/7677
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --features nightly
5 changes: 4 additions & 1 deletion .github/workflows/github-dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ jobs:
- name: Dependency Review
uses: actions/dependency-review-action@v3
with:
allow-licenses: MIT, Apache-2.0
# AND combinations are currently bugged and must be listed separately: https://github.com/actions/dependency-review-action/issues/263
allow-licenses: MIT, Apache-2.0, ISC, Unicode-DFS-2016, (MIT OR Apache-2.0) AND Unicode-DFS-2016
# anstyle is licensed as (MIT OR Apache-2.0), but the Github api fails to detect it: https://github.com/rust-cli/anstyle/tree/main/crates/anstyle
allow-dependencies-licenses: 'pkg:cargo/[email protected]'
comment-summary-in-pr: on-failure
# Explicit refs required for merge_group and push triggers:
# https://github.com/actions/dependency-review-action/issues/456
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
- dev
- release

target_triple:
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc

steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -47,13 +51,14 @@ jobs:
with:
toolchain: ${{ matrix.rust_toolchain }}
components: clippy
targets: ${{ matrix.target_triple }}

- name: Run Cargo Clippy
run: cargo clippy --locked --profile ${{ matrix.cargo_profile }} --all-targets -- -D warnings
run: cargo +${{ matrix.rust_toolchain }} clippy --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --all-targets -- -D warnings

- name: Run Cargo Clippy (--features nightly)
if: matrix.rust_toolchain == 'nightly'
run: cargo clippy --locked --profile ${{ matrix.cargo_profile }} --all-targets --features nightly -- -D warnings
run: cargo +${{ matrix.rust_toolchain }} clippy --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --all-targets --features nightly -- -D warnings

udeps:
name: Detect Unused Cargo Dependencies
Expand All @@ -79,16 +84,16 @@ jobs:
}

- name: Install Rust Toolchain (Nightly)
uses: dtolnay/rust-toolchain@nightly
# Cargo udeps only supports running on nightly due to reliance on unstable dep-info feature: https://github.com/est31/cargo-udeps/issues/113, https://github.com/est31/cargo-udeps/issues/136
uses: dtolnay/rust-toolchain@nightly

- name: Install Cargo Udeps
uses: taiki-e/install-action@v2
with:
tool: cargo-udeps

- name: Run Cargo Udeps
run: cargo udeps --locked --all-targets
run: cargo +nightly udeps --locked --all-targets

- name: Run Cargo Udeps (--features nightly)
run: cargo udeps --locked --all-targets --features nightly
run: cargo +nightly udeps --locked --all-targets --features nightly
11 changes: 7 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
- dev
- release

target_triple:
- x86_64-pc-windows-msvc
# - aarch64-pc-windows-msvc FIXME: Add support for executing ARM64 tests. Maybe use target specific test runner in emulator: https://doc.rust-lang.org/cargo/reference/config.html#target
wmmc88 marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -44,6 +48,7 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
targets: ${{ matrix.target_triple }}

- name: Install Cargo Expand
uses: taiki-e/install-action@v2
Expand All @@ -52,10 +57,8 @@ jobs:

# FIXME: wdk-sys layout tests fail, but only on github hosted runner
- name: Run Cargo Test
# Final driver crates must be excluded since theres no way to prevent linker args from being passed to their unit tests: https://github.com/rust-lang/cargo/issues/12663
run: cargo test --locked --profile ${{ matrix.cargo_profile }} --workspace --exclude sample-* --exclude wdk-sys
run: cargo +${{ matrix.rust_toolchain }} test --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --exclude wdk-sys

- name: Run Cargo Test (--features nightly)
if: matrix.rust_toolchain == 'nightly'
# Final driver crates must be excluded since theres no way to prevent linker args from being passed to their unit tests: https://github.com/rust-lang/cargo/issues/12663
run: cargo test --locked --profile ${{ matrix.cargo_profile }} --features nightly --workspace --exclude sample-* --exclude wdk-sys
run: cargo +${{ matrix.rust_toolchain }} test --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --exclude wdk-sys --features nightly
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
target/
DriverCertificate.cer
.cargo-make-loadscripts/
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ The following tools should be installed as a part of the `windows-drivers-rs` de

* To compile and open documentation: `cargo doc --locked --open`
* To include nightly features: `cargo +nightly doc --locked --open --features nightly`
* To open docs for non-host architecture: `cargo doc --locked --open --target <target-triple> --workspace --exclude wdk-macros`
* `--target` is incompatible with `proc-macro` crates due to a [cargo bug](https://github.com/rust-lang/cargo/issues/10368)

### Policy on using Nightly/Unstable Features

Expand Down
Loading
Loading