Skip to content

Build Ruby < 3.2 with GCC 15 everywhere, not only on Fedora - #2649

Merged
eregon merged 1 commit into
rbenv:masterfrom
eregon:gcc15-old-rubies
Oct 31, 2026
Merged

eregon merged 1 commit into
rbenv:masterfrom
eregon:gcc15-old-rubies

Conversation

@eregon

@eregon eregon commented Oct 31, 2026

Copy link
Copy Markdown
Member

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

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>
@eregon

eregon commented Oct 31, 2026

Copy link
Copy Markdown
Member Author

I tested this in Docker on Ubuntu 26.04 and it fails before and passes after for Ruby 3.1.

@eregon
eregon requested review from hsbt and mislav October 31, 2026 19:47
@eregon

eregon commented Oct 31, 2026 •

Copy link
Copy Markdown
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.
Let me know if that was not OK.

I will happily address any comment in a follow-up PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ubuntu-26.04 does not have builds of Ruby <= 3.1

1 participant