windows-clang in-house metadata validation - #4687
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new tool_validate generator to continuously validate that the in-house flat Windows.Win32 (+ WDK-in-Windows.Win32) metadata can be consumed by windows-bindgen across its output styles, and tightens windows-bindgen determinism/arch-cfg handling to make those validations reliable in CI.
Changes:
- Introduce
tool_validateto regenerate three committed flat binding outputs (default/sys/minimal) and compile them as modules to validate the full surface compiles. - Make
windows-bindgenflat-layout dedup deterministic for same-name collisions via a stable tie-break and deterministic insertion order. - Emit
SupportedArchitectureAttributecfg-gates for Win32 constant emissions and adjust CI workflows to run generators in release and incorporate/excludetool_validateappropriately.
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/tools/validate/src/main.rs | New validation tool that regenerates and compiles three bindgen output styles in parallel. |
| crates/tools/validate/rustfmt.toml | Local rustfmt settings aligned with generated output formatting. |
| crates/tools/validate/Cargo.toml | New workspace tool crate definition and dependencies needed to compile generated bindings. |
| crates/libs/bindgen/src/types/mod.rs | Add constant arch participation in sort key and introduce stable row-based tie-breaker (dedup_cmp). |
| crates/libs/bindgen/src/types/cpp_const.rs | Prepend arch cfg gates to emitted constants (when metadata marks supported architectures). |
| crates/libs/bindgen/src/type_tree.rs | Deterministic insertion order into BTreeSet to make tie-collapses stable in --flat mode. |
| .github/workflows/test.yml | Exclude tool_validate from the general test matrix to avoid compiling the full flat surface there. |
| .github/workflows/gen.yml | Add validate to the generator matrix and run all tools under --release. |
| .github/workflows/clippy.yml | Exclude tool_validate from workspace clippy. |
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
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.
No description provided.