From 78c01b705fd9d5ad960d432d3a0cfa341d50e410 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 8 Jun 2024 13:39:56 +0200 Subject: [PATCH] Improve error message for CRuby < 2.6 on macos-arm64 * Is this the best error message ever? --- dist/index.js | 16 +++++++++++++++- index.js | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9d82bf49e..b2df1e7ff 100644 --- a/dist/index.js +++ b/dist/index.js @@ -65910,7 +65910,21 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe 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/`) + https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/ + + If you are using a matrix of Ruby versions, a good solution is to run only < 2.6 on amd64, like so: + matrix: + ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3'] + os: [ ubuntu-latest, macos-latest ] + # CRuby < 2.6 does not support macos-arm64, so test those on amd64 instead + exclude: + - { os: macos-latest, ruby: '2.4' } + - { os: macos-latest, ruby: '2.5' } + include: + - { os: macos-13, ruby: '2.4' } + - { os: macos-13, ruby: '2.5' } + + But of course you should consider dropping support for these long-EOL Rubies, which cannot even be built on recent macOS machines.`) } return version diff --git a/index.js b/index.js index a3c40ac0c..85d20f616 100644 --- a/index.js +++ b/index.js @@ -175,7 +175,21 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe 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/`) + https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/ + + If you are using a matrix of Ruby versions, a good solution is to run only < 2.6 on amd64, like so: + matrix: + ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3'] + os: [ ubuntu-latest, macos-latest ] + # CRuby < 2.6 does not support macos-arm64, so test those on amd64 instead + exclude: + - { os: macos-latest, ruby: '2.4' } + - { os: macos-latest, ruby: '2.5' } + include: + - { os: macos-13, ruby: '2.4' } + - { os: macos-13, ruby: '2.5' } + + But of course you should consider dropping support for these long-EOL Rubies, which cannot even be built on recent macOS machines.`) } return version