Repository navigation
Build Ruby < 3.2 with GCC 15 everywhere, not only on Fedora - #2649
Merged
Merged
Conversation
GCC 15 defaults to C23, which Ruby < 3.2 can't compile as. Detect the GCC version instead of the OS, so that e.g. Ubuntu 26.04 is handled too. The flag keeps going through the cflags configure variable, except for Ruby 2.6 where it goes on CC, because its MJIT header check runs a bare $(CC) and would otherwise fail. Ported from ruby/ruby-builder#31 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
I tested this in Docker on Ubuntu 26.04 and it fails before and passes after for Ruby 3.1. |
Member
Author
|
Given this addresses a known TODO in the codebase, a rather urgent issue (lots of GitHub Actions will fail otherwise) and it's a fairly localized and well-tested change I would like to merge it to master now. I will happily address any comment in a follow-up PR. |
This was referenced Oct 31, 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.
GCC 15 defaults to C23, which Ruby < 3.2 can't compile as (see ruby/setup-ruby#922 (comment))
Detect the GCC version instead of the OS, so that e.g. Ubuntu 26.04 is handled too.
The flag keeps going through the cflags configure variable, except for Ruby 2.6 where it goes on CC, because its MJIT header check runs a bare $(CC) and would otherwise fail.
Ported from ruby/ruby-builder#31
Will help to fix ruby/setup-ruby#954