Repository navigation
Suggest the latest patch release when a version is unavailable - #949
Merged
Merged
Conversation
Newer runner images such as ubuntu-26.04 only have builds of the latest patch release of each series, so an exact version like 3.4.2 from .ruby-version fails with a 404 and only a link to request the build. On a 404, check whether the latest release of the same series exists for the platform. If it does, name it and the short version that always picks it. If it does not, say so and suggest a newer version or an older runner image. If that check fails for another reason, keep the previous message. Also document this in the README.
eregon
approved these changes
Oct 19, 2026
eregon
left a comment
Member
There was a problem hiding this comment.
This is great, thank you.
I'm tweaking the wording in the README and this should be good to go.
| The list of available Ruby versions can be seen in [ruby-builder-versions.json](ruby-builder-versions.json) for Ubuntu and macOS | ||
| (although some combinations are not available, see [the full list](https://github.com/ruby/ruby-builder/releases/tag/toolcache)) | ||
| and in [windows-versions.json](windows-versions.json) for Windows. | ||
| Newer runner images usually only have builds of the latest patch release of each series, |
Member
There was a problem hiding this comment.
Suggested change
| Newer runner images usually only have builds of the latest patch release of each series, | |
| Newer runner images only have builds of the latest patch release of each series, |
| (although some combinations are not available, see [the full list](https://github.com/ruby/ruby-builder/releases/tag/toolcache)) | ||
| and in [windows-versions.json](windows-versions.json) for Windows. | ||
| Newer runner images usually only have builds of the latest patch release of each series, | ||
| so prefer a short version like `'3.4'` over an exact one like `'3.4.2'` in `ruby-version` or `.ruby-version`. |
Member
There was a problem hiding this comment.
Suggested change
| so prefer a short version like `'3.4'` over an exact one like `'3.4.2'` in `ruby-version` or `.ruby-version`. | |
| so prefer a short version like `'3.4'` over an exact one like `'3.4.2'`, or pin to a specific runner version (e.g. `ubuntu-24.04`). |
eregon
reviewed
Oct 19, 2026
| @@ -57,6 +57,10 @@ Not all combinations of runner images and versions are supported. | |||
| The list of available Ruby versions can be seen in [ruby-builder-versions.json](ruby-builder-versions.json) for Ubuntu and macOS | |||
| (although some combinations are not available, see [the full list](https://github.com/ruby/ruby-builder/releases/tag/toolcache)) | |||
Member
There was a problem hiding this comment.
Suggested change
| (although some combinations are not available, see [the full list](https://github.com/ruby/ruby-builder/releases/tag/toolcache)) | |
| (although some combinations are not available, see [the full list](https://github.com/ruby/ruby-builder/releases)) |
Unfortunately that full list is no longer accurate, so let's just point to the release list.
(not related to this PR but changing wording around it so fixing it together anyway)
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the comment in #943 that the latest-patch-only policy "should be better documented though, including in this error message".
When
ubuntu-latestmoves toubuntu-26.04(rolling out from October 19, see actions/runner-images#14748), workflows onubuntu-latestthat pin an older patch version such as3.4.2inruby-versionor.ruby-version, or use a series older than 3.2, get this error:This PR keeps the error, but on a 404 it checks with one HEAD request whether the latest release of the same series exists for the platform, and says what to do:
If the HEAD request fails or returns anything other than 200 or 404, the previous message is shown unchanged.
headversions and series without a stable release also keep the previous message. The README gets a short note under Supported Platforms.Testing: we ran
dist/index.jsunder Node 24.21.0 in plainubuntu:26.04andubuntu:24.04containers with an empty tool cache, not on a hosted runner.3.4.2,3.1.4andjruby-9.4.3.0on 26.04 give the messages above (for JRuby it suggests'jruby-9.4.15.0'or'jruby-9.4').3.1resolves to 3.1.7, so its first line isruby-3.1.7 is the latest 3.1.x release.instead.'3.4'installs 3.4.11 on 26.04, and'jruby-9.4'downloads 9.4.15.0.3.4.2still installs on 24.04, and3.4.11on 26.04.fetchstubbed to throw, or to return 500, the message is the previous one.yarn run packageon the patched source reproduces the committeddist/index.js.This PR was prepared with AI assistance; we reviewed and tested it before opening it.