Skip to content

Comments

fix: improve error reporting when no wdk-build package is found#339

Merged
gurry merged 4 commits intomicrosoft:mainfrom
kehan-zhou:fix-wdk-crate-detection-error
Jun 17, 2025
Merged

fix: improve error reporting when no wdk-build package is found#339
gurry merged 4 commits intomicrosoft:mainfrom
kehan-zhou:fix-wdk-crate-detection-error

Conversation

@kehan-zhou
Copy link
Contributor

🛠️ What This Fix Does
Previously, the code would throw ConfigError::MultipleWdkBuildCratesDetected even when no wdk-build packages were found. This was misleading since the error implied that multiple crates were detected.

This fix adds a more apparent distinction:
If no wdk-build crates are detected, a new NoWdkBuildCrateDetected error is returned.
If more than one is found, the existing MultipleWdkBuildCratesDetected is used.
This provides more accurate error reporting to users.

📌 Related Issue
Fixes #334

🧪 Testing
Ran cargo test locally to confirm no regressions and that the new error path is covered.

@kehan-zhou
Copy link
Contributor Author

@microsoft-github-policy-service agree

@gurry gurry requested a review from wmmc88 April 16, 2025 04:30
@kehan-zhou kehan-zhou requested a review from gurry April 16, 2025 06:58
gurry
gurry previously approved these changes Apr 16, 2025
@kehan-zhou kehan-zhou force-pushed the fix-wdk-crate-detection-error branch from 879db98 to 144f698 Compare April 18, 2025 08:41
@kehan-zhou
Copy link
Contributor Author

I just rebased the branch on top of the latest main and I've applied the suggested changes. Let me know if there's anything else you'd like me to adjust.

@wmmc88 wmmc88 requested a review from leon-xd May 14, 2025 15:32
@kehan-zhou kehan-zhou force-pushed the fix-wdk-crate-detection-error branch 2 times, most recently from a744f58 to 144f698 Compare May 21, 2025 03:37
Copy link
Collaborator

@wmmc88 wmmc88 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @kehan-zhou

@gurry gurry enabled auto-merge June 17, 2025 01:37
@gurry gurry added this pull request to the merge queue Jun 17, 2025
Merged via the queue into microsoft:main with commit f23d666 Jun 17, 2025
63 checks passed
@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.

ConfigError::MultipleWdkBuildCratesDetected can be thrown when 0 build crates are detected

3 participants