Skip to content

"Template" installation script does not consider M1 compatibility via Rosetta 2 #207

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

Closed
2 tasks
per1234 opened this issue Mar 9, 2022 · 1 comment · Fixed by #223
Closed
2 tasks

"Template" installation script does not consider M1 compatibility via Rosetta 2 #207

per1234 opened this issue Mar 9, 2022 · 1 comment · Fixed by #223
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Mar 9, 2022

This repository contains a "template" installation script that can provide a convenient installation option for any application that publishes builds via GitHub releases:

https://github.com/arduino/tooling-project-assets/tree/main/other/installation-script

This script automatically detects the host system OS and architecture and downloads the appropriate release file based on this.

Apple's Rosetta 2 software allows applications built for x86-64 hosts to run on machines using their ARM 64-bit M1 processor.

Due to current infrastructure challenges (e.g., lack of GitHub-hosted GitHub Actions runners), Arduino's applications may not yet be available as native M1 builds, yet the existing macOS x86-64 builds work perfectly well on these machines thanks to Rosetta 2.

The installation script currently fails to install these applications:

Did not find a release for your system: macOS arm64

This will cause prospective users to mistakenly think that the application is not available for their system.

To do

Related

Also reported at:

@per1234
Copy link
Contributor Author

per1234 commented Apr 15, 2022

From arduino/arduino-cli#1714 (comment) by @obra

There's a pretty straightforward change that would work for the arduino-cli implementation, although it might not be fully portable to other places arduino uses this script. You don't need to parse the releases page, since the release urls are easily predictable.

   # Support specifying nightly build versions (e.g., "nightly-latest") via the script argument.
   case "$TAG" in
   nightly*)
     DOWNLOAD_URL="https://downloads.arduino.cc/${PROJECT_NAME}/nightly/${APPLICATION_DIST}"
     ;;
   *)
     DOWNLOAD_URL="https://downloads.arduino.cc/${PROJECT_NAME}/${APPLICATION_DIST}"
    
 +GITHUB_TAG_DOWNLOAD_URL="https://github.com/arduino/${PROJECT_NAME}/releases/download/${TAG}/${PROJECT_NAME}/${APPLICATION_DIST}"
     ;;
   esac
 
   INSTALLATION_TMP_FILE="/tmp/$APPLICATION_DIST"
   echo "Downloading $DOWNLOAD_URL"
   httpStatusCode=$(getFile "$DOWNLOAD_URL" "$INSTALLATION_TMP_FILE")
   if [ "$httpStatusCode" -ne 200 ]; then
+    echo "Did not find a release for your system published on downloads.arduino.cc: $OS $ARCH"
+   echo "Trying to find a release from the GitHub releases page."
+   httpStatusCode=$(getFile "$GITHUB_TAG_DOWNLOAD_URL" "$INSTALLATION_TMP_FILE")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant