Skip to content

Commit

Permalink
refactor: allow multiple_crate_versions in wdk-build (build dependenc…
Browse files Browse the repository at this point in the history
…y) (#98)
  • Loading branch information
wmmc88 authored Feb 1, 2024
1 parent 3071387 commit c5302a4
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github-dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/dependency-review-action@v3
with:
# 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
allow-licenses: MIT, Apache-2.0, BSD-3-Clause, 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
Expand Down
42 changes: 21 additions & 21 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ wdk-build = { path = "crates/wdk-build", version = "0.1.0" }
wdk-macros = { path = "crates/wdk-macros", version = "0.1.0" }
wdk-panic = { path = "crates/wdk-panic", version = "0.1.0" }
wdk-sys = { path = "crates/wdk-sys", version = "0.1.0" }
bindgen = "0.68.1"
bindgen = "0.69.2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
23 changes: 23 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies = [
"unused-dependencies-flow",
"docs",
"nightly-test-flow",
"nightly-clippy-flow",
"nightly-docs",
]

Expand Down Expand Up @@ -63,6 +64,28 @@ toolchain = "nightly"
extend = "post-test"
env = { CARGO_MAKE_CARGO_BUILD_TEST_FLAGS = { unset = true } }

[tasks.nightly-clippy-flow]
extend = "clippy-flow"
toolchain = "nightly"
dependencies = [
"pre-nightly-clippy",
"nightly-clippy-router",
"post-nightly-clippy",
]

[tasks.pre-nightly-clippy]
extend = "pre-clippy"
# Proc-macro crates fail to trigger recompilation when switching toolchains due to bug in rustc resulting in "found invalid metadata files for crate" errors.
run_task = "clean"

[tasks.nightly-clippy-router]
extend = "clippy-router"
env = { CARGO_MAKE_CLIPPY_ARGS = "--features nightly ${CARGO_MAKE_CLIPPY_ARGS}", CARGO_MAKE_RUST_DEFAULT_TOOLCHAIN = "nightly" }

[tasks.post-nightly-clippy]
extend = "post-clippy"
env = { CARGO_MAKE_RUST_DEFAULT_TOOLCHAIN = { unset = true } }

[tasks.nightly-docs]
extend = "docs"
toolchain = "nightly"
Expand Down
2 changes: 1 addition & 1 deletion crates/sample-kmdf-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ wdk-macros.workspace = true
wdk-panic.workspace = true
wdk-sys.workspace = true
static_assertions = "1.1.0"
thiserror = "1.0.55"
thiserror = "1.0.56"

[build-dependencies]
wdk-build.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions crates/wdk-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ categories = ["development-tools::build-utils", "development-tools::ffi"]
bindgen.workspace = true
serde.workspace = true
serde_json.workspace = true
clap = { version = "4.4.11", features = ["derive"] }
clap = { version = "4.4.18", features = ["derive"] }
clap-cargo = "0.13.0"
thiserror = "1.0.55"
windows = { version = "0.51.1", features = [
thiserror = "1.0.56"
windows = { version = "0.52.0", features = [
"Win32_Foundation",
"Win32_System_Registry",
] }
Expand All @@ -25,4 +25,4 @@ windows = { version = "0.51.1", features = [
rustversion = "1.0.14"

[dev-dependencies]
windows = { version = "0.51.1", features = ["Win32_UI_Shell"] }
windows = { version = "0.52.0", features = ["Win32_UI_Shell"] }
3 changes: 1 addition & 2 deletions crates/wdk-build/src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ impl BuilderExt for Builder {
let mut builder = Self::default();

for c_header in c_header_files {
println!("cargo:rerun-if-changed={c_header}");
builder = builder.header(c_header);
}

Expand Down Expand Up @@ -132,7 +131,7 @@ impl BuilderExt for Builder {
// Defaults enums to generate as a set of constants contained in a module (default value
// is EnumVariation::Consts which generates enums as global constants)
.default_enum_style(bindgen::EnumVariation::ModuleConsts)
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.formatter(bindgen::Formatter::Prettyplease);

Ok(builder)
Expand Down
3 changes: 3 additions & 0 deletions crates/wdk-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#![deny(clippy::pedantic)]
#![deny(clippy::nursery)]
#![deny(clippy::cargo)]
// `wdk-build` is only to be used in build scripts, so binary bloat from multiple depenedency
// versions is not a concern
#![allow(clippy::multiple_crate_versions)]
#![deny(clippy::multiple_unsafe_ops_per_block)]
#![deny(clippy::undocumented_unsafe_blocks)]
#![deny(clippy::unnecessary_safety_doc)]
Expand Down
10 changes: 5 additions & 5 deletions crates/wdk-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ proc-macro = true

[dependencies]
cfg-if = "1.0.0"
proc-macro2 = "1.0.74"
quote = "1.0.33"
syn = { version = "2.0.32", features = ["full"] }
proc-macro2 = "1.0.78"
quote = "1.0.35"
syn = { version = "2.0.48", features = ["full"] }

[dev-dependencies]
# use path dependency instead of workspace due to: https://github.com/eupn/macrotest/issues/95
Expand All @@ -31,8 +31,8 @@ lazy_static = "1.4.0"
# Pin to github version due to: https://github.com/eupn/macrotest/issues/94
macrotest = { git = "https://github.com/eupn/macrotest", rev = "c4151a5" }
paste = "1.0.14"
syn = { version = "2.0.32", features = ["extra-traits"] }
trybuild = "1.0.86"
syn = { version = "2.0.48", features = ["extra-traits"] }
trybuild = "1.0.89"
owo-colors = "4.0.0"

[package.metadata.cargo-udeps.ignore]
Expand Down
4 changes: 2 additions & 2 deletions crates/wdk-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ categories = [
[build-dependencies]
bindgen.workspace = true
wdk-build.workspace = true
thiserror = "1.0.55"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
thiserror = "1.0.56"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
anyhow = "1.0.79"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/wdk-sys/generated_bindings/constants.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.68.1 */
/* automatically generated by rust-bindgen 0.69.2 */

pub const _STRSAFE_USE_SECURE_CRT: u32 = 0;
pub const _SAL_VERSION: u32 = 20;
Expand Down
2 changes: 1 addition & 1 deletion crates/wdk-sys/generated_bindings/ntddk.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.68.1 */
/* automatically generated by rust-bindgen 0.69.2 */

extern "C" {
pub fn __va_start(arg1: *mut *mut ::core::ffi::c_char, ...);
Expand Down
2 changes: 1 addition & 1 deletion crates/wdk-sys/generated_bindings/types.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.68.1 */
/* automatically generated by rust-bindgen 0.69.2 */

#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
Expand Down
2 changes: 1 addition & 1 deletion crates/wdk-sys/generated_bindings/wdf.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.68.1 */
/* automatically generated by rust-bindgen 0.69.2 */

extern "C" {
pub fn RtlAssert(
Expand Down

0 comments on commit c5302a4

Please sign in to comment.