Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into leon-xd/remove-lazy…
Browse files Browse the repository at this point in the history
…-static-instances
  • Loading branch information
wmmc88 committed Jan 30, 2025
2 parents d1361a8 + 4d4f997 commit c97de12
Show file tree
Hide file tree
Showing 41 changed files with 767 additions and 451 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
targets: ${{ matrix.target_triple }}

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

- name: Install Cargo Make
uses: taiki-e/install-action@v2
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/code-formatting-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
schedule: # Trigger a job on default branch at 4AM PST everyday
- cron: 0 11 * * *


jobs:
cargo-fmt:
name: .rs Formatting Check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,9 @@ jobs:

- name: Run Cargo Doc
# 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'
# 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
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --exclude wdk-macros --all-features

- 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
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --all-features
10 changes: 5 additions & 5 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:

name: Lint

env:
RUSTFLAGS: >-
-D warnings
jobs:
clippy:
name: Clippy
Expand Down Expand Up @@ -71,11 +75,7 @@ jobs:
targets: ${{ matrix.target_triple }}

- name: Run Cargo Clippy
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 +${{ matrix.rust_toolchain }} clippy --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --all-targets --features nightly -- -D warnings
run: cargo +${{ matrix.rust_toolchain }} clippy --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --all-targets --all-features

unused_deps:
name: Detect Unused Cargo Dependencies
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,4 @@ jobs:
tool: [email protected]

- name: Run Cargo Test
run: cargo +${{ matrix.rust_toolchain }} test --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }}

- name: Run Cargo Test (--features nightly)
if: matrix.rust_toolchain == 'nightly'
run: cargo +${{ matrix.rust_toolchain }} test --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --features nightly
run: cargo +${{ matrix.rust_toolchain }} test --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --all-features
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"./tests/umdf-driver-workspace/Cargo.toml",
"./tests/wdk-macros-tests/Cargo.toml",
"./tests/wdk-sys-tests/Cargo.toml",
]
}
],
"rust-analyzer.cargo.features": "all"
}
16 changes: 7 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ The following tools should be installed as a part of the `windows-drivers-rs` de
### Generating Documentation
* 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`
* To compile and open documentation: `cargo doc --locked --all-features --open`
* To open docs for non-host architecture: `cargo doc --locked --all-features --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 All @@ -113,7 +112,7 @@ The crates in this repository are designed to work with `stable` rust. Some of t
### Build and Test
To **only build** the workspace: `cargo build`
To **only build** the workspace: `cargo build --locked --all-features`
To **both** build and package the samples in the workspace: `cargo make --cwd .\crates\<driver-name>`
Expand All @@ -123,13 +122,13 @@ To maintain the quality of code, tests and tools are required to pass before con
**_Functional Correctness:_**
* `cargo test --locked`
* `cargo test --locked --all-features`
* To test `nightly` features: `cargo +nightly test --locked --features nightly`
**_Static Analysis and Linting:_**
* `cargo clippy --locked --all-targets -- -D warnings`
* To lint `nightly` features: `cargo +nightly clippy --locked --all-targets --features nightly -- -D warnings`
* `cargo clippy --locked --all-features --all-targets -- -D warnings`
* To lint `nightly` features: `cargo +nightly clippy --locked --all-features --all-targets --features nightly -- -D warnings`
**_Formatting:_**
Expand All @@ -146,8 +145,7 @@ To maintain the quality of code, tests and tools are required to pass before con
**_Rust Documentation Build Test_**
* `cargo doc --locked`
* To build docs for `nightly` features: `cargo +nightly doc --locked --features nightly`
* `cargo doc --locked --all-features`
### A Note on Code-Style
Expand Down
72 changes: 38 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@ wdk-panic = { path = "crates/wdk-panic", version = "0.3.0" }
wdk-sys = { path = "crates/wdk-sys", version = "0.3.0" }

# External Crates
anyhow = "1.0.86"
bindgen = "0.69.4"
anyhow = "1.0.95"
bindgen = "0.69.5"
camino = "1.1.9"
cargo_metadata = "0.18.1"
cc = "1.1.0"
cc = "1.2.10"
cfg-if = "1.0.0"
clap = "4.5.9"
clap-cargo = "0.14.1"
itertools = "0.13.0"
paste = "1.0.15"
pretty_assertions = "1.4.0"
pretty_assertions = "1.4.1"
proc-macro2 = "1.0.86"
quote = "1.0.36"
rustversion = "1.0.17"
quote = "1.0.38"
rustversion = "1.0.19"
serde = "1.0"
serde_json = "1.0"
syn = "2.0.77"
thiserror = "1.0.62"
syn = "2.0.87"
thiserror = "1.0.69"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
windows = "0.58.0"
Expand Down
Loading

0 comments on commit c97de12

Please sign in to comment.