Skip to content
New issue

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

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

Already on GitHub? # to your account

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

Merged
merged 95 commits into from
Aug 23, 2024

Conversation

wmmc88
Copy link
Collaborator

@wmmc88 wmmc88 commented Jul 18, 2024

This PR enables configuring the WDK Metadata via [metadata.wdk] tags in Cargo manifests.

As a consequence of that new feature, several other changes were required:

  • Added minimal Sample WDM and UMDF drivers
  • Make all driver packaging tooling (ex. signing, cat generation, etc) support WDM and UMDF
  • Serde Serializer added to export WDKMetadata configuration to a structured format
  • Emit that structured format so that downstream code can cfg based off of certain WDK configuration parameters
    * A wdf.c file is compiled and linked in to provide the __declspec(selectany) that are not generated by bindgen
  • Have several templates that generate rust code in wdk-sys's build.rs that is otherwise not possible to generate conditionally (ex. call_unsafe_wdf_function_binding definition that points to OUT_DIR, WDFFUNCTIONS symbol name that depends on configuration, WDF_FUNCTION_TABLE definition whose size depends on configuration, etc.)
  • added UM support
  • remove local generated_bindings copy of bindings
  • exporting via links keys in cargo manifests is deprecated
  • switch to cargo-machete for unused dep detection (required since most code is not cfg-ed out)
  • remove wdk-macros running of cargo check to obtain out dir (and replace with wdk_sys passing the outdir to the procmacro)

resolves #82

@wmmc88 wmmc88 marked this pull request as ready for review August 5, 2024 21:20
@wmmc88
Copy link
Collaborator Author

wmmc88 commented Aug 5, 2024

Last round of changes for this PR fixed a logic bug that broke automatic skipping of the packaging task for non-binary(ie driver) wdk packages, added more tests for that specific situation, fixed various issues identified by pipelines(ie. formatting, clippy), and expanded coverage of the pipelines to include the workspace-level tests and examples folders.

ayodejiige
ayodejiige previously approved these changes Aug 23, 2024
@wmmc88 wmmc88 disabled auto-merge August 23, 2024 19:41
@wmmc88 wmmc88 added this pull request to the merge queue Aug 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 23, 2024
@wmmc88 wmmc88 added this pull request to the merge queue Aug 23, 2024
Merged via the queue into microsoft:main with commit 32e5ae9 Aug 23, 2024
49 checks passed
@wmmc88 wmmc88 deleted the crates-io-wdk-configs branch August 23, 2024 20:34
@wmmc88 wmmc88 mentioned this pull request Sep 27, 2024
@wmmc88 wmmc88 linked an issue Oct 5, 2024 that may be closed by this pull request
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
4 participants