Skip to content

Commit 78c01b7

Browse files
committed
Improve error message for CRuby < 2.6 on macos-arm64
* Is this the best error message ever?
1 parent d5fb7a2 commit 78c01b7

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

dist/index.js

+15-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,21 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
175175
throw new Error(`CRuby < 2.6 does not support macos-arm64.
176176
Either use a newer Ruby version or use a macOS image running on amd64, e.g., macos-13 or macos-12.
177177
Note that GitHub changed the meaning of macos-latest from macos-12 (amd64) to macos-14 (arm64):
178-
https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/`)
178+
https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/
179+
180+
If you are using a matrix of Ruby versions, a good solution is to run only < 2.6 on amd64, like so:
181+
matrix:
182+
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
183+
os: [ ubuntu-latest, macos-latest ]
184+
# CRuby < 2.6 does not support macos-arm64, so test those on amd64 instead
185+
exclude:
186+
- { os: macos-latest, ruby: '2.4' }
187+
- { os: macos-latest, ruby: '2.5' }
188+
include:
189+
- { os: macos-13, ruby: '2.4' }
190+
- { os: macos-13, ruby: '2.5' }
191+
192+
But of course you should consider dropping support for these long-EOL Rubies, which cannot even be built on recent macOS machines.`)
179193
}
180194

181195
return version

0 commit comments

Comments
 (0)