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

feat: configure WDK configuration via parsing Cargo manifest metadata #186

Merged
merged 95 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
d8e0b29
feat: configure WDR crates via package manifest metadata
wmmc88 May 3, 2024
2dd311e
fix kmdf compilation
wmmc88 Apr 4, 2024
a6ae640
add wdf.c
wmmc88 May 3, 2024
7f0c210
remove generated_bindings folder
wmmc88 Feb 14, 2024
6f63ad0
add wdm inf
wmmc88 Apr 9, 2024
12b6351
adjust umdf bindgen options
wmmc88 Apr 9, 2024
40278a2
more umdf fixes
wmmc88 Apr 9, 2024
406c2ff
WIP
wmmc88 May 3, 2024
648541d
pin cargo-expand version in beta workflow
wmmc88 Apr 3, 2024
59020cf
clippy errors
wmmc88 Mar 28, 2024
c08e936
refactor: use a standardized workspace lint table
wmmc88 May 3, 2024
9644484
fix triggering lints
wmmc88 May 3, 2024
c976737
add makefile task to handle testing build and package for all configs
wmmc88 May 3, 2024
0d25fe1
rework macro to take in path to wdk-sys out_dir
wmmc88 May 3, 2024
97bf94d
move wdk-macros integration tests to wdk-sys
wmmc88 Apr 22, 2024
083f6ec
move wdk-macros integration tests to wdk-sys
wmmc88 May 3, 2024
5da5632
move compute_wdffunctions_symbol_name to Config Imp
wmmc88 Apr 23, 2024
c097d7d
remove dead code + fmt + fix workspace tests
wmmc88 May 3, 2024
2be8168
allow non_snake_case in generated code
wmmc88 Apr 23, 2024
278bbb6
update cargo-expand
wmmc88 Apr 23, 2024
78b2218
remove unused dependencies + switch from cargo udeps to cargo machete
wmmc88 May 3, 2024
96dd4e0
fix missing usermode apis
wmmc88 Apr 24, 2024
2ce6959
fix rustdoc warnings
wmmc88 May 3, 2024
024c310
add windows um bindings (win32)
wmmc88 Apr 30, 2024
5dc6cc6
change sample driver device names
wmmc88 Apr 30, 2024
d5b9039
minor sample driver fixes
wmmc88 Apr 30, 2024
65704c6
fix remaining samples issues
wmmc88 May 3, 2024
35307bf
clean up linker configuration code
wmmc88 May 3, 2024
dde993b
cleanup of driver config detection code
wmmc88 May 6, 2024
d9cdb06
remove testing via unstable test features
wmmc88 May 7, 2024
cf8f110
migrate cargo build script outputs to new format
wmmc88 May 7, 2024
9c5aaae
update cargo build script syntax
wmmc88 May 7, 2024
a6e8af9
refactor: add support for rustc-check-cfg
wmmc88 May 7, 2024
be3318a
refactor!: changes to cargo_make functions (public, but unlikely to b…
wmmc88 May 8, 2024
96af4e6
add conditon_script convenience function
wmmc88 May 9, 2024
8112f8a
Merge branch 'rustc-cfg-check' into crates-io-wdk-configs
wmmc88 May 9, 2024
639d602
feat: add config-specific driver packaging + examples and tests
wmmc88 May 14, 2024
9e25f9c
fix: fix issues with WDF versions before WdfFunctionCount was introduced
wmmc88 May 16, 2024
e6e6edd
Merge remote-tracking branch 'upstream/main' into crates-io-wdk-configs
wmmc88 May 16, 2024
54644df
fix: fix call_unsafe_wdf_function compilation error when the bindgen-…
wmmc88 May 16, 2024
f584e84
umdf-driver-workspace
wmmc88 May 31, 2024
6642733
add kmdf workspace test + fix umdf workspace test
wmmc88 May 31, 2024
9d3fc0a
Merge remote-tracking branch 'upstream/main' into crates-io-wdk-configs
wmmc88 Jun 1, 2024
090b8f0
more parallelism
wmmc88 Jun 2, 2024
b3f2c49
clippy fixes
wmmc88 Jun 2, 2024
924ead4
more clippy fixes
wmmc88 Jun 2, 2024
362679a
fix missing copyrights
wmmc88 Jun 2, 2024
57a4ff5
fix arm64 signing
wmmc88 Jun 4, 2024
b96bee3
fix typos
wmmc88 Jun 5, 2024
79769ec
Merge remote-tracking branch 'upstream/main' into crates-io-wdk-configs
wmmc88 Jun 5, 2024
f8b56a9
fix arm64 signing
wmmc88 Jun 4, 2024
6466cf6
cargo machete fixes
wmmc88 Jun 5, 2024
39c8dd4
switch to serde serializer/deserializer. remove links-based metadata …
wmmc88 Jul 9, 2024
430a3b4
improve generic map for wdkmetadata serializer
wmmc88 Jul 11, 2024
2b04f15
update dependencies
wmmc88 Jul 12, 2024
2cf98ab
use inline consts in example drivers
wmmc88 Jul 12, 2024
ab0587d
remove exporting via links key
wmmc88 Jul 15, 2024
11f7f8c
update cfg exports to use serializer
wmmc88 Jul 16, 2024
7ff8c0e
better cargometadata parsing error handling and fix check_cfg not bei…
wmmc88 Jul 18, 2024
77b060c
better comments in wdk-sys build.rs
wmmc88 Jul 18, 2024
749212d
Merge remote-tracking branch 'upstream/main' into crates-io-wdk-configs
wmmc88 Jul 18, 2024
066f899
add copyrights
wmmc88 Jul 18, 2024
73e587c
improve readme
wmmc88 Jul 18, 2024
3477b42
convert duckscript condition_script to rust_script
wmmc88 Jul 23, 2024
d909183
cargo_metadata parsing functions, move emitting of cargo-rerun for me…
wmmc88 Jul 23, 2024
e5a2134
add missing docs
wmmc88 Jul 23, 2024
d6d149e
chore: Exclude examples and tests from the workspace
wmmc88 Jul 23, 2024
af99e88
remove references to udeps
wmmc88 Jul 23, 2024
2c8ecb5
more clippy fixes
wmmc88 Jul 23, 2024
080ff4a
fix casing clippy errors
wmmc88 Jul 24, 2024
425b4e0
restructure modules
wmmc88 Jul 24, 2024
b95365c
fix typos and doc warnings
wmmc88 Jul 25, 2024
d458666
clippy release mode fixes
wmmc88 Jul 25, 2024
b9da479
fix github deps allowed licenses
wmmc88 Jul 25, 2024
635bc0e
Revert "fix github deps allowed licenses"
wmmc88 Jul 25, 2024
b9418c3
update dependency review config
wmmc88 Jul 25, 2024
a0288a9
Update crates/wdk-build/src/lib.rs
wmmc88 Jul 30, 2024
1226ba2
Update crates/wdk-build/src/lib.rs
wmmc88 Jul 30, 2024
ff3d9db
fix skipping of non-binary wdk-packages
wmmc88 Aug 1, 2024
8c22ea6
force build to always be run when running cargo make
wmmc88 Aug 1, 2024
fe87ddd
Merge remote-tracking branch 'origin/crates-io-wdk-configs' into crat…
wmmc88 Aug 1, 2024
a52aa48
chore: Update repository layout and add workspace-level examples and …
wmmc88 Aug 2, 2024
8a81855
chore: Update dependabot configuration to detect all manifests recurs…
wmmc88 Aug 2, 2024
5d3eae7
rename action file
wmmc88 Aug 3, 2024
303585d
taplo formatting
wmmc88 Aug 5, 2024
ce07410
fix clippy issues
wmmc88 Aug 5, 2024
79d5514
remove invalid todos
wmmc88 Aug 5, 2024
5a9acc3
fmt
wmmc88 Aug 5, 2024
3f3cd89
add examples and tests to build workflow
wmmc88 Aug 5, 2024
1471e43
revert localmakefile changes
wmmc88 Aug 5, 2024
f5dfed1
specify cargo make target
wmmc88 Aug 5, 2024
3338382
always enable syn extra-traits
wmmc88 Aug 5, 2024
2d199bc
workaround upstream cargo-make not expanding condition_script_runner_…
wmmc88 Aug 15, 2024
2c06c9a
remove invalid todo
wmmc88 Aug 15, 2024
6062f27
typo fix
wmmc88 Aug 23, 2024
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
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
rustflags = ["-C", "target-feature=+crt-static"]
49 changes: 49 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,53 @@ updates:
time: "06:00"
commit-message:
prefix: "chore"
reviewers:
- "microsoft/windows-drivers-rs"
labels:
- "type:dependabot"
- "type:dependencies-cargo"

- package-ecosystem: "cargo"
directory: "/sample-kmdf-driver"
schedule:
interval: "weekly"
day: "wednesday"
timezone: "America/Los_Angeles"
time: "06:00"
commit-message:
prefix: "chore"
reviewers:
- "microsoft/windows-drivers-rs"
labels:
- "type:dependabot"
- "type:dependencies-cargo"

- package-ecosystem: "cargo"
directory: "/sample-umdf-driver"
schedule:
interval: "weekly"
day: "wednesday"
timezone: "America/Los_Angeles"
time: "06:00"
commit-message:
prefix: "chore"
reviewers:
- "microsoft/windows-drivers-rs"
labels:
- "type:dependabot"
- "type:dependencies-cargo"

- package-ecosystem: "cargo"
directory: "/sample-wdm-driver"
schedule:
interval: "weekly"
day: "wednesday"
timezone: "America/Los_Angeles"
time: "06:00"
commit-message:
prefix: "chore"
reviewers:
- "microsoft/windows-drivers-rs"
labels:
- "type:dependabot"
- "type:dependencies-cargo"
Expand All @@ -22,6 +69,8 @@ updates:
time: "06:00"
commit-message:
prefix: "chore"
reviewers:
- "microsoft/windows-drivers-rs"
labels:
- "type:dependabot"
- "type:dependencies-github-actions"
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
RUSTFLAGS: -D warnings

jobs:
# TODO: build each sample driver
build:
name: Build
runs-on: windows-latest
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/github-dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ jobs:
- name: Dependency Review
uses: actions/dependency-review-action@v4
with:
# AND combinations are currently bugged and must be listed separately: https://github.com/actions/dependency-review-action/issues/263
# OR combinations are currently bugged and must be listed separately: https://github.com/actions/dependency-review-action/issues/670
allow-licenses: MIT, Apache-2.0, BSD-3-Clause, ISC, Unicode-DFS-2016, (MIT OR Apache-2.0) AND Unicode-DFS-2016, Unlicense OR MIT
# 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]'
allow-licenses: >-
MIT,
Apache-2.0,
BSD-3-Clause,
ISC,
Unicode-DFS-2016
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
37 changes: 7 additions & 30 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,44 +77,21 @@ jobs:
if: matrix.rust_toolchain == 'nightly'
run: cargo +${{ matrix.rust_toolchain }} clippy --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --all-targets --features nightly -- -D warnings

udeps:
unused_deps:
name: Detect Unused Cargo Dependencies
runs-on: windows-latest
strategy:
matrix:
wdk:
- Microsoft.WindowsWDK.10.0.22621 # NI WDK

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Winget
uses: ./.github/actions/winget-install
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install WDK (${{ matrix.wdk }})
run: |
if ((Get-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals).Id -eq '${{ matrix.wdk }}') {
Write-Host "${{ matrix.wdk }} is already installed. Attempting to update..."
Update-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
} else {
Write-Host "Installing ${{ matrix.wdk }}..."
Install-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
}

- name: Install 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 Rust Toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install Cargo Udeps
- name: Install Cargo Machete
uses: taiki-e/install-action@v2
with:
tool: [email protected]

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

- name: Run Cargo Udeps (--features nightly)
run: cargo +nightly udeps --locked --all-targets --features nightly
- name: Run Cargo Machete
run: cargo machete --skip-target-dir
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Install Cargo Expand
uses: taiki-e/install-action@v2
with:
tool: [email protected].80
tool: [email protected].85

- name: Run Cargo Test
run: cargo +${{ matrix.rust_toolchain }} test --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }}
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"+nightly"
],
"rust-analyzer.rustfmt.rangeFormatting.enable": true,
"evenBetterToml.formatter.crlf": true
"evenBetterToml.formatter.crlf": true,
"files.associations": {
"input.h": "c"
}
}
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ That's it! Thank you for your contribution!

The following tools should be installed as a part of the `windows-drivers-rs` developer workflow:

* `cargo-expand`: `cargo install --locked cargo-expand --version 1.0.80`
* `cargo-expand`: `cargo install --locked cargo-expand --version 1.0.85`
* `cargo-audit`: `cargo install --locked cargo-audit`
* `cargo-udeps`: `cargo install --locked cargo-udeps`
* `cargo-machete`: `cargo install --locked cargo-machete`
* `taplo-cli`: `cargo install --locked taplo-cli`

**Note on arm64:** ARM64 support for ring is [not released yet](https://github.com/briansmith/ring/issues/1167), so TLS features must be disabled until arm64 is officially supported by ring (probably in 0.17.0 release)
Expand Down Expand Up @@ -142,8 +142,7 @@ To maintain the quality of code, tests and tools are required to pass before con
**_Dependency Analysis:_**

* Scan for security advisories in dependent crates: `cargo audit --deny warnings`
* Scan for unused dependencies: `cargo +nightly udeps --locked --all-targets`
* `cargo udeps` requires `nightly` to function
* Scan for unused dependencies: `cargo machete --skip-target-dir`

**_Rust Documentation Build Test_**

Expand Down
Loading
Loading