From dc4ca25e0a01e072ba3cf1fc47612aff72c980af Mon Sep 17 00:00:00 2001 From: nagachika Date: Sat, 15 Jun 2024 13:13:19 +0900 Subject: [PATCH] merge revision(s) 22e4eeda6561693367fc7a00b92b90f46b09cabd, 1ab7c412d2e3880a7ad233c32e93961888f8145c, fd549b229b0822198ddc847703194263a2186ed1: [Backport #20515] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ci: Test whether GMP is working in compilers.yml (#10875) Avoid reoccurence of [Bug #20515] Requires https://github.com/ruby/ruby/pull/10876 since 18eaf0be905e3e251423b42d6f4e56b7cae1bc3b bug: https://bugs.ruby-lang.org/issues/20515 RUBY_CHECK_HEADER didn't define HAVE_{header-file} (#10876) --with-gmp is not working at all because HAVE_GMP_H was missing since 18eaf0be90. [Bug #20515] bug: https://bugs.ruby-lang.org/issues/20515 follow-up: https://bugs.ruby-lang.org/issues/20494 follow-up: 18eaf0be905e3e251423b42d6f4e56b7cae1bc3b follow-up: https://github.com/ruby/ruby/pull/10805 test_bignum: defined? returns String (#10880) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit didn't verify the test is working properly due to mistaken auto-merge… [Bug #20515] bug: https://bugs.ruby-lang.org/issues/20515 follow-up: 22e4eeda6561693367fc7a00b92b90f46b09cabd follow-up: https://github.com/ruby/ruby/pull/10875 --- .github/workflows/compilers.yml | 3 ++- test/ruby/test_bignum.rb | 6 ++++++ tool/m4/ruby_check_header.m4 | 2 +- version.h | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index 731bda1cda..431a839e61 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -1,3 +1,4 @@ +# Some tests depending on this name 'Compilations' via $GITHUB_WORKFLOW. Make sure to update such tests when renaming this workflow. name: Compilations on: @@ -147,7 +148,7 @@ jobs: - { name: '-O0', env: { optflags: '-O0 -march=x86-64 -mtune=generic' } } # - { name: '-O3', env: { optflags: '-O3 -march=x86-64 -mtune=generic' }, check: true } - - { name: gmp, env: { append_configure: '--with-gmp' } } + - { name: gmp, env: { append_configure: '--with-gmp' }, check: true } - { name: jemalloc, env: { append_configure: '--with-jemalloc' } } - { name: valgrind, env: { append_configure: '--with-valgrind' } } - { name: 'coroutine=ucontext', env: { append_configure: '--with-coroutine=ucontext' } } diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index 065a944853..1b705b02a8 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -821,5 +821,11 @@ class TestBignum < Test::Unit::TestCase assert_nil(T1024P.infinite?) assert_nil((-T1024P).infinite?) end + + def test_gmp_version + if RbConfig::CONFIG.fetch('configure_args').include?("'--with-gmp'") + assert_kind_of(String, Integer::GMP_VERSION) + end + end if ENV['GITHUB_WORKFLOW'] == 'Compilations' end end diff --git a/tool/m4/ruby_check_header.m4 b/tool/m4/ruby_check_header.m4 index 171455549e..6fec9d16c5 100644 --- a/tool/m4/ruby_check_header.m4 +++ b/tool/m4/ruby_check_header.m4 @@ -3,6 +3,6 @@ AC_DEFUN([RUBY_CHECK_HEADER], [# RUBY_CHECK_HEADER($@) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS m4_if([$5], [], [$INCFLAGS], [$5])" - AC_CHECK_HEADER([$1], [$2], [$3], [$4]) + AC_CHECK_HEADERS([$1], [$2], [$3], [$4]) CPPFLAGS="$save_CPPFLAGS" unset save_CPPFLAGS]) diff --git a/version.h b/version.h index fb7fa3124c..8b34b41fd9 100644 --- a/version.h +++ b/version.h @@ -11,7 +11,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 4 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 177 +#define RUBY_PATCHLEVEL 178 #include "ruby/version.h" #include "ruby/internal/abi.h"