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

Bundle native Arduino Firmware Uploader with Apple Silicon build #2338

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jan 21, 2024

Motivation

A separate build of Arduino IDE is produced for each of the macOS host architectures:

  • Apple Silicon (ARM)
  • Intel (x86)

The Arduino IDE distribution includes several bundled helper tools. The build of those tools should also be selected according to the target host architecture.

At the time the infrastructure was set up for bundling the "Arduino Firmware Uploader" tool with the Arduino IDE distribution, that tool was only produced in a macOS x86 variant. So this was used even in the Apple Silicon Arduino IDE distribution, relying on Rosetta 2 to provide compatibility when used on Apple Silicon machines. Since that time, the Arduino Firmware Uploader build infrastructure has been updated to produce an Apple Silicon build of the tool (arduino/arduino-fwuploader#144) and such a build is available for the IDE's current version dependency of Arduino Firmware Updater:

"arduino-fwuploader": {
"version": "2.4.1"
},

https://github.com/arduino/arduino-fwuploader/releases/tag/2.4.1

Change description

This PR updates the "Arduino Firmware Uploader" tool bundling script ito use the most appropriate variant of the dependency for the target host architecture. This provides the following benefits

  • Compatibility with systems that don't have Rosetta 2 installed
  • Improved performance

Other information

I ran a demonstration build that includes the Apple Silicon variant in my fork:

https://github.com/per1234/arduino-ide/actions/runs/7602618426


Resolves #2337 by completing all related tasks in this codebase (work in other codebases should be tracked in those issue trackers).

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

A separate build of Arduino IDE is produced for each of the macOS host architectures:

* Apple Silicon (ARM)
* Intel (x86)

The Arduino IDE distribution includes several bundled helper tools. The build of those tools should also be selected according to the target host architecture.

At the time the infrastructure was set up for bundling the "Arduino Firmware Uploader" tool with the Arduino IDE distribution, that tool was only produced in a macOS x86 variant. So this was used even in the Apple Silicon Arduino IDE distribution, relying on Rosetta 2 to provide compatibility when used on Apple Silicon machines. Since that time, the Arduino Firmware Uploader build infrastructure has been updated to produce an Apple Silicon build of the tool and such a build is available for the IDE's current version dependency of Arduino Firmware Updater.

The "Arduino Firmware Uploader" tool bundling script is hereby updated to use the most appropriate variant of the dependency for the target host architecture. This provides the following benefits

* Compatibility with systems that don't have Rosetta 2 installed
* Improved performance
@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure architecture: arm Specific to ARM host architecture os: macos Specific to macOS operating system labels Jan 21, 2024
@per1234 per1234 self-assigned this Jan 21, 2024
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

Thank you, Per!

I verified it:

uname -m
x86_64
file ~/Desktop/Arduino\ IDE.app/Contents/MacOS/Arduino\ IDE 
/Users/a.kitta/Desktop/Arduino IDE.app/Contents/MacOS/Arduino IDE: Mach-O 64-bit executable arm64
file ~/Desktop/Arduino\ IDE.app/Contents/Resources/app/lib/backend/resources/arduino-fwuploader 
/Users/a.kitta/Desktop/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-fwuploader: Mach-O 64-bit executable arm64
cat ~/Desktop/Arduino\ IDE.app/Contents/Resources/app/package.json | jq .version          
"2.2.2-snapshot-786cb7b"

@per1234 per1234 merged commit 0e7b0c9 into arduino:main Jan 22, 2024
19 checks passed
@per1234 per1234 deleted the fwuploader-apple-silicon branch January 22, 2024 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture: arm Specific to ARM host architecture os: macos Specific to macOS operating system topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arduino IDE builtins Apple ARM support
2 participants