Skip to content

Add tool_win32: manifest-driven Win32 namespace orchestration tool#4312

Closed
Copilot wants to merge 4 commits intomasterfrom
copilot/explore-solutions-for-issue-4300
Closed

Add tool_win32: manifest-driven Win32 namespace orchestration tool#4312
Copilot wants to merge 4 commits intomasterfrom
copilot/explore-solutions-for-issue-4300

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 27, 2026

Adds tool_win32 — a new binary crate that drives the full pipeline for compiling Win32 SDK headers namespace-by-namespace into a merged Windows.Win32.winmd, as outlined in issue #4300.

New crate: crates/tools/win32

  • src/manifest.rs — TOML manifest structs (Manifest, Namespace) deserialized via serde
  • src/main.rs — CLI + three-step per-namespace pipeline:
    1. Clang::write() → per-namespace .rdl
    2. Reader::write() → per-namespace .winmd
    3. Merger::merge() → combined Windows.Win32.winmd
  • example.toml — example manifest covering Foundation, System.Com, and UI.WindowsAndMessaging

Manifest format

args = ["--target=x86_64-pc-windows-msvc", "-fms-extensions", "-DWIN32_LEAN_AND_MEAN"]
# reference = "path/to/Windows.Win32.winmd"  # cross-namespace type resolution

[[namespace]]
name    = "Windows.Win32.Foundation"
library = "kernel32"
headers = ["um/WinBase.h", "shared/winerror.h"]
filters = ["WinBase.h", "winerror.h"]

[[namespace]]
name    = "Windows.Win32.System.Com"
library = "ole32"
headers = ["um/ObjIdl.h"]

CLI

Usage: tool_win32 <manifest.toml> [OPTIONS]

Options:
  -o, --output <dir>        Output directory for .rdl/.winmd files [default: target/win32]
  -r, --reference <file>    Reference .winmd for cross-namespace type resolution
  -I, --include <dir>       SDK include directory (repeatable)
      --merge-output <name> Merged output filename [default: Windows.Win32.winmd]
  -k, --keep-going          Continue after per-namespace errors

@kennykerr
Copy link
Copy Markdown
Collaborator

@copilot fmt

Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/7168a9d9-0f70-4273-97a6-1e4dd33163f0

Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 27, 2026

@copilot fmt

Done in acaa8ed.

Copilot AI requested a review from kennykerr April 27, 2026 01:47
@kennykerr kennykerr marked this pull request as ready for review April 28, 2026 14:01
@kennykerr kennykerr closed this Apr 28, 2026
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