Skip to content

Use Apple Silicon build artifact name required by electron-updater #1919

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

Merged
merged 1 commit into from
Feb 27, 2023

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Feb 27, 2023

Motivation

The Arduino IDE update check uses a "channel update info file" on Arduino's download server. This file specifies the latest version of Arduino IDE available from the Arduino download server as well as the download URLs for the release archives.

There is a separate channel file for each host operating system:

Two macOS host architectures are now supported:

These each have their own release archive files. The macOS channel file contains data on both. So the updater must be able to identify the appropriate archive to use for the update based on the host architecture. This is based on the archive filename.

Arduino IDE's auto-update feature is built on the electron-updater package. The release archive selection is handled by the electron-updater codebase and the filename pattern is hardcoded there. It selects the archive file that contains arm64 in its name (case sensitive), if present, to use for updates on macOS hosts with ARM64 architecture:

https://github.com/electron-userland/electron-builder/blob/7704be02a076ec51a5bf118f59c0d47927b5c85f/packages/electron-updater/src/MacUpdater.ts#L67

const isArm64 = (file: ResolvedUpdateFileInfo) => file.url.pathname.includes("arm64") || file.info.url?.includes("arm64")

Previously, the build system produced archive files with the name format arduino-ide_<version>_macOS_ARM64.zip, consistent with the established naming in other Arduino tooling projects. Unfortunately this naming would cause either (depending on the order of the entries in the channel file) the x86 build to be used to update ARM64 macOS hosts (resulting in lesser performance due to Rosetta 2 overhead) or the ARM64 build to be used to update x86 hosts (resulting in the IDE failing to start).

Change description

Change the build artifact name to follow the format dictated by the electron-updater package.

Other information

Although it is not required (because electron-updater uses separate channel files for the x86 and ARM Linux hosts), the Linux archive filename format was also changed for the sake of consistency.

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)

The Arduino IDE update check uses a "channel update info file" on Arduino's download server. This file specifies the
latest version of Arduino IDE available from the Arduino download server as well as the download URLs for the release
archives.

There is a separate channel file for each host operating system:

- Windows
- Linux
- macOS

Two macOS host architectures are now supported:

- x86 (AKA "Intel")
- ARM64 (AKA "Apple Silicon")

These each have their own release archive files. The macOS channel file contains data on both. So the updater must be
able to identify the appropriate archive to use for the update based on the host architecture. This is based on the
archive filename.

Arduino IDE's auto-update feature is built on the electron-updater package. The release archive selection is handled by
the electron-updater codebase and the filename pattern is hardcoded there. It selects the archive file that contains
`arm64` in its name (case sensitive), if present, to use for updates on macOS hosts with ARM64 architecture.

Previously, the build system produced archive files with the name format arduino-ide_<version>_macOS_ARM64.zip,
consistent with the established naming in other Arduino tooling projects. Unfortunately this naming would cause either
(depending on the order of the entries in the channel file) the x86 build to be used to update ARM64 macOS hosts
(resulting in lesser performance due to Rosetta 2 overhead) or the ARM64 build to be used to update x86 hosts (resulting
in the IDE failing to start).

So it is necessary to change the build artifact name to follow the format dictated by the electron-updater package.
Although it is not required (because electron-updater uses separate channel files for the x86 and ARM hosts), the Linux
archive filename format was also changed for the sake of consistency.
@per1234 per1234 added topic: infrastructure Related to project infrastructure architecture: arm Specific to ARM host architecture os: macos Specific to macOS operating system type: imperfection Perceived defect in any part of project labels Feb 27, 2023
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!

Copy link
Contributor

@AlbyIanna AlbyIanna left a comment

Choose a reason for hiding this comment

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

LGTM

@per1234 per1234 merged commit fe19e0e into arduino:main Feb 27, 2023
@per1234 per1234 deleted the arm-artifact-name branch February 27, 2023 09:05
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: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants