Releases for AArch64 (ARM64)

A stable release for the Raspberry Pi would be awesome! The use case I have in mind is education.

Now if you want to teach kids to code in Swift you usually need a Mac which is pretty expensive. Raspberry Pi support + LSP would enable teaching Swift on the Pi using VSCode which would be a low cost and very nice learning environment. The Pi has a rich teaching ecosystem with resources and fun experiments you could do with periferal hardware.

In short, if it’s not a huge burden on the core team, I am a huge fan of an official ARM64 support.

1 Like

ARM64 (AArch64) is more than just the RPi too.

AArch64 is going to be the new big player in the Enterprise space (Amazon just made a big announcement regarding EC2 instances : Introducing Amazon EC2 A1 Instances Powered By New Arm-based AWS Graviton Processors) and in the mid-high end mobile space (quite a few AArch64 laptops are popping up of late [HP Envy X2, Asus NovaGo, Lenovo MIIX 360, Samsung's Galaxy Book 2, etc etc]).

So adding AArch64 support is starting to sound like the right thing to do.

Sorry if this is a stupid question: What is the difference between AArch64 / ARM64 and what the iOS ecosystem runs on? Since the later is quite prominently supported by swift why is the former such an issue?

The latest Apple processors are AArch64 (ARM64, ARMv8) based.

So supporting the architecture seems like a no brainer to me.

Still not 100% sure why only x86_64 is supported. My guess is because that's what Macbooks still use.

But not for long if this is to believed: Apple to dump Intel CPUs from Macs for Arm – yup, the rumor that just won't die is back • The Register

Definitely not a stupid question.
If you read the "About Swift" page it gives an explanation about the differences between Apple Platforms and Linux.
Once you have written your code you then need to build it using the Swift compiler.
If you are developing for Apple platforms you will be using XCode on your Mac (x86_64) to compile your swift code. There is never any need to be able to compile your Swift code on an iPhone or other ARM64 Apple devices.

If your computer is not an x86_64 device such as a Raspberry Pi and you want to compile your swift code, you need a version of the Swift compiler than is compatible with the arch type and OS of your system.
e.g AArch64_Ubuntu_16.04. or Armv7_Raspbian_Stretch.

Thanks I did not think about the difference between running an executable and building the executable.
However,

There is never any need to be able to compile your Swift code on an iPhone or other ARM64 Apple devices.

How does Swift Playgrounds build swift code on iPad then?

Also, as it stand today, can you compile a binary with the swift compiler on Mac that will execute on a RaspberryPi ARM64?

Any updates since we discussed this?

The bug appears open still too: [SR-9500] AArch64 (ARM64, ARMv8)) Support · Issue #297 · apple/swift-docker · GitHub

@lag-linaro PR's have been approved and merged in the master and swift-5.0 branches. Both branches are now building patch free. swift-4.2-branch still needs a couple of PR's approved, hopefully they will be included in the Swift 4.2.3 release.
There are a small number of failing tests in swift-5.0-branch that need to be addressed, but all in all everything is looking pretty good.
There are swift-5.0 developer snapshots available for testing here:- Releases · futurejones/swift-arm64 · GitHub
Swift-Arm Community releases of Swift 4.2.2 for Ubuntu 16.04, Ubuntu 18.04 and Debian 9 are available here:- swift-arm/release - Packages · packagecloud

3 Likes

@futurejones well I was not expecting that. Great work Neil.

I'm pleased your hard work has finally been accepted upstream.

So where does that leave us with the docker image (still only marked for amd64):

Docker Hub

This is the Issue I submitted some months ago (which was moved here):

Support for ARM64v8 · Issue #116 · apple/swift-docker · GitHub

Hopefully support for AArch64 will be added soon.

1 Like

The DockerHub image is still lacking ARM* support.

https://hub.docker.com/_/swift

Is this planned at all?

3 Likes

Anyone?

The compiler that I have on Azure is capable of targeting ARM, the problem is that I do not have the standard library built for Linux ARM continuously yet (due to difficulties with CI - I've not yet had time to investigate and fix those issues). It does however support ARMv7 and ARM64 on Android and Windows.

2 Likes