Skip to content

Conversation

@wmmc88
Copy link
Collaborator

@wmmc88 wmmc88 commented May 12, 2025

This pull request updates the emit_check_cfg_settings function in the Config implementation within crates/wdk-build/src/lib.rs to improve its usability and documentation.

Enhancements to function usability and documentation:

  • crates/wdk-build/src/lib.rs: Changed the visibility of the emit_check_cfg_settings function from private (fn) to public (pub fn) and added detailed documentation explaining its purpose and usage. This makes the function accessible outside the module and clarifies its role in emitting cargo::rustc-check-cfg directives for potential rustc-cfg settings.

@wmmc88 wmmc88 requested review from a team and Copilot May 12, 2025 18:34
@wmmc88 wmmc88 self-assigned this May 12, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR makes the private function emit_check_cfg_settings public and improves its documentation so that its purpose and usage are clearer for consumers of the crate.

  • Changed emit_check_cfg_settings from a private to a public function.
  • Added detailed doc comments explaining the function's behavior and context.
Comments suppressed due to low confidence (1)

crates/wdk-build/src/lib.rs:304

  • [nitpick] Consider adding a usage example within the doc comment to help users understand how to integrate this function in various build scenarios.
/// Emit `cargo::rustc-check-cfg` directives corresponding to all the possible `rustc-cfg` settings [`wdk_build`] could emit

@wmmc88 wmmc88 force-pushed the pub-cfg-settings branch from d8689b9 to 43a4101 Compare May 12, 2025 18:38
@wmmc88 wmmc88 added this pull request to the merge queue May 12, 2025
Merged via the queue into microsoft:main with commit b82b427 May 13, 2025
62 checks passed
@wmmc88 wmmc88 deleted the pub-cfg-settings branch May 13, 2025 00:11
svasista-ms pushed a commit to svasista-ms/windows-drivers-rs that referenced this pull request May 20, 2025
kehan-zhou pushed a commit to kehan-zhou/windows-drivers-rs that referenced this pull request May 21, 2025
svasista-ms added a commit to svasista-ms/windows-drivers-rs that referenced this pull request May 23, 2025
… driver types (as flags)

* refactor(cli): change cargo-wdk new command args to match cargo new command

* fix: replace matches use with match statement, remove redundant full path qualification, flatten is_self_signed_certificate_in_store handling

* fix: add eof to Cargo.lock

* refactor: move get_cargo_metadata into run_from_workspace_root

* refactor: move cargo-wdk-test.lock ignore to top level file

* refactor: disassociate to_target_triple from CpuArchitecture

* chore: map target_triple with target_arch on CI build

* fix: move cargo wdk metadata check to the top and fix test assertion

* fix: target_triple name argument in CI build

* chore: make sure other jobs in the buildmatrix continue while one fails

* fix: change --sample-class to --sample in ci invocation

* docs: fix doc wording in wdk-build

* fix: allow unnecessary_transmutes lint for bindgen-generated types.rs (microsoft#350)

Co-authored-by: leon-xd <[email protected]>

* feat: make `emit_check_cfg_settings` function public (microsoft#352)

* feat: add check for dependecy sorting in Cargo.toml files

* chore: add sort-deps task to local dev makefile

* fix: one time sort of all members of workspace using cargo make sort-deps task

* docs: update Contributing.md about cargo sort usage

* fix: taplo fmt fix of Makefile.toml

* fix: cargo sort check command missing -n option

* fix: imports

* docs: update cargo-wdk README

* refactor: error handling

* fix: match default target against full string instead of just arch part

* chore: cargo sort to particular commit since no new release is made

* refactor(cli): refactor new command

- Introduced DriverType Enum
- Made driver_type an ArgGroup
- Refactored NewCommandArgs. Added flags for driver type and made path the only argument
- Added `get_selected_driver_type` function
- Modified NewAction according to other changes
- Added related tests and docs

* refactor(cli): refactor new command, continued. rebased with integrate-cargo-wdk branch

* - Added consts for driver type string slices
- Renamed cli args structs to `NewArgs` and `BuildArgs` to match "ActionArgs" format
- Other fixes

* - returning Option from `get_selected_driver_type` and removed panic!
- changed errors and tests accordingly

* - changed error message for the "No driver type selected" case
- added an integration test to ensure expected error from Clap is printed when no driver type is passed

---------

Signed-off-by: Shravan Vasista <[email protected]>
Co-authored-by: krishnakumar4a4 <[email protected]>
Co-authored-by: Leon Durrenberger <[email protected]>
Co-authored-by: leon-xd <[email protected]>
Co-authored-by: Melvin Wang <[email protected]>
@leon-xd leon-xd mentioned this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants