Skip to content

Support Windows ARM64#2797

Merged
freakboy3742 merged 27 commits intobeeware:mainfrom
ankitects:windows-arm
Apr 21, 2026
Merged

Support Windows ARM64#2797
freakboy3742 merged 27 commits intobeeware:mainfrom
ankitects:windows-arm

Conversation

@abdnh
Copy link
Copy Markdown
Contributor

@abdnh abdnh commented Apr 13, 2026

This adds support for Windows ARM64.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@abdnh abdnh marked this pull request as ready for review April 13, 2026 12:05
@abdnh
Copy link
Copy Markdown
Contributor Author

abdnh commented Apr 13, 2026

(Windows tests failing because the stub binary URL has changed to include a platform suffix)

Copy link
Copy Markdown
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Broadly, this looks great - a couple of minor details flagged inline, mostly around naming (similar naming issues to the template), and property vs method use.

Comment thread src/briefcase/platforms/windows/__init__.py
Comment thread src/briefcase/platforms/windows/__init__.py Outdated
Comment thread src/briefcase/platforms/windows/app.py
@freakboy3742
Copy link
Copy Markdown
Member

I've done some initial testing of this, in conjunction with the updated Visual Studio template.

I got a VSStudio project to build, but I needed to:

  • update the Visual Studio project to use the latest build tools (v145, rather than v143). That's probably a good idea regardless, so that a fresh install of Visual Studio 2026 is easier.
  • Re-install Python to make sure that I had an ARM64 build, rather than an AMD64 build. py install -3.13 installs a AMD64 build by default, for the same reason that uv does.

Even with that, I get an error launching a Toga app because it can't load _cffi_backend. I haven't gotten to the bottom of this; it might be a Python.net issue.

@abdnh
Copy link
Copy Markdown
Contributor Author

abdnh commented Apr 14, 2026

Regarding build tools, I've not updated the version because the GitHub runner still uses Visual Studio 2022. This will apparently change next month, but I'm not sure if the ARM runner will be updated at the same time: actions/partner-runner-images#150

@abdnh
Copy link
Copy Markdown
Contributor Author

abdnh commented Apr 14, 2026

Even with that, I get an error launching a Toga app because it can't load _cffi_backend. I haven't gotten to the bottom of this; it might be a Python.net issue.

Yes, looks like a Python.net issue. I had a look and was able to modify pythonnet/clr-loader to build ARM64 DLLs but the app then failed with this:

AttributeError: function/symbol 'pyclr_initialize' not found in library '\app_packages\clr_loader\ffi\dlls\arm64\ClrLoader.dll': error 0x7f. Did you mean: 'pyclr_finalize'?

No luck figuring it out so far. Let me know if you think we should add an error if the Toga bootstrap is used for now.

@freakboy3742
Copy link
Copy Markdown
Member

freakboy3742 commented Apr 16, 2026

I've found the source of the problem; the issue is that .NET Framework 4.x doesn't provide ARM64 builds, even though it's installed by default on Windows on ARM machine. You have to use .NET Core 8 (or newer) on an ARM64 machine, or use an x86-64 interpreter running in emulation mode.

See beeware/toga#2782 (comment) for details; I've just pushed beeware/toga#4331 that adds ARM64 support to Toga's Winforms backend.

Copy link
Copy Markdown
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Thanks for those updates. I've flagged some cosmetic details, plus one edge case with Python 3.10 and 3.11 that we'll need to handle.

We should also update the VSCode install instructions to remove the reference to VSCode 2022 (since 2026 is what you can download now), and include a reference to needing MSVS v143 VS 2022 C++ ARM64/x64 build tools.

The only other question left is exactly how to land the PR with the other dependencies. I've merged the Visual Studio template, but I can't automate tagging new binaries until we merge this PR; but this PR can't be merged until CI passes, and that won't happen until there's a Toga version that has ARM support. Obviously we'll need to test some pieces manually and add automated CI checks afterwards to break the stalemate; but I need to work out what sequence will be best for that.

Comment thread src/briefcase/platforms/windows/__init__.py Outdated
Comment thread changes/1887.feature.md Outdated
Comment thread src/briefcase/platforms/windows/__init__.py
Copy link
Copy Markdown
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Thanks for those updates - two more small tweaks, and I think we're good to go.

Comment thread src/briefcase/integrations/base.py
Comment thread docs/en/reference/platforms/windows/visualstudio.md
Copy link
Copy Markdown
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

One last tweak to the archive name for the stub binary - this became apparent when I manually generated the stub binary so these tests would pass.

Comment thread src/briefcase/commands/create.py Outdated
@freakboy3742
Copy link
Copy Markdown
Member

I've manually published stub binaries with the new names (using both your prefixing scheme, and the one that I've suggested inline), and re-run CI; and the ARM jobs are all passing, except for:

We can put those two on the skip list for now.

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Comment thread .github/workflows/ci.yml
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
@abdnh
Copy link
Copy Markdown
Contributor Author

abdnh commented Apr 21, 2026

docs-lint apparently failed due to a temporary issue with an apple.com link.

Copy link
Copy Markdown
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

I think we can call this done. I'm still working on Toga, and there's a couple of tweaks needed to the Visual Studio template before I can tag "official" binaries (including a minor walk-back of the stdout re-opening - see this pr for details) - but this does everything the Briefcase part needs to do. Thanks for the PR!

@freakboy3742 freakboy3742 merged commit c5ee905 into beeware:main Apr 21, 2026
130 of 131 checks passed
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.

Add support for Windows on ARM

2 participants