Skip to content

Distribute x86, x64 and arm64 binaries together - #1637

Open
Yexuan Xiao (YexuanXiao) wants to merge 4 commits into
microsoft:masterfrom
YexuanXiao:binary-arch-upstream
Open

Yexuan Xiao (YexuanXiao) wants to merge 4 commits into
microsoft:masterfrom
YexuanXiao:binary-arch-upstream

Conversation

@YexuanXiao

@YexuanXiao Yexuan Xiao (YexuanXiao) commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

The cppwinrt.exe currently shipped in the NuGet package is still x86. I think almost no one runs cppwinrt on x86 OS these days, and using 64 bit cppwinrt can improve build performance.

I tested the speed of the x86 and x64 binaries for generating system metadata projections: 7% faster for a fresh generation, and 21% faster when projections already exist on disk.

I've also heard that running x86 programs on WOA delivers only 20% of native performance or even worse, so this can also effectively improve the development experience for WOA users.

Prioritize respecting the PreferredToolArchitecture that may be provided by the user, then use PROCESSOR_ARCHITEW6432 to obtain the OS architecture so that make MSBuild running under WOW64 still uses 64-bit binaries, and finally use PROCESSOR_ARCHITECTURE.

@DefaultRyan

Copy link
Copy Markdown
Member

I see this is removing the also removing the x86 binary completely. Not sure I agree with that.

Moving to supporting per-arch binaries is something I want to see, but I think the support needs to be more robust:

  • Keep the x86 binary for compat.
  • Prefer renaming the amd64 folder to x64 for consistency.
  • Have an MSBuild property that can override the native build arch, or piggyback on the property the VC++ toolchain uses. I think it's PreferredToolArchitecture.
  • In general, look at how VC++ supports multiple tool architectures with user-overridable options. We don't need the full gamut of support, as we don't have to worry about the output binary architecture, but a small degree of balance between autodetect and user preference makes sense.
  • Even if we keep the x86 binary, we need to decide between keeping it in the root folder vs moving it to a dedicated x86 folder. The first option is uglier, but the second option risks compat breaks.

@sylveon

Copy link
Copy Markdown
Contributor

I think the second option is probably fine - the people who depend on the internal path can update their code on dependency update.

@YexuanXiao

Copy link
Copy Markdown
Contributor Author

Aligning the path name with PreferredToolArchitecture makes sense, so I’ll do it. Leaving the x86 binaries in the root directory seems pointless. It may break some builds, but changing the path is trivial, no harder than upgrading cppwinrt. It also signals that cppwinrt now ships binaries for different architectures, which many have long wanted.

@YexuanXiao Yexuan Xiao (YexuanXiao) changed the title Distribute x64 and arm64 binaries instead of x86 Distribute x86, x64 and arm64 binaries together Nov 24, 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.

3 participants