From 582765abd93e22e3a9dde6e8ff729b4dacc77f5b Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 17 Nov 2024 22:44:31 -0500 Subject: [PATCH] add warning if requesting x64 on apple silicon runners --- lib/setup-julia.js | 3 +++ src/setup-julia.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lib/setup-julia.js b/lib/setup-julia.js index 471adfd0..014e8154 100644 --- a/lib/setup-julia.js +++ b/lib/setup-julia.js @@ -88,6 +88,9 @@ function run() { if (!originalArchInput) { // if `originalArchInput` is an empty string throw new Error(`Arch input must not be null`); } + if (originalArchInput == 'x64' && os.platform() == 'darwin' && os.arch() == 'arm64') { + core.warning('[setup-julia] x64 arch has been requested on a macOS runner that has an arm64 architecture. You may have meant to use the "aarch64" arch instead (or left if unspecified for the correct default).'); + } let processedArchInput; if (originalArchInput == "default") { // If the user sets the `arch` input to `default`, then we use the diff --git a/src/setup-julia.ts b/src/setup-julia.ts index 9ff3990a..b4237d21 100644 --- a/src/setup-julia.ts +++ b/src/setup-julia.ts @@ -62,6 +62,10 @@ async function run() { throw new Error(`Arch input must not be null`) } + if (originalArchInput == 'x64' && os.platform() == 'darwin' && os.arch() == 'arm64') { + core.warning('[setup-julia] x64 arch has been requested on a macOS runner that has an arm64 architecture. You may have meant to use the "aarch64" arch instead (or left if unspecified for the correct default).') + } + let processedArchInput: string; if (originalArchInput == "default") { // If the user sets the `arch` input to `default`, then we use the