GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Windows Arm64 release build fails · Issue #153668 · python/cpython

Windows Arm64 release build fails #153668

New issue
Copy link
New issue
Copy link
Open
#156081
Open
Windows Arm64 release build fails#153668
#156081
Copy link
Labels
3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesOS-windowsbuildThe build process and cross-buildThe build process and cross-build

Description

@zooba
zooba
opened on Jul 13, 2026
Issue body actions

There appears to be a compiler bug that causes build failures with optimization enabled when targeting ARM64 on Windows:

        D:\a\1\s\Objects\unicodetype_db.h(4363): fatal error C1002: compiler is out of heap space in pass 2 [D:\a\1\s\PCbuild\pythoncore.vcxproj]

It repros reliably with cl /c /O2 Objects\unicodectype.c (with include dirs added), so I reported it to the C++ compiler team.

In the mean time, we'll disable optimizations for that file on ARM64 and hopefully that will get us through releases. Unless someone figures out a way to restructure the generated header to make the compiler happier, this is probably all we can do until the bug is fixed.

Linked PRs

  • gh-153668: Temporarily disable unicodectype.c optimization on WinARM64 due to compiler bug #153669
  • gh-153668: Replace Unicode numeric switch with binary-search tables #156081
  • [3.15] gh-153668: Temporarily disable unicodectype.c optimization on WinARM64 due to compiler bug (GH-153669) #157842
  • [3.14] gh-153668: Temporarily disable unicodectype.c optimization on WinARM64 due to compiler bug (GH-153669) #158221

Activity

  1. zooba
    added
    OS-windows
    buildThe build process and cross-buildThe build process and cross-build
    release-blocker
    on Jul 13, 2026
  2. github-project-automation
    added this to Release and Deferred blockers 🚫on Jul 13, 2026
  3. github-project-automation
    moved this to Todo in Release and Deferred blockers 🚫on Jul 13, 2026
  4. zooba
    added
    3.15bugs and security fixesbugs and security fixes
    3.16new features, bugs and security fixesnew features, bugs and security fixes
    and removed
    release-blocker
    on Jul 13, 2026
  5. zooba commented on Jul 13, 2026

    @zooba
    zooba
    on Jul 13, 2026
    MemberAuthor
    More actions

    Turns out (after more testing) that PGO builds are unaffected, which means we won't have a problem releasing. It also doesn't affect 3.14 (or earlier, I assume), so I can target the fix more specifically.

  6. adang1345 commented on Jul 20, 2026

    @adang1345
    adang1345
    on Jul 20, 2026
    Contributor
    More actions

    I encountered the same error when I tried to use Visual Studio 2026 and platform toolset v145 to create custom Windows ARM64 builds of Python 3.11 through 3.13 in https://github.com/adang1345/PythonWindows. I was building on a Windows x64 platform, and I worked around the error by adding the line <PreferredToolArchitecture>x64</PreferredToolArchitecture> to PCbuild/python.props. This forced the x64 version of cl.exe instead of the default x86 version of cl.exe to be used.

  7. zooba commented on Jul 20, 2026

    @zooba
    zooba
    on Jul 20, 2026
    MemberAuthor
    More actions

    I tested that and it didn't help, so I think we're hitting a specific bug in the optimiser that causes heap exhaustion. My issue also only hits 3.15 and not 3.14, so I'm guessing earlier versions of the generated files weren't as problematic.

    Do keep setting PreferredToolArchitecture if it helps you, though. We deliberately don't put it in the files so that sensible defaults or environment variables take precedence, so you could override it with an environment variable rather than patching files if you prefer.

  8. chris-eibl commented on Aug 15, 2026

    @chris-eibl
    chris-eibl
    on Aug 15, 2026
    Member
    More actions

    Here are my findings using the recent August Update 18.9.0 and PlatformToolSet=v145 with VCToolsVersion=14.51.36231 and additionally installed an older 14.50.35717 (only on the x64 host).

    All the below only for a release build. Like @zooba mentioned, PGO and debug builds are not affected.

    base 1fece44:

    Host PreferredToolArchitecture 14.50.35717 14.51.36231
    x64 x86 fail fail
    x64 x64 high RAM high RAM
    ARM64 1 ARM64 not done high RAM

    PR eb7f9d7 + my suggested fix for 14.50:

    Host PreferredToolArchitecture 14.50.35717 14.51.36231
    x64 x86 pass pass
    x64 x64 pass pass
    ARM64 1 ARM64 not done pass

    high RAM means passed, but the link step used > 20 GByte, while with the fix they pass and need only < 1 GByte 🚀 .

    I also did a quick check with PlatformToolSet=v143, which seems to be uneffected.

    Footnotes

    1. A self-hosted WoA build on a D4ps v6 VM in Azure. Make sure to use the Arm64 version of MSBuild, either through setting the environment variable MSBUILD, adding its path to PATH or calling vcvarsarm64.bat before invoking build.bat, otherwise Hostx86\arm64\cl.exe would be taken, like in the PreferredToolArchitecture=x86 case ... ↩ ↩2

    Reacted by Steve Dower
  9. zooba commented on Aug 17, 2026

    @zooba
    zooba
    on Aug 17, 2026
    MemberAuthor
    More actions

    I also did a quick check with PlatformToolSet=v143, which seems to be uneffected.

    Yeah, but you don't want to know how many other bugs likely exist in that version 😉

    I think we can probably ride this one out. I'm testing with our latest internal MSVC build, and if it's still failing there then I'll try and turn it into a repro that the team will investigate.

    Reacted by Chris Eibl
    Reacted by Chris Eibl
  10. scorpi023
    added 3 commits that reference this issue on Aug 20, 2026

    Merge branch 'main' into pythongh-153668-msvc-arm64-numeric-lookup

    aee3ab1

    Merge branch 'main' into pythongh-153668-msvc-arm64-numeric-lookup

    cdc79d2

    Merge branch 'main' into pythongh-153668-msvc-arm64-numeric-lookup

    ee8001e
  11. chris-eibl commented on Sep 18, 2026

    @chris-eibl
    chris-eibl
    on Sep 18, 2026
    Member
    More actions

    The latest update to unicodetype_db.h (#157634) now breaks the tier 2 ARM64 Windows Non-Debug 3.x build bot

    C:\Users\buildworker\buildarea\3.x.ware-win11-arm64.nondebug\build\Objects\unicodetype_db.h(4582): fatal error C1002: compiler is out of heap space in pass 2
    

    which does a release build. 1

    #156081 looks like an interesting alternative, but I am not versed enough in that domain to judge ...

    cc @zware

    Footnotes

    1. Even though the ARM64 compiler C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.51.36231\bin\HostArm64\arm64\CL.exe is used. ↩

  12. chris-eibl
    added a commit that references this issue on Sep 18, 2026

    Merge branch 'main' into pythongh-153668

    f2a8703
  13. zooba commented on Sep 18, 2026

    @zooba
    zooba
    on Sep 18, 2026
    MemberAuthor
    More actions

    #156081 looks like an interesting alternative, but I am not versed enough in that domain to judge ...

    That change looks mechanical enough, my only hesitation would be that it might result in much worse code for other compilers. (Though I imagine if any compiler has got optimal optimisation of huge and sparse switch statements, it'll be GCC and someone got nerd-sniped into it. There's no way you could expect those results to be transferable.)

  14. hugovk commented on Sep 19, 2026

    @hugovk
    hugovk
    on Sep 19, 2026
    Member
    More actions

    The Unicode 18 upgrade (#157634) was three days ago.

    What's changed since this issue opened is Windows ARM64 has been promoted from tier 3 to 2.

    This means within 24 hours we need to either revert the Unicode 18 upgrade, or fix by temporarily disabling optimisation (#153669) or refactoring (#156081) which may affect performance (or waiting for a compiler fix https://developercommunity.visualstudio.com/t/ARM64-compiler-uses-excessive-memory-on/11120089).

    I suggest temporarily disabling to get back to green, and then investigating performance impact of the refactor?

    Reacted by Chris Eibl, Zachary Ware and Steve Dower
  15. chris-eibl
    added 2 commits that reference this issue on Sep 20, 2026

    Merge branch 'main' into pythongh-153668

    12f43aa

    gh-153668: Temporarily disable unicodectype.c optimization on WinARM6…

    9ea05d4
  16. hugovk
    added 2 commits that reference this issue on Sep 22, 2026

    [3.15] gh-153668: Temporarily disable unicodectype.c optimization on …

    3404ded

    [3.14] gh-153668: Temporarily disable unicodectype.c optimization on …

    390f3d3
  17. mmomtchev commented on Sep 30, 2026

    @mmomtchev
    mmomtchev
    on Sep 30, 2026
    More actions

    Are there plans to back port to 3.13? 3.13 is affected as well.

  18. kevinprimeraquecreo-stack
    added this to Project_VKon Oct 18, 2026
  19. github-project-automation
    moved this to In progress in Project_VKon Oct 18, 2026
  20. kevinprimeraquecreo-stack
    added this to Project_VKon Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesOS-windowsbuildThe build process and cross-buildThe build process and cross-build

    Projects

    • Release and Deferred blockers 🚫
      Status
      Todo
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.