IDE 2.0.4 Apple Silicon install contains Intel architecture avr-g++

I downloaded and installed Arduino IDE 2.0.4 for macOS Apple Silicon (https://downloads.arduino.cc/arduino-ide/arduino-ide_2.0.4_macOS_arm64.dmg).

However, when I try to verify a basic sketch, I get the following error:

fork/exec /Users/Colin/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++: bad CPU type in executable

Running the lipo command on the avr-g++ executable returns:

[20:13:12] (~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin) > lipo -info avr-g++
Non-fat file: avr-g++ is architecture: x86_64

Running the same command on the Arduino IDE itself returns:

[20:14:05] (/Applications/Arduino IDE.app/Contents/MacOS) > lipo -info Arduino\ IDE 
Non-fat file: Arduino IDE is architecture: arm64

The Arduino IDE itself is arm64, but the tooling is still Intel, which doesn't work unless you have Rosetta installed (which I do not).

2 Likes

Hi @ccashman. When you install a boards platform via the Arduino IDE Boards Manager on an Apple Silicon machine, the IDE first checks to see if each of the tool dependencies (e.g., avr-gcc) is available for the Apple Silicon host type. If no build for that host type is found, it falls back on installing the tool built for the macOS Intel host. This behavior is intentional, since the Intel build is compatible with the Intel Silicon machines via Rosetta. The only alternative would be to fail the installation of the boards platform entirely.

So the infrastructure is already in place in Arduino IDE to correctly handle tools built for native Apple Silicon. The only missing piece is that those builds have not been produced. Unfortunately it can be more challenging to build for that host because the "GitHub Actions" automation framework Arduino uses to produce builds does not offer Apple Silicon machines. This means automated native builds for that host are not possible and the only remaining option is either cross-compiling (which is more tricky) or manual builds (which are time consuming and prone to human error).

So my recommendation is for you to install Rosetta. You can follow the instructions here to do that:

https://support.arduino.cc/hc/en-us/articles/7765785712156-Error-bad-CPU-type-in-executable-on-macOS#:~:text=complete%20the%20installation.-,Manual%20Installation,-If%20the%20tool

Unfortunately it can be more challenging to build for that host because the "GitHub Actions" automation framework Arduino uses to produce builds does not offer Apple Silicon machines.

Not GitHub-hosted ones, but you can use self-hosted Apple Silicon machines for running actions.

GitHub-hosted runners are on the roadmap to be beta'ed for Q4 2023. If self-hosted machines is not a workable solution now, then hopefully around the winter/spring of 2024 it will be sorted out by GitHub directly.

So my recommendation is for you to install Rosetta.

I'm trying to avoid installing Rosetta on my system (I'm weird). I will just continue using my older Intel machine for Arduino development while the native runner support is worked out.

I'm aware. I actually set up an Apple Silicon self-hosted runner to produce the Arduino IDE 2.x builds for that host type. Even though it is fairly easy to set up a basic self-hosted runner on your computer and integrate it into a GitHub Actions workflow, there are infrastructure and security considerations specific to self-hosted runners that make this not so simple as it might seem when it comes to using them to produce builds of software that will be distributed to many thousands of users.

It would definitely be nice. Based on my experience with the special limitations AWS EC2 Apple Silicon hosts, I think there are some significant challenges to doing this, especially if they are going to be part of the free GitHub Actions services. But maybe Microsoft can work out a better solution with Apple than Amazon managed to accomplish.

I am given cause for concern by the fact that GitHub apparently doesn't even know the correct term for the architecture:

https://github.com/github/roadmap/issues/528

powered by Apply silicone

:person_facepalming:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.