Skip to content

[ci] Add windows arm64 build - #1400

Open
tobil4sk wants to merge 5 commits into
HaxeFoundation:masterfrom
tobil4sk:feature/ci-windows-arm64
Open

tobil4sk wants to merge 5 commits into
HaxeFoundation:masterfrom
tobil4sk:feature/ci-windows-arm64

Conversation

@tobil4sk

Copy link
Copy Markdown
Member

This requires a patched version of setup-haxe: krdlab/setup-haxe#138

Related to #1386

This patched version runs the x86_64 build of haxe through emulation on
arm64 windows.
@tobil4sk
tobil4sk force-pushed the feature/ci-windows-arm64 branch from 6dc6821 to de19491 Compare October 13, 2026 07:54
@tobil4sk

tobil4sk commented Oct 13, 2026 •

Copy link
Copy Markdown
Member Author

The reason for the out of memory issue during builds is that msvc is being emulated using 32-bit x86:

Sys.putEnv("msvc_host_arch", ioDefines.exists("windows_arm_host") ? "x86" : "x64" );

This was probably added when older versions of Windows arm64 did not yet support x86_64 emulation, only x86_32.

Ideally we should:

  • use native arm64 msvc where it is available (newer versions of visual studio)
  • fallback to x86_64 emulation where it is not, and where x86_64 emulation is supported
  • fallback to x86_32 on older setups.

@MRK2009

MRK2009 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor
  • use native arm64 msvc where it is available (newer versions of visual studio)
  • fallback to x86_64 emulation where it is not, and where x86_64 emulation is supported
  • fallback to x86_32 on older setups.

Let's try the arm64 one then.

Previously we were forcing a host arch of x86, which caused the compiler
to run out of memory when processing precompiled headers. Hopefully,
VsDevCmd can pick an appropriate host architecture automatically for us
(arm64 when available [0], x64/x86 for cross-compilation or when visual
studio is old and doesn't support a native arm64 build).

[0] https://devblogs.microsoft.com/visualstudio/arm64-visual-studio-is-officially-here/
HXCPP_MSVC is set when using HXCPP_MSVC_VER, which uses legacy
VSxxxCOMNTOOLS environment variables that no longer exist since VS2017
[0].

VS2017 was also the first version of VS to add arm64 as a target [1], so
this older method is incompatible anyway.

Aside from these issues, this also never worked because it would check
for "..._arm64.bat" but then call "..._amd64.bat", so it was never
correctly producing arm64 binaries.

[0] https://developercommunity.visualstudio.com/t/missing-vs150comntools/35325
[1] https://pete.akeo.ie/2017/05/compiling-desktop-arm-applications-with.html
@tobil4sk

Copy link
Copy Markdown
Member Author

It looks like we should be able to defer to VsDevCmd to decide the correct host, which is simpler on our end and will hopefully do the correct thing for those edge cases with older VS installs etc.

dimensionscape pushed a commit to openfl/libhxcpp that referenced this pull request Oct 15, 2026
dimensionscape pushed a commit to openfl/libhxcpp that referenced this pull request Oct 15, 2026
dimensionscape pushed a commit to openfl/libhxcpp that referenced this pull request Oct 15, 2026
dimensionscape pushed a commit to openfl/libhxcpp that referenced this pull request Oct 15, 2026
dimensionscape pushed a commit to openfl/libhxcpp that referenced this pull request Oct 15, 2026
dimensionscape pushed a commit to openfl/libhxcpp that referenced this pull request Oct 15, 2026
dimensionscape pushed a commit to openfl/libhxcpp that referenced this pull request Oct 15, 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