Skip to content

Commit 4d4f997

Browse files
authored
feat!: expand wdk-sys coverage to include hid-related headers (#260)
Signed-off-by: Melvin Wang <melvin.mc.wang@gmail.com>
1 parent 54b0fd4 commit 4d4f997

35 files changed

Lines changed: 503 additions & 284 deletions

File tree

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
targets: ${{ matrix.target_triple }}
7474

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

7878
- name: Install Cargo Make
7979
uses: taiki-e/install-action@v2

.github/workflows/code-formatting-check.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
schedule: # Trigger a job on default branch at 4AM PST everyday
77
- cron: 0 11 * * *
88

9-
109
jobs:
1110
cargo-fmt:
1211
name: .rs Formatting Check

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989

9090
- if: matrix.build-mode == 'manual'
9191
working-directory: ./examples
92-
run: cargo +${{ matrix.rust_toolchain }} make default --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace
92+
run: cargo +${{ matrix.rust_toolchain }} make default --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --all-features
9393

9494
- name: Perform CodeQL Analysis
9595
uses: github/codeql-action/analyze@v3

.github/workflows/docs.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,9 @@ jobs:
7272

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

8277
- name: Run Cargo Doc w/ proc-macro crates
8378
if: matrix.target_triple == 'x86_64-pc-windows-msvc'
8479
# 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
85-
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }}
86-
87-
- name: Run Cargo Doc w/ proc-macro crates (--features nightly)
88-
if: ${{ matrix.target_triple == 'x86_64-pc-windows-msvc' && matrix.rust_toolchain == 'nightly' }}
89-
# 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
90-
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --features nightly
80+
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --all-features

.github/workflows/lint.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77

88
name: Lint
99

10+
env:
11+
RUSTFLAGS: >-
12+
-D warnings
13+
1014
jobs:
1115
clippy:
1216
name: Clippy
@@ -71,11 +75,7 @@ jobs:
7175
targets: ${{ matrix.target_triple }}
7276

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

8080
unused_deps:
8181
name: Detect Unused Cargo Dependencies

.github/workflows/test.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,4 @@ jobs:
7373
tool: cargo-expand@1.0.85
7474

7575
- name: Run Cargo Test
76-
run: cargo +${{ matrix.rust_toolchain }} test --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }}
77-
78-
- name: Run Cargo Test (--features nightly)
79-
if: matrix.rust_toolchain == 'nightly'
80-
run: cargo +${{ matrix.rust_toolchain }} test --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --features nightly
76+
run: cargo +${{ matrix.rust_toolchain }} test --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --all-features

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"./tests/umdf-driver-workspace/Cargo.toml",
2020
"./tests/wdk-macros-tests/Cargo.toml",
2121
"./tests/wdk-sys-tests/Cargo.toml",
22-
]
23-
}
22+
],
23+
"rust-analyzer.cargo.features": "all"
24+
}

CONTRIBUTING.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ The following tools should be installed as a part of the `windows-drivers-rs` de
9696
9797
### Generating Documentation
9898
99-
* To compile and open documentation: `cargo doc --locked --open`
100-
* To include nightly features: `cargo +nightly doc --locked --open --features nightly`
101-
* To open docs for non-host architecture: `cargo doc --locked --open --target <target-triple> --workspace --exclude wdk-macros`
99+
* To compile and open documentation: `cargo doc --locked --all-features --open`
100+
* To open docs for non-host architecture: `cargo doc --locked --all-features --open --target <target-triple> --workspace --exclude wdk-macros`
102101
* `--target` is incompatible with `proc-macro` crates due to a [cargo bug](https://github.com/rust-lang/cargo/issues/10368)
103102
104103
### Policy on using Nightly/Unstable Features
@@ -113,7 +112,7 @@ The crates in this repository are designed to work with `stable` rust. Some of t
113112
114113
### Build and Test
115114
116-
To **only build** the workspace: `cargo build`
115+
To **only build** the workspace: `cargo build --locked --all-features`
117116
118117
To **both** build and package the samples in the workspace: `cargo make --cwd .\crates\<driver-name>`
119118
@@ -123,13 +122,13 @@ To maintain the quality of code, tests and tools are required to pass before con
123122
124123
**_Functional Correctness:_**
125124
126-
* `cargo test --locked`
125+
* `cargo test --locked --all-features`
127126
* To test `nightly` features: `cargo +nightly test --locked --features nightly`
128127
129128
**_Static Analysis and Linting:_**
130129
131-
* `cargo clippy --locked --all-targets -- -D warnings`
132-
* To lint `nightly` features: `cargo +nightly clippy --locked --all-targets --features nightly -- -D warnings`
130+
* `cargo clippy --locked --all-features --all-targets -- -D warnings`
131+
* To lint `nightly` features: `cargo +nightly clippy --locked --all-features --all-targets --features nightly -- -D warnings`
133132
134133
**_Formatting:_**
135134
@@ -146,8 +145,7 @@ To maintain the quality of code, tests and tools are required to pass before con
146145
147146
**_Rust Documentation Build Test_**
148147
149-
* `cargo doc --locked`
150-
* To build docs for `nightly` features: `cargo +nightly doc --locked --features nightly`
148+
* `cargo doc --locked --all-features`
151149
152150
### A Note on Code-Style
153151

Cargo.lock

Lines changed: 12 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ wdk-sys = { path = "crates/wdk-sys", version = "0.3.0" }
3737

3838
# External Crates
3939
anyhow = "1.0.95"
40-
bindgen = "0.69.4"
40+
bindgen = "0.69.5"
4141
camino = "1.1.9"
4242
cargo_metadata = "0.18.1"
4343
cc = "1.2.10"

0 commit comments

Comments
 (0)