From: "eviljoel (evil joel) via ruby-core" <ruby-core@...> Date: 2023-03-08T19:23:48+00:00 Subject: [ruby-core:112748] [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 eviljoel (evil joel). I listed the wrong compiler flags above. The correct flags are -std=gnu11 and -std=gnu99. ---------------------------------------- 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-102239 * Author: eviljoel (evil joel) * Status: Open * 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/