Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for arm64-apple-macosx13.0.0 binaries #7729

Closed
1 task done
nickdesaulniers opened this issue Jan 18, 2023 · 5 comments
Closed
1 task done

support for arm64-apple-macosx13.0.0 binaries #7729

nickdesaulniers opened this issue Jan 18, 2023 · 5 comments
Assignees
Labels
Status: Solved Type: Feature request Feature request for Arduino ESP32
Milestone

Comments

@nickdesaulniers
Copy link

Related area

toolchain support on aarch64 macos hosts

Hardware specification

XIAO ESP32C3

Is your feature request related to a problem?

refiling the issue I filed at: espressif/crosstool-NG#39:

See also arduino/arduino-ide#1818 and https://forum.arduino.cc/t/one-mac-sees-my-arduinos-the-other-doesnt/1076201/20. I'm on macos on apple silicon. Following https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/, I'm using https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json. Grepping the json for apple, I see cross compilers provided for x86_64-apple-darwin but not any of the apple silicon targets, which are aarch64 based.

This can result in the Arduino IDE swallowing errors since it can't run the utilities from the command line if rosetta is not installed.

Describe the solution you'd like

I guess https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json should have entries for aarch64 macos host triples? @Jason2866 claims they exist, but perhaps the json needs to describe that they do?

Describe alternatives you've considered

No response

Additional context

No response

I have checked existing list of Feature requests and the Contribution Guide

  • I confirm I have checked existing list of Feature requests and Contribution Guide.
@me-no-dev
Copy link
Member

We do have the packages for aarch64, but arduino-cli does not seem to check/support that separately in the package json. So we provide only the x86_64 versions. When such support is added to arduino-cli, we will provide the necessary items in the json. If we knew how they would name the arch, we could do it even now, though they will not be installed untill support is added by the Arduino team. I will assign this to myself to track the problem until it can be resolved.

@me-no-dev me-no-dev self-assigned this Jan 18, 2023
@Jason2866
Copy link
Collaborator

There are alternatives to use Arduino espressif32 :-)
Apple ARM toolchains are used when using Platformio

@per1234
Copy link
Contributor

per1234 commented Jan 19, 2023

Hi @me-no-dev.

arduino-cli does not seem to check/support that separately in the package json. So we provide only the x86_64 versions. When such support is added to arduino-cli, we will provide the necessary items in the json. If we knew how they would name the arch, we could do it even now, though they will not be installed untill support is added by the Arduino team.

It is already supported.

Arduino CLI (and Arduino IDE) will give preference to a tool with the package index packages[*].tools[*].systems[*].host field value matching the regular expression arm64-apple-darwin.* when running on an Apple Silicon host.

Since x86 binaries are also usable on Apple Silicon hosts with Rosetta 2 installed, if the tool is not available for that host it will fall back to a tool with packages[*].tools[*].systems[*].host value matching the regular expression x86_64-apple-darwin.*.

If it still doesn't get a match, it falls back again to a tool with packages[*].tools[*].systems[*].host value matching the regular expression i[3456]86-apple-darwin.*.

So just add the tool entries with packages[*].tools[*].systems[*].host value set to something like arm64-apple-darwin (this is the value Arduino is using) and Arduino CLI will install it.

Here is the code that does the tool selection:

https://github.com/arduino/arduino-cli/blob/271d241e13b63c014383af5d6eec270ad512ce03/arduino/cores/tools.go#L126-L213

If we knew how they would name the arch

The need to improved the documentation of the package index packages[*].tools[*].systems[*].host field is tracked here: arduino/arduino-cli#2004

@me-no-dev
Copy link
Member

We can give it a shot for the next release then :)

@VojtechBartoska VojtechBartoska added this to the 2.0.7 milestone Jan 25, 2023
@VojtechBartoska VojtechBartoska added the Status: Pending Merge Pull Request is ready to be merged label Feb 13, 2023
@me-no-dev
Copy link
Member

It's part of the released 2.0.7

@VojtechBartoska VojtechBartoska added Status: Solved and removed Status: Pending Merge Pull Request is ready to be merged labels Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Solved Type: Feature request Feature request for Arduino ESP32
Projects
Development

Successfully merging a pull request may close this issue.

5 participants