Project

General

Profile

Actions

Bug #19518

closed

Recent Source Releases Do Not Compile on CentOS 7 Due to configure Script Error Generated By autoconf >= 2.70

Added by eviljoel (evil joel) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
3.2.1, 3.2.0, 3.1.3, 3.0.5
[ruby-core:112746]

Description

Source releases where the 'configure' script was generated by autoconf 2.70 or greater results in a failed Ruby compilation on CentOS 7. This is because autoconf 2.70 and 2.71 adds some code that attempts to detect C11 support resulting in a compilation with the -std11 flag instead of the -std99 flag. The gcc bundled with CentOS 7 is version 4.8.5 which only has experimental C11 support. This experimental C11 support appears to not handle 'extern' appropriately.

I've included a Dockerfile that reproduces the problem:

FROM centos:7

RUN yum -y install autoconf gcc libyaml-devel make
RUN curl -O https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.1.tar.xz
# Verify the SHA256SUM as listed here: https://www.ruby-lang.org/en/news/2023/02/08/ruby-3-2-1-released/
RUN [ "$(sha256sum ruby-3.2.1.tar.xz | sed -n 's/^\([^\s]*\)\s.*/\1/p' | tr -d "\n" | tr -d ' ')" = '746c8661ae25449cbdc5297d1092702e93e66f365a75fecb740d4f292ced630c' ]
RUN tar -xf ruby-3.2.1.tar.xz
RUN cd ruby-3.2.1 && ./configure
RUN cd ruby-3.2.1 && make
RUN /ruby-3.2.1/ruby --version

I've also included a Dockerfile that works around the problem simply by regenerating the configure script with autoconf 2.69:

FROM centos:7

RUN yum -y install autoconf gcc libyaml-devel make
RUN curl -O https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.1.tar.xz
# Verify the SHA256SUM as listed here: https://www.ruby-lang.org/en/news/2023/02/08/ruby-3-2-1-released/
RUN [ "$(sha256sum ruby-3.2.1.tar.xz | sed -n 's/^\([^\s]*\)\s.*/\1/p' | tr -d "\n" | tr -d ' ')" = '746c8661ae25449cbdc5297d1092702e93e66f365a75fecb740d4f292ced630c' ]
RUN tar -xf ruby-3.2.1.tar.xz
RUN cd ruby-3.2.1 && autoconf configure.ac > configure
RUN cd ruby-3.2.1 && ./configure
RUN cd ruby-3.2.1 && make
RUN /ruby-3.2.1/ruby --version

This 'configure' bug affects the following releases of Ruby:
ruby-3.2.1
ruby-3.2.0
ruby-3.1.3
ruby-3.0.5

Ruby 2.7.7's 'configure' script was generated with autoconf 2.71 but appears to be unaffected.

My experience working with autoconf is very limited, but I believe this is mostly due to an error in autoconf itself. I believe autoconf should be smart enough to not attempt to leverage gcc's experimental C11 support. Regardless, Ruby should still compile correctly on CentOS 7 especially when prior bugfix releases of 3.0 and 3.1 did so successfully. At a minimum, future releases of 3.0 and 3.1 should generate their 'configure' scripts with autoconf 2.69 to maintain backwards compatibility and to address this regression. Ruby developers should also consider supporting compilation of Ruby 3.2 and 3.3 on CentOS 7 until CentOS 7 support ends next year.

If you agree this is also an autoconf error, I'll file a bug upstream.

Thank you.


Files


Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #19161: Cannot compile 3.0.5 or 3.1.3 on Red Hat Enterprise Linux 7FeedbackActions
Actions

Also available in: Atom PDF

Like0
Like0Like1Like0Like0Like0Like0Like0Like0