Swift Installer for Windows on ARM?

Is there an installer for the Swift compiler for Windows 11 on ARM which is as easy to use as for Intel?

1 Like

I wish the answer were yes, but unfortunately not yet. We just are updating to WiX 4 now which is a prerequisite for building the MSI/Installer for ARM64.

Sadly, it turns out that there is some issue in the ARM64 runtime that I’ve not yet been able to isolate that is causing trouble at runtime due to invalid memory accesses.

I am rather excited about having the toolchain natively on ARM64 on Windows as well, but trying to clean up as much as possible on x64. I’d welcome help to get the ARM64 tests fully passing :slight_smile:

8 Likes

Out of curiosity, what exactly were you intending to use this for? I wonder if there is another way to address the use case in the shorter term.

1 Like

The use case would be development with Swift for Windows on a Windows 11 VM on Macs with Apple Silicon. We already use Visual Studio for ARM on it and it is very usable. While my main work is on macOS, we also have the need to compile for Windows.

3 Likes

Ah thank you for verifying that. It is one of the items that I am interested in seeing sooner rather than later as it would generally be beneficial to get the ARM64 port rolling :slight_smile:

1 Like

I add my voice on the need to have Swift for Windows ARM.

Although Swift on Windows currently only supports x64 I have been successfully building my Swift projects on Windows ARM since Windows 10 ARM and now Window 11 ARM using Parallels Desktop on macOS with M1 (not counting also Linux ARM...). The resulting x64 code runs well on Windows ARM (thanks to the Windows x64 emulation layer) and therefore meets our current customer needs, but I would also like to be able to generate for Windows arm64 natively soon.

Thanks.

6 Likes

Same here, the current x86 build works well on ARM.
I suspect the builds to take longer since all code is compiled/run as x86.
So having native ARM support would be great.

Yes, ARM64 is an important target to support. However, there are plenty of things that are still missing on the x64 side as well. ARM64 support is getting better, and while we do not have official builds available yet, it is getting reasonably possible. I have been running a native ARM64 toolchain on Windows for a while. There are some more issues to be ironed out with the toolchain, and we still need to iron out how to provide official builds for them.

3 Likes

I just discovered on The Browser Company · GitHub the availability of builds for Windows ARM here
Release 20240213.2 · thebrowsercompany/swift-build · GitHub.

This is a nice discovery and my first attempts to build a simple project using installer-arm64.exe (Swift 5.11)
on Windows 11 ARM (Under Parallels Desktop) work successfully.

In his latest message on this thread Saleem Abdulrasool mentions that
"There are some more issues to be ironed out with the toolchain, and we still need to iron out how to provide official builds for them."

The Swift version for Windows ARM is not yet available on swift.org, I would like to know more about the current status and the roadmap.

Are there any known major issues that we should avoid?
Is Swift for Windows ARM planned for version 5.10 or 5.11?

Thanks !

3 Likes

No, there aren't known major issues, most of those have been addressed. There is one crash that we are seeing which we haven't fully isolated and thus do not necessarily have an understanding of the shape of the issue. On the other hand, that is a large code base with C++ Interop :man_shrugging:.

There are no concrete plans. We are looking at getting build.ps1 support for cross-compiling the toolchain. This will require subsequent setup on the CI that @mishal_shah would be better suited to help with ascertaining the resourcing for.

In the mean time, the builds that you referenced would be the best choice.

2 Likes

Thanks for the feedback Saleem, very appreciated !

Add cross-compiling support for the windows toolchain by hjyamauchi · Pull Request #71584 · apple/swift · GitHub is the PR that @hjyamauchi and I worked on recently to add the support for the cross-compilation so that we can get this functionality enabled for official releases as well.

Yes!

Now that ARM64 installers for Swift-main are available on the homepage, I was wondering what version of Python is required to set up debugging in Visual Studio Code. Python 3.9 binaries for Windows on ARM were never officially released. Is there a trusted source for Python 3.9 ARM64 or do we need a different version?

By the way, thanks to everyone involved in bringing Swift to Windows on ARM. :slightly_smiling_face:

There are binaries available on nuget for python 3.9 on ARM64 - NuGet Gallery | pythonarm64 3.9.10. We are trying to track the same version of python across x64 and ARM64 as well as across macOS and Windows, and hopefully we will be able to use releases off of python.org whenever the next python bump occurs.

1 Like

Nice. I'm glad that the installer is available: Swift.org - Install Swift

Great, thanks again. After extracting Python from the NuGet package and setting PYTHONHOME (didn't work for me without that environment variable), I can debug Swift code in Visual Studio Code without any problem.