-
Notifications
You must be signed in to change notification settings - Fork 102
feat: make emit_check_cfg_settings function public
#352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
There was a problem hiding this 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
ankurung
approved these changes
May 12, 2025
leon-xd
approved these changes
May 12, 2025
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]>
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates the
emit_check_cfg_settingsfunction in theConfigimplementation withincrates/wdk-build/src/lib.rsto improve its usability and documentation.Enhancements to function usability and documentation:
crates/wdk-build/src/lib.rs: Changed the visibility of theemit_check_cfg_settingsfunction 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 emittingcargo::rustc-check-cfgdirectives for potentialrustc-cfgsettings.