From 0f702cc7c105bc92d92847748350038bf6aed35b Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Sun, 11 Feb 2024 03:36:04 +0100 Subject: [PATCH] Fix the Apple Silicon (macOS `aarch64` / `arm64`) URLs for Julia nightly (#220) * fix aarch64 urls for nightly * rebuild js for aarch64 nightly * test nightly on apple m1 (aarch64) * Run on more macOS versions, and add a few comments --------- Co-authored-by: Dilum Aluthge --- .../example-builds-nightly-defaultarch.yml | 9 ++++++++- lib/installer.js | 17 +++++++++++++++-- src/installer.ts | 13 +++++++++++-- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.github/workflows/example-builds-nightly-defaultarch.yml b/.github/workflows/example-builds-nightly-defaultarch.yml index 2fb1393..40b9a88 100644 --- a/.github/workflows/example-builds-nightly-defaultarch.yml +++ b/.github/workflows/example-builds-nightly-defaultarch.yml @@ -19,7 +19,14 @@ jobs: fail-fast: false matrix: julia-version: [nightly, 1.10-nightly] - os: [ubuntu-latest, macOS-latest, windows-latest] + os: + - ubuntu-latest + - windows-latest + - macos-11 # Intel + - macos-12 # Intel + - macos-13 # Intel + - macos-14 # Apple Silicon + - macos-latest # Currently Intel, but will probably point to Apple Silicon in the future steps: - uses: actions/checkout@v4 diff --git a/lib/installer.js b/lib/installer.js index f1aba02..fcd82f5 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -156,10 +156,23 @@ function getNightlyFileName(arch) { if (arch == 'x86') { throw new Error('32-bit Julia is not available on macOS'); } - versionExt = '-mac64'; + else if (arch == 'aarch64') { + versionExt = '-macaarch64'; + } + else { + versionExt = '-mac64'; + } } else if (osPlat === 'linux') { - versionExt = arch == 'x64' ? '-linux64' : '-linux32'; + if (arch == 'x86') { + versionExt = '-linux32'; + } + else if (arch == 'aarch64') { + versionExt = '-linux-aarch64'; + } + else { + versionExt = '-linux64'; + } } else { throw new Error(`Platform ${osPlat} is not supported`); diff --git a/src/installer.ts b/src/installer.ts index 25aede5..f6c040a 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -128,10 +128,19 @@ function getNightlyFileName(arch: string): string { } else if (osPlat == 'darwin') { if (arch == 'x86') { throw new Error('32-bit Julia is not available on macOS') + } else if (arch == 'aarch64') { + versionExt = '-macaarch64' + } else { + versionExt = '-mac64' } - versionExt = '-mac64' } else if (osPlat === 'linux') { - versionExt = arch == 'x64' ? '-linux64' : '-linux32' + if (arch == 'x86') { + versionExt = '-linux32' + } else if (arch == 'aarch64') { + versionExt = '-linux-aarch64' + } else { + versionExt = '-linux64' + } } else { throw new Error(`Platform ${osPlat} is not supported`) }