From d046db60e330fabc5f3aa2535500c8cc3fb26b07 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 30 May 2024 14:41:43 +0200 Subject: [PATCH] Fail clearly for CRuby < 2.6 on macos-arm64 --- dist/index.js | 8 ++++++++ index.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/dist/index.js b/dist/index.js index 7aaa6c5e3..b1192283c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -65886,6 +65886,14 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe found = latestToFirstVersion.find(v => !common.isHeadVersion(v) && v.startsWith(parsedVersion)) } + // Well known version-platform combinations which do not work: + if (found && engine === 'ruby' && platform.startsWith('macos') && platform.endsWith('arm64') && common.floatVersion(found) < 2.6) { + throw new Error(`CRuby < 2.6 does not support macos-arm64. + Either use a newer Ruby version or use a macOS image running on amd64, e.g., macos-13 or macos-12. + Note that GitHub changed the meaning of macos-latest from macos-12 (amd64) to macos-14 (arm64): + https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/`) + } + if (found) { version = found } else { diff --git a/index.js b/index.js index 645e17a62..190ee4f53 100644 --- a/index.js +++ b/index.js @@ -161,6 +161,14 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe found = latestToFirstVersion.find(v => !common.isHeadVersion(v) && v.startsWith(parsedVersion)) } + // Well known version-platform combinations which do not work: + if (found && engine === 'ruby' && platform.startsWith('macos') && platform.endsWith('arm64') && common.floatVersion(found) < 2.6) { + throw new Error(`CRuby < 2.6 does not support macos-arm64. + Either use a newer Ruby version or use a macOS image running on amd64, e.g., macos-13 or macos-12. + Note that GitHub changed the meaning of macos-latest from macos-12 (amd64) to macos-14 (arm64): + https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/`) + } + if (found) { version = found } else {