From: "jaruga (Jun Aruga) via ruby-core" Date: 2023-03-09T10:58:03+00:00 Subject: [ruby-core:112780] [Ruby master Bug#19518] Recent Source Releases Do Not Compile on CentOS 7 Due to configure Script Error Generated By autoconf >= 2.70 Issue #19518 has been updated by jaruga (Jun Aruga). > 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. In this case, I believe when you try to build the new applications in CentOS7 / RHEL 7, a better choice is using a new version gcc by installing the RPM package in the Software Collections (SCL) rather than using the old version system gcc. You can see the * https://linuxize.com/post/how-to-install-gcc-compiler-on-centos-7/#installing-multiple-gcc-versions * https://www.softwarecollections.org/en/docs/ The steps to install the new version gcc via SCL. I have not tested the steps by myself. Install the SCL. ``` $ sudo yum install centos-release-scl ``` Search the available software collections "devtoolset-N" including the gcc. Replace the N with the actual number that you find. ``` $ yum search devtoolset ``` Install the SCL. ``` $ sudo yum install devtoolset-N ``` Enable the software collection. When you want to use ``` $ scl enable devtoolset-N bash $ gcc --version ``` When you want to enable the SCL in the `Dockerfile` or a bash script without interactive mode. Maybe the script can be like this. ``` scl enable devtoolset-7 - << \EOF set -ex gcc --version ./configure ... make make install EOF ``` ---------------------------------------- Bug #19518: Recent Source Releases Do Not Compile on CentOS 7 Due to configure Script Error Generated By autoconf >= 2.70 https://bugs.ruby-lang.org/issues/19518#change-102278 * Author: eviljoel (evil joel) * Status: Closed * Priority: Normal * ruby -v: 3.2.1, 3.2.0, 3.1.3, 3.0.5 * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- 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-------------------------------- ruby321BuildFailure-20230308.Dockerfile (531 Bytes) ruby321BuildWorkAround-20230308.Dockerfile (586 Bytes) -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/