Skip to content

windows-clang in-house metadata validation - #4687

Merged
Kenny Kerr (kennykerr) merged 6 commits into
masterfrom
tool_validate
Jul 9, 2026
Merged

windows-clang in-house metadata validation#4687
Kenny Kerr (kennykerr) merged 6 commits into
masterfrom
tool_validate

Conversation

@kennykerr

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_validate to regenerate three committed flat binding outputs (default/sys/minimal) and compile them as modules to validate the full surface compiles.
  • Make windows-bindgen flat-layout dedup deterministic for same-name collisions via a stable tie-break and deterministic insertion order.
  • Emit SupportedArchitectureAttribute cfg-gates for Win32 constant emissions and adjust CI workflows to run generators in release and incorporate/exclude tool_validate appropriately.

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.

@kennykerr
Kenny Kerr (kennykerr) merged commit 2b9d5b2 into master Jul 9, 2026
33 checks passed
@kennykerr
Kenny Kerr (kennykerr) deleted the tool_validate branch July 9, 2026 12:33
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.

2 participants