diff --git a/.gitignore b/.gitignore index 8d476e9..a24978b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -SOURCES/ruby-2.7.3.tar.xz +SOURCES/ruby-2.7.4.tar.xz +SOURCES/ruby-rubygems-bundler-v2.2.24.txz diff --git a/.rh-ruby27-ruby.metadata b/.rh-ruby27-ruby.metadata index 4c356e1..9907499 100644 --- a/.rh-ruby27-ruby.metadata +++ b/.rh-ruby27-ruby.metadata @@ -1 +1,2 @@ -ce3d5203d5ab734df01e602c05f68f25249dc3e0 SOURCES/ruby-2.7.3.tar.xz +6e044d835f9f432cfa9441241c1ef66e3d607cbf SOURCES/ruby-2.7.4.tar.xz +da17623116cb189baeb3251f828d679e5570a938 SOURCES/ruby-rubygems-bundler-v2.2.24.txz diff --git a/SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch b/SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch index c249372..77b20ef 100644 --- a/SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch +++ b/SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch @@ -11,7 +11,7 @@ diff --git a/configure.ac b/configure.ac index d261ea57b5..3c13076b82 100644 --- a/configure.ac +++ b/configure.ac -@@ -3115,6 +3115,11 @@ AS_IF([test ${multiarch+set}], [ +@@ -3121,6 +3121,11 @@ AS_IF([test ${multiarch+set}], [ ]) archlibdir='${libdir}/${arch}' diff --git a/SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch b/SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch index 1694f87..a79aa25 100644 --- a/SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch +++ b/SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch @@ -14,7 +14,7 @@ diff --git a/configure.ac b/configure.ac index c42436c23d..d261ea57b5 100644 --- a/configure.ac +++ b/configure.ac -@@ -3753,7 +3753,8 @@ AS_CASE(["$ruby_version_dir_name"], +@@ -3759,7 +3759,8 @@ AS_CASE(["$ruby_version_dir_name"], ruby_version_dir=/'${ruby_version_dir_name}' if test -z "${ruby_version_dir_name}"; then diff --git a/SOURCES/ruby-2.1.0-always-use-i386.patch b/SOURCES/ruby-2.1.0-always-use-i386.patch index f41bd0b..a5a4011 100644 --- a/SOURCES/ruby-2.1.0-always-use-i386.patch +++ b/SOURCES/ruby-2.1.0-always-use-i386.patch @@ -11,7 +11,7 @@ diff --git a/configure.ac b/configure.ac index 3c13076b82..93af30321d 100644 --- a/configure.ac +++ b/configure.ac -@@ -3817,6 +3817,8 @@ AC_SUBST(vendorarchdir)dnl +@@ -3823,6 +3823,8 @@ AC_SUBST(vendorarchdir)dnl AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl diff --git a/SOURCES/ruby-2.1.0-custom-rubygems-location.patch b/SOURCES/ruby-2.1.0-custom-rubygems-location.patch index dde1098..ddfe9a5 100644 --- a/SOURCES/ruby-2.1.0-custom-rubygems-location.patch +++ b/SOURCES/ruby-2.1.0-custom-rubygems-location.patch @@ -15,7 +15,7 @@ diff --git a/configure.ac b/configure.ac index 93af30321d..bc13397e0e 100644 --- a/configure.ac +++ b/configure.ac -@@ -3789,6 +3789,10 @@ AC_ARG_WITH(vendorarchdir, +@@ -3795,6 +3795,10 @@ AC_ARG_WITH(vendorarchdir, [vendorarchdir=$withval], [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}]) @@ -26,7 +26,7 @@ index 93af30321d..bc13397e0e 100644 AS_IF([test "${LOAD_RELATIVE+set}"], [ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) RUBY_EXEC_PREFIX='' -@@ -3813,6 +3817,7 @@ AC_SUBST(sitearchdir)dnl +@@ -3819,6 +3823,7 @@ AC_SUBST(sitearchdir)dnl AC_SUBST(vendordir)dnl AC_SUBST(vendorlibdir)dnl AC_SUBST(vendorarchdir)dnl diff --git a/SOURCES/ruby-2.3.0-ruby_version.patch b/SOURCES/ruby-2.3.0-ruby_version.patch index 7efe039..a5865ce 100644 --- a/SOURCES/ruby-2.3.0-ruby_version.patch +++ b/SOURCES/ruby-2.3.0-ruby_version.patch @@ -20,7 +20,7 @@ diff --git a/configure.ac b/configure.ac index 80b137e380..63cd3b4f8b 100644 --- a/configure.ac +++ b/configure.ac -@@ -3704,9 +3704,6 @@ AS_CASE(["$target_os"], +@@ -3710,9 +3710,6 @@ AS_CASE(["$target_os"], rubyw_install_name='$(RUBYW_INSTALL_NAME)' ]) @@ -30,7 +30,7 @@ index 80b137e380..63cd3b4f8b 100644 rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'} AC_ARG_WITH(rubyarchprefix, AS_HELP_STRING([--with-rubyarchprefix=DIR], -@@ -3729,56 +3726,62 @@ AC_ARG_WITH(ridir, +@@ -3735,56 +3732,62 @@ AC_ARG_WITH(ridir, AC_SUBST(ridir) AC_SUBST(RI_BASE_NAME) @@ -120,7 +120,7 @@ index 80b137e380..63cd3b4f8b 100644 AS_IF([test "${LOAD_RELATIVE+set}"], [ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) -@@ -3795,6 +3798,7 @@ AC_SUBST(sitearchincludedir)dnl +@@ -3801,6 +3804,7 @@ AC_SUBST(sitearchincludedir)dnl AC_SUBST(arch)dnl AC_SUBST(sitearch)dnl AC_SUBST(ruby_version)dnl diff --git a/SOURCES/ruby-2.7.0-Remove-RubyGems-dependency.patch b/SOURCES/ruby-2.7.0-Remove-RubyGems-dependency.patch deleted file mode 100644 index 4166900..0000000 --- a/SOURCES/ruby-2.7.0-Remove-RubyGems-dependency.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 6532dbecf36d1f24dab1f2143afd171e0b7699eb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=ADt=20Ondruch?= -Date: Wed, 4 Sep 2019 15:07:07 +0200 -Subject: [PATCH] Remove RubyGems dependency. - -Since `Process::RLIMIT_NOFILE` is platform specific, better to use Ruby -introspection than detecting platform. ---- - .../vendor/net-http-persistent/lib/net/http/persistent.rb | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb -index a54be2a..06739f1 100644 ---- a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb -+++ b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb -@@ -197,10 +197,10 @@ class Bundler::Persistent::Net::HTTP::Persistent - ## - # The default connection pool size is 1/4 the allowed open files. - -- if Gem.win_platform? then -- DEFAULT_POOL_SIZE = 256 -- else -+ if Process.const_defined? :RLIMIT_NOFILE - DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4 -+ else -+ DEFAULT_POOL_SIZE = 256 - end - - ## --- -2.23.0 - diff --git a/SOURCES/ruby-2.7.4-Revert-fix-2.7-build-for-jit.patch b/SOURCES/ruby-2.7.4-Revert-fix-2.7-build-for-jit.patch new file mode 100644 index 0000000..bced19a --- /dev/null +++ b/SOURCES/ruby-2.7.4-Revert-fix-2.7-build-for-jit.patch @@ -0,0 +1,1088 @@ +diff --git a/configure.ac b/configure.ac +index 826a688871..af170efecd 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,5 +1,5 @@ + dnl Process this file with autoconf to produce a configure script. +-AC_INIT ++AC_INIT() + { + AC_CONFIG_AUX_DIR(tool) + AC_CONFIG_MACRO_DIRS(tool/m4) +@@ -150,9 +150,6 @@ AC_ARG_ENABLE(load-relative, + + AC_ARG_PROGRAM + +-# checks for UNIX variants that set C preprocessor variables +-AC_USE_SYSTEM_EXTENSIONS +- + dnl Checks for programs. + + cflagspat= +@@ -180,14 +177,12 @@ AS_CASE(["$host_os:$build_os"], + # clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-23 exported) + # Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn) + # Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn) +- AC_PREPROC_IFELSE( +- [AC_LANG_PROGRAM([ +- @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 +- @%:@error premature clang +- @%:@endif +- ])], +- [], +- [AC_MSG_ERROR([clang version 3.0 or later is required]) ++ AS_IF([! $CC -E -xc - </dev/null], [ ++ @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 ++ @%:@error premature clang ++ @%:@endif ++SRC ++ AC_MSG_ERROR([clang version 3.0 or later is required]) + ])], + [openbsd*:openbsd*], [ + AC_CHECK_TOOLS(CC, [cc]) +@@ -196,9 +191,7 @@ AS_IF([test x"${build}" != x"${host}"], [ + AC_CHECK_TOOL(CC, gcc) + ]) + +-dnl Seems necessarily in order to add -std=gnu99 option for gcc 4.9. +-m4_version_prereq([2.70], [], [AC_PROG_CC_C99]) +- ++AC_PROG_CC_C99 + AS_CASE([$CC], + [gcc-*], [ + gcc_prefix=gcc- gcc_suffix=`echo "$CC" | sed 's/^gcc//'` +@@ -230,12 +223,12 @@ test -z "$CXX" || ac_cv_prog_CXX="$CXX" + AS_CASE(["$target_os"], + [darwin*], [ + AC_MSG_CHECKING(if minimum required OS X version is supported) +- AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include ++ AC_TRY_CPP([@%:@include + @%:@if MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_5 + @%:@error pre OS X 10.5 + [!<===== pre OS X 10.5 =====>] + @%:@endif +- ]])], ++ ], + [macosx_min_required=yes], + [AC_MSG_RESULT(no) + AC_MSG_ERROR([Unsupported OS X version is required])]) +@@ -366,8 +359,8 @@ AS_CASE(["$target_os"], + [mingw*], [ + test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt + AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [ +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], +- [[FILE* volatile f = stdin; return 0;]])], ++ AC_TRY_LINK([@%:@include ], ++ [FILE* volatile f = stdin; return 0;], + [rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext | + tr A-Z a-z | + sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`], +@@ -410,6 +403,9 @@ AC_CHECK_PROGS(DOXYGEN, doxygen) + AC_CHECK_PROG(PKG_CONFIG, pkg-config, [pkg-config], [], [], + [`"$as_dir/$ac_word$ac_exec_ext" --print-errors --version > /dev/null 2>&1 || echo "$as_dir/$ac_word$ac_exec_ext"`]) + ++# checks for UNIX variants that set C preprocessor variables ++AC_USE_SYSTEM_EXTENSIONS ++ + AC_SUBST(RM, ['rm -f']) + AC_SUBST(CP, ['cp']) + RMDIRS='$(top_srcdir)/tool/rmdirs' +@@ -445,7 +441,7 @@ AC_SUBST(CHDIR) + : "compiler section" && { + RUBY_WERROR_FLAG([ + AC_MSG_CHECKING([whether CFLAGS is valid]) +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], ++ AC_TRY_COMPILE([], [], + [AC_MSG_RESULT(yes)], + [ + AC_MSG_RESULT(no) +@@ -461,7 +457,7 @@ RUBY_WERROR_FLAG([ + echo 'CFBundleIdentifier' > Info.plist && + : + } || AC_MSG_ERROR([failed to make temporary directory]) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], ++ AC_TRY_LINK([], [], + [AC_MSG_RESULT(yes)], + [ + cd .. && rm -fr tmp.$$.try_link +@@ -643,13 +639,13 @@ AS_IF([test "$GCC" = yes], [ + ], [ + CFLAGS="$CFLAGS -Werror -Wuninitialized" + ]) +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ++ AC_TRY_COMPILE([@%:@include + int foo(double x) + { + int exp; + frexp(x, &exp); + return exp; +- }]], [[if (foo(0.0)) return 1;]])], ++ }], [if (foo(0.0)) return 1;], + [rb_cv_mingw64_broken_frexp_modf=no], + [rb_cv_mingw64_broken_frexp_modf=yes]) + CFLAGS="$save_CFLAGS" +@@ -739,13 +735,13 @@ AS_IF([test "$GCC" = yes], [ + + AS_CASE(["$target_cpu"], [[i[3-6]86*]], [ + AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [ +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned long atomic_var;]], +- [[__sync_val_compare_and_swap(&atomic_var, 0, 1);]])], ++ AC_TRY_LINK([unsigned long atomic_var;], ++ [__sync_val_compare_and_swap(&atomic_var, 0, 1);], + [rb_cv_gcc_compiler_cas=yes], + [ + save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -march=i486" +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned long atomic_var;]], +- [[__sync_val_compare_and_swap(&atomic_var, 0, 1);]])], ++ AC_TRY_LINK([unsigned long atomic_var;], ++ [__sync_val_compare_and_swap(&atomic_var, 0, 1);], + [rb_cv_gcc_compiler_cas=i486], + [rb_cv_gcc_compiler_cas=no]) + CFLAGS="$save_CFLAGS" +@@ -772,7 +768,7 @@ test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cx + + AC_CACHE_CHECK([whether compiler has statement and declarations in expressions], + rb_cv_have_stmt_and_decl_in_expr, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ __extension__ ({ int a = 0; a; }); ]])], ++ [AC_TRY_COMPILE([],[ __extension__ ({ int a = 0; a; }); ], + [rb_cv_have_stmt_and_decl_in_expr=yes], + [rb_cv_have_stmt_and_decl_in_expr=no])]) + AS_IF([test "$rb_cv_have_stmt_and_decl_in_expr" = yes], [ +@@ -793,12 +789,12 @@ AS_CASE(["$target_os"], + [freebsd*], [ + AC_CACHE_CHECK([whether pthread should be enabled by default], + rb_cv_enable_pthread_default, +- [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ ++ [AC_TRY_CPP([ + #include + #if __FreeBSD_version < 502102 + #error pthread should be disabled on this platform + #endif +- ]])], ++ ], + rb_cv_enable_pthread_default=yes, + rb_cv_enable_pthread_default=no)]) + enable_pthread=$rb_cv_enable_pthread_default +@@ -826,8 +822,8 @@ AS_CASE(["$target_os"], + RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT) + AC_CACHE_CHECK([whether syscall(2) is deprecated], rb_cv_syscall_deprecated, + [RUBY_WERROR_FLAG([ +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], +- [[if (syscall(0)) return 1;]])], ++ AC_TRY_COMPILE([@%:@include ], ++ [if (syscall(0)) return 1;], + [rb_cv_syscall_deprecated=no], + [rb_cv_syscall_deprecated=yes])])]) + AS_IF([test $rb_cv_syscall_deprecated = yes], [ +@@ -854,7 +850,7 @@ AS_CASE(["$target_os"], + ]) + with_setjmp_type=sigsetjmp # to hijack SIGCHLD handler + AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt, +- [AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++ [AC_TRY_RUN([ + #include + #include + #include +@@ -891,7 +887,7 @@ main() + } + return 0; + } +-]])], ++], + rb_cv_broken_crypt=no, + rb_cv_broken_crypt=yes, + rb_cv_broken_crypt=yes)]) +@@ -920,11 +916,11 @@ main() + [solaris*], [ LIBS="-lm $LIBS" + ac_cv_func_vfork=no + AC_MSG_CHECKING(whether _XOPEN_SOURCE is already given) +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ++ AC_TRY_COMPILE([#include + #ifndef _XOPEN_SOURCE + #error _XOPEN_SOURCE is not defined + #endif +- ]], [[]])], ++ ], [], + [given_xopen_source=yes], [given_xopen_source=no]) + AC_MSG_RESULT($given_xopen_source) + AS_IF([test $given_xopen_source = no], [ +@@ -934,13 +930,13 @@ main() + AS_IF([test x"$define_xopen_source" != x], [ + break + ]) +- RUBY_WERROR_FLAG([AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ RUBY_WERROR_FLAG([AC_TRY_COMPILE([ + #define _XOPEN_SOURCE ${tmp_xpg}00 + #include + #ifndef _XPG${tmp_xpg} + #error _XPG${tmp_xpg} should be defined by _XOPEN_SOURCE=${tmp_xpg}00 + #endif +- ]], [[]])], ++ ], [], + [define_xopen_source=${tmp_xpg}00], []) + ]) + done +@@ -1234,8 +1230,8 @@ AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct, + "__pragma(pack(push, 1)) x __pragma(pack(pop))" \ + "x __attribute__((packed))" \ + ; do +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@define PACKED_STRUCT(x) $mac +- PACKED_STRUCT(struct { int a; });]], [[]])], ++ AC_TRY_COMPILE([@%:@define PACKED_STRUCT(x) $mac ++ PACKED_STRUCT(struct { int a; });], [], + [rb_cv_packed_struct=$mac; break]) + done]) + AS_IF([test "$rb_cv_packed_struct" != no], [ +@@ -1275,7 +1271,7 @@ RUBY_REPLACE_TYPE(clockid_t, [], CLOCKID, [@%:@ifdef HAVE_TIME_H + @%:@endif]) + + AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(int x) { return 0; }]], [[return foo(10);]])], ++ [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);], + rb_cv_have_prototypes=yes, + rb_cv_have_prototypes=no)]) + AS_IF([test "$rb_cv_have_prototypes" = yes], [ +@@ -1283,8 +1279,8 @@ AS_IF([test "$rb_cv_have_prototypes" = yes], [ + ]) + + AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@define paste(a,b) a@%:@@%:@b]], +- [[int xy = 1; return paste(x,y);]])], ++ [AC_TRY_COMPILE([@%:@define paste(a,b) a@%:@@%:@b], ++ [int xy = 1; return paste(x,y);], + rb_cv_tokenpaste=ansi, + rb_cv_tokenpaste=knr)]) + AS_IF([test "$rb_cv_tokenpaste" = ansi], [ +@@ -1329,7 +1325,7 @@ AS_IF([test "$rb_cv_string_literal_concatenation" = no], [ + ]) + + AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ [AC_TRY_COMPILE([ + #include + int foo(int x, ...) { + va_list va; +@@ -1339,7 +1335,7 @@ int foo(int x, ...) { + va_arg(va, double); + return 0; + } +-]], [[return foo(10, "", 3.14);]])], ++], [return foo(10, "", 3.14);], + rb_cv_stdarg=yes, + rb_cv_stdarg=no)]) + AS_IF([test "$rb_cv_stdarg" = yes], [ +@@ -1347,10 +1343,10 @@ AS_IF([test "$rb_cv_stdarg" = yes], [ + ]) + + AC_CACHE_CHECK(for variable length macro, rb_cv_va_args_macro, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ [AC_TRY_COMPILE([ + int foo(int x, ...); + @%:@define FOO(a, ...) foo(a, @%:@@%:@__VA_ARGS__) +-]], [[FOO(1);FOO(1,2);FOO(1,2,3);]])], ++], [FOO(1);FOO(1,2);FOO(1,2,3);], + rb_cv_va_args_macro=yes, + rb_cv_va_args_macro=no)]) + AS_IF([test "$rb_cv_va_args_macro" = yes], [ +@@ -1371,9 +1367,9 @@ do + # C11 _Alignas and GCC __attribute__((__aligned__)) behave + # slightly differently. What we want is GCC's. Check that + # here by something C11 does not allow (`struct ALIGNAS ...`) +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ++ AC_TRY_COMPILE( + [@%:@define ALIGNAS(x) $attr +- struct ALIGNAS(128) conftest_tag { int foo; } foo; ]], [[]])], ++ struct ALIGNAS(128) conftest_tag { int foo; } foo; ], [], + [rb_cv_have_alignas="$attr"; break], []) + done + ])]) +@@ -1391,10 +1387,10 @@ for expr in \ + "__alignof__" \ + ; + do +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ AC_TRY_COMPILE([ + @%:@ifdef HAVE_STDALIGN_H + @%:@include +- @%:@endif]],[[return (int)$expr(int);]])], ++ @%:@endif],[return (int)$expr(int);], + [rb_cv_have_alignof="$expr"; break], []) + done + ])]) +@@ -1448,8 +1444,8 @@ AS_IF([test "$GCC" = yes], [ + AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias], + [rb_cv_gcc_function_alias=no + for a in alias weak,alias; do +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[void foo(void) {} +- void bar(void) __attribute__(($a("foo")));]], [[bar()]])], ++ AC_TRY_LINK([void foo(void) {} ++ void bar(void) __attribute__(($a("foo")));], [bar()], + [rb_cv_gcc_function_alias=$a; break]) + done]) + AS_IF([test "$rb_cv_gcc_function_alias" != no], [ +@@ -1461,14 +1457,14 @@ AS_IF([test "$GCC" = yes], [ + ]) + + AC_CACHE_CHECK([for __atomic builtins], [rb_cv_gcc_atomic_builtins], [ +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned int atomic_var;]], +- [[ ++ AC_TRY_LINK([unsigned int atomic_var;], ++ [ + __atomic_exchange_n(&atomic_var, 0, __ATOMIC_SEQ_CST); + __atomic_exchange_n(&atomic_var, 1, __ATOMIC_SEQ_CST); + __atomic_fetch_add(&atomic_var, 1, __ATOMIC_SEQ_CST); + __atomic_fetch_sub(&atomic_var, 1, __ATOMIC_SEQ_CST); + __atomic_or_fetch(&atomic_var, 1, __ATOMIC_SEQ_CST); +- ]])], ++ ], + [rb_cv_gcc_atomic_builtins=yes], + [rb_cv_gcc_atomic_builtins=no])]) + AS_IF([test "$rb_cv_gcc_atomic_builtins" = yes], [ +@@ -1476,15 +1472,15 @@ AS_IF([test "$GCC" = yes], [ + ]) + + AC_CACHE_CHECK([for __sync builtins], [rb_cv_gcc_sync_builtins], [ +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned int atomic_var;]], +- [[ ++ AC_TRY_LINK([unsigned int atomic_var;], ++ [ + __sync_lock_test_and_set(&atomic_var, 0); + __sync_lock_test_and_set(&atomic_var, 1); + __sync_fetch_and_add(&atomic_var, 1); + __sync_fetch_and_sub(&atomic_var, 1); + __sync_or_and_fetch(&atomic_var, 1); + __sync_val_compare_and_swap(&atomic_var, 0, 1); +- ]])], ++ ], + [rb_cv_gcc_sync_builtins=yes], + [rb_cv_gcc_sync_builtins=no])]) + AS_IF([test "$rb_cv_gcc_sync_builtins" = yes], [ +@@ -1493,8 +1489,8 @@ AS_IF([test "$GCC" = yes], [ + + AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable, + [RUBY_WERROR_FLAG( +- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[volatile int zero;]], +- [[if (zero) __builtin_unreachable();]])], ++ [AC_TRY_LINK([volatile int zero;], ++ [if (zero) __builtin_unreachable();], + [rb_cv_func___builtin_unreachable=yes], + [rb_cv_func___builtin_unreachable=no]) + ]) +@@ -1508,8 +1504,8 @@ AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [ + rb_cv_func_exported=no + RUBY_WERROR_FLAG([ + for mac in '__attribute__ ((__visibility__("default")))' '__declspec(dllexport)'; do +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@define RUBY_FUNC_EXPORTED $mac extern +- RUBY_FUNC_EXPORTED void conftest_attribute_check(void);]], [[]])], ++ AC_TRY_COMPILE([@%:@define RUBY_FUNC_EXPORTED $mac extern ++ RUBY_FUNC_EXPORTED void conftest_attribute_check(void);], [], + [rb_cv_func_exported="$mac"; break]) + done + ])]) +@@ -1532,18 +1528,15 @@ AC_SUBST(MATHN, $mathn) + + AC_CACHE_CHECK(for function name string predefined identifier, + rb_cv_function_name_string, +- [AS_CASE(["$target_os"],[openbsd*],[ +- rb_cv_function_name_string=__func__ +- ],[ +- rb_cv_function_name_string=no +- RUBY_WERROR_FLAG([ +- for func in __func__ __FUNCTION__; do +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], +- [[puts($func);]])], +- [rb_cv_function_name_string=$func +- break]) +- done +- ])])] ++ [rb_cv_function_name_string=no ++ RUBY_WERROR_FLAG([ ++ for func in __func__ __FUNCTION__; do ++ AC_TRY_LINK([@%:@include ], ++ [puts($func);], ++ [rb_cv_function_name_string=$func ++ break]) ++ done ++ ])] + ) + AS_IF([test "$rb_cv_function_name_string" != no], [ + AC_DEFINE_UNQUOTED(RUBY_FUNCTION_NAME_STRING, [$rb_cv_function_name_string]) +@@ -1605,9 +1598,9 @@ RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include ]) + RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include ]) + RUBY_CHECK_PRINTF_PREFIX(size_t, z) + RUBY_CHECK_PRINTF_PREFIX(ptrdiff_t, t) +-AC_CHECK_MEMBERS([struct stat.st_blksize]) +-AC_CHECK_MEMBERS([struct stat.st_blocks]) +-AC_CHECK_MEMBERS([struct stat.st_rdev]) ++AC_STRUCT_ST_BLKSIZE ++AC_STRUCT_ST_BLOCKS ++AC_STRUCT_ST_RDEV + RUBY_CHECK_SIZEOF([struct stat.st_size], [off_t int long "long long"], [], [@%:@include ]) + AS_IF([test "$ac_cv_member_struct_stat_st_blocks" = yes], [ + RUBY_CHECK_SIZEOF([struct stat.st_blocks], [off_t int long "long long"], [], [@%:@include ]) +@@ -1696,9 +1689,9 @@ AS_IF([test "x$rb_cv_type_int64_t" != xno], [ + + AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address, + [rb_cv_stack_end_address=no +- AC_LINK_IFELSE([AC_LANG_PROGRAM( +- [[extern void *__libc_stack_end;]], +- [[if (!__libc_stack_end) return 1;]])], ++ AC_TRY_LINK( ++ [extern void *__libc_stack_end;], ++ [if (!__libc_stack_end) return 1;], + [rb_cv_stack_end_address="__libc_stack_end"]) + ]) + AS_IF([test $rb_cv_stack_end_address != no], [ +@@ -1707,7 +1700,7 @@ AS_IF([test $rb_cv_stack_end_address != no], [ + + dnl Checks for library functions. + AC_TYPE_GETGROUPS +-AC_DEFINE(RETSIGTYPE, void) ++AC_TYPE_SIGNAL + AS_CASE(["${target_cpu}-${target_os}:${target_archs}"], + [powerpc-darwin*], [ + AC_LIBSOURCES(alloca.c) +@@ -1727,14 +1720,14 @@ AS_CASE(["${target_cpu}-${target_os}:${target_archs}"], + AS_IF([test "x$ALLOCA" = "x"], [ + AC_CACHE_CHECK([for dynamic size alloca], rb_cv_dynamic_alloca, [ + for chk in ok __chkstk; do +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ++ AC_TRY_LINK([ + @%:@ifdef HAVE_ALLOCA_H + @%:@include + @%:@endif + void $chk() {} + int dynamic_alloca_test; +- int dynamic_alloca_result;]], +- [[dynamic_alloca_result = alloca(dynamic_alloca_test) != 0;]])], ++ int dynamic_alloca_result;], ++ [dynamic_alloca_result = alloca(dynamic_alloca_test) != 0;], + [rb_cv_dynamic_alloca=$chk; break]) + done]) + AS_IF([test "x$rb_cv_dynamic_alloca" = "x__chkstk"], [ +@@ -1786,9 +1779,9 @@ AC_CHECK_HEADERS(sys/pstat.h) + + + AC_CACHE_CHECK(for signbit, rb_cv_have_signbit, +- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ++ [AC_TRY_LINK([ + #include +-]], [[int v = signbit(-0.0);]])], ++], [int v = signbit(-0.0);], + rb_cv_have_signbit=yes, + rb_cv_have_signbit=no)]) + AS_IF([test "$rb_cv_have_signbit" = yes], [ +@@ -1944,7 +1937,7 @@ AS_CASE(["$ac_cv_func_memset_s:$ac_cv_func_qsort_s"], [*yes*], + + AS_IF([test "$ac_cv_func_getcwd" = yes], [ + AC_CACHE_CHECK(if getcwd allocates buffer if NULL is given, [rb_cv_getcwd_malloc], +- [AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++ [AC_TRY_RUN([ + @%:@include + @%:@include + @%:@ifdef HAVE_UNISTD_H +@@ -1963,7 +1956,7 @@ main(int argc, char **argv) + if (!getcwd(NULL, 0)) return EXIT_FAILURE; + return EXIT_SUCCESS; + } +-]])], ++], + rb_cv_getcwd_malloc=yes, + rb_cv_getcwd_malloc=no, + AS_CASE($target_os, +@@ -2011,21 +2004,21 @@ RUBY_CHECK_BUILTIN_FUNC(__builtin_trap, [__builtin_trap()]) + + AS_IF([test "$ac_cv_func_qsort_r" != no], [ + AC_CACHE_CHECK(whether qsort_r is GNU version, rb_cv_gnu_qsort_r, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ [AC_TRY_COMPILE([ + @%:@include + void (qsort_r)(void *base, size_t nmemb, size_t size, + int (*compar)(const void *, const void *, void *), + void *arg); +-]], [[ ]])], ++],[ ], + [rb_cv_gnu_qsort_r=yes], + [rb_cv_gnu_qsort_r=no]) + ]) + AC_CACHE_CHECK(whether qsort_r is BSD version, rb_cv_bsd_qsort_r, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ [AC_TRY_COMPILE([ + @%:@include + void (qsort_r)(void *base, size_t nmemb, size_t size, + void *arg, int (*compar)(void *, const void *, const void *)); +-]], [[ ]])], ++],[ ], + [rb_cv_bsd_qsort_r=yes], + [rb_cv_bsd_qsort_r=no]) + ]) +@@ -2040,7 +2033,7 @@ void (qsort_r)(void *base, size_t nmemb, size_t size, + + AC_CACHE_CHECK(whether atan2 handles Inf as C99, rb_cv_atan2_inf_c99, [ + AS_IF([test $ac_cv_func_atan2f:$ac_cv_func_atan2l = yes:yes], [ +- AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++ AC_TRY_RUN([ + @%:@include + @%:@ifdef HAVE_UNISTD_H + @%:@include +@@ -2058,7 +2051,7 @@ main(int argc, char **argv) + if (fabs(atan2(INFINITY, INFINITY) - M_PI_4) <= 0.01) return EXIT_SUCCESS; + return EXIT_FAILURE; + } +-]])], ++], + [rb_cv_atan2_inf_c99=yes], + [rb_cv_atan2_inf_c99=no], + [AS_CASE($target_os, [mingw*|mswin*], [rb_cv_atan2_inf_c99=no], [rb_cv_atan2_inf_c99=yes])] +@@ -2087,9 +2080,9 @@ AS_IF([test x"$ac_cv_lib_rt_timer_settime" = xyes], [ + ]) + + AC_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ [AC_TRY_COMPILE([ + #include +-]], [[int v = unsetenv("foo");]])], ++], [int v = unsetenv("foo");], + rb_cv_unsetenv_return_value=yes, + rb_cv_unsetenv_return_value=no)]) + AS_IF([test "$rb_cv_unsetenv_return_value" = no], [ +@@ -2107,21 +2100,21 @@ AS_IF([test "$use_setreuid" = yes], [ + ]) + AC_STRUCT_TIMEZONE + AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ [AC_TRY_COMPILE([ + @%:@define _BSD_SOURCE + @%:@define _DEFAULT_SOURCE + @%:@include +- ]], +- [[struct tm t; t.tm_gmtoff = 3600;]])], ++ ], ++ [struct tm t; t.tm_gmtoff = 3600;], + [rb_cv_member_struct_tm_tm_gmtoff=yes], + [rb_cv_member_struct_tm_tm_gmtoff=no])]) + AS_IF([test "$rb_cv_member_struct_tm_tm_gmtoff" = yes], [ + AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF) + ]) + AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight, +- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +- int i;]], +- [[i = daylight;]])], ++ [AC_TRY_LINK([#include ++ int i;], ++ [i = daylight;], + rb_cv_have_daylight=yes, + rb_cv_have_daylight=no)]) + AS_IF([test "$rb_cv_have_daylight" = yes], [ +@@ -2129,7 +2122,7 @@ AS_IF([test "$rb_cv_have_daylight" = yes], [ + ]) + + AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t, +- [AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++ [AC_TRY_RUN([ + #include + #include + +@@ -2159,7 +2152,7 @@ main() + check(gmtime(&t), 1, 12, 13, 20, 52); + return 0; + } +-]])], ++], + rb_cv_negative_time_t=yes, + rb_cv_negative_time_t=no, + rb_cv_negative_time_t=yes)]) +@@ -2170,7 +2163,7 @@ AS_IF([test "$rb_cv_negative_time_t" = yes], [ + # [ruby-dev:40910] overflow of time on FreeBSD + # http://www.freebsd.org/cgi/query-pr.cgi?pr=145341 + AC_CACHE_CHECK(for localtime(3) overflow correctly, rb_cv_localtime_overflow, +- [AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++ [AC_TRY_RUN([ + #include + #include + +@@ -2202,7 +2195,7 @@ main() + check(t); + return 0; + } +-]])], ++], + rb_cv_localtime_overflow=yes, + rb_cv_localtime_overflow=no, + rb_cv_localtime_overflow=no)]) +@@ -2215,7 +2208,7 @@ AS_IF([test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = ye + ], [ + AC_CHECK_FUNCS(sigsetmask) + AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal, +- [AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++ [AC_TRY_RUN([ + #include + #include + +@@ -2233,7 +2226,7 @@ main() + kill(getpid(), SIGINT); + return 0; + } +-]])], ++], + rb_cv_bsd_signal=yes, + rb_cv_bsd_signal=no, + rb_cv_bsd_signal=$ac_cv_func_sigsetmask)]) +@@ -2402,13 +2395,13 @@ AS_IF([test x"$enable_pthread" = xyes], [ + AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled") + ]) + AC_CACHE_CHECK([whether pthread_t is scalar type], [rb_cv_scalar_pthread_t], [ +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ AC_TRY_COMPILE([ + @%:@include +- ]], [[ ++ ], [ + pthread_t thread_id; + thread_id = 0; + if (!thread_id) return 0; +- ]])],[rb_cv_scalar_pthread_t=yes],[rb_cv_scalar_pthread_t=no]) ++ ], [rb_cv_scalar_pthread_t=yes], [rb_cv_scalar_pthread_t=no]) + ]) + AS_IF([test x"$rb_cv_scalar_pthread_t" = xyes], [ + : # RUBY_CHECK_SIZEOF(pthread_t, [void* int long], [], [@%:@include ]) +@@ -2434,14 +2427,14 @@ AS_IF([test x"$enable_pthread" = xyes], [ + "(pthread_self(), \"%s\", name)" \ + "(name)" \ + ; do +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ AC_TRY_COMPILE([ + @%:@include + @%:@ifdef HAVE_PTHREAD_NP_H + @%:@include + @%:@endif + @%:@define SET_THREAD_NAME(name) pthread_setname_np${mac} +- ]], +- [[if (SET_THREAD_NAME("conftest")) return 1;]])], ++ ], ++ [if (SET_THREAD_NAME("conftest")) return 1;], + [rb_cv_func_pthread_setname_np_arguments="${mac}" + break]) + done +@@ -2465,8 +2458,8 @@ AS_IF([test x"$enable_pthread" = xyes], [ + + AS_IF([test x"$ac_cv_header_ucontext_h" = xno], [ + AC_CACHE_CHECK([if signal.h defines ucontext_t], [rb_cv_ucontext_in_signal_h], +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], +- [[size_t size = sizeof(ucontext_t);]])], ++ [AC_TRY_COMPILE([@%:@include ], ++ [size_t size = sizeof(ucontext_t);], + [rb_cv_ucontext_in_signal_h=yes], [rb_cv_ucontext_in_signal_h=no])]) + AS_IF([test x"$rb_cv_ucontext_in_signal_h" = xyes], [ + AC_DEFINE_UNQUOTED(UCONTEXT_IN_SIGNAL_H, 1) +@@ -2474,14 +2467,14 @@ AS_IF([test x"$ac_cv_header_ucontext_h" = xno], [ + ]) + AS_IF([test x"$ac_cv_header_ucontext_h" = xyes -o x"$rb_cv_ucontext_in_signal_h" = xyes], [ + AC_CACHE_CHECK([if mcontext_t is a pointer], [rb_cv_mcontext_t_ptr], +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ [AC_TRY_COMPILE([ + @%:@include + @%:@ifdef HAVE_UCONTEXT_H + @%:@include + @%:@endif + mcontext_t test(mcontext_t mc) {return mc+1;} +- ]], +- [[test(0);]])], ++ ], ++ [test(0);], + [rb_cv_mcontext_t_ptr=yes], [rb_cv_mcontext_t_ptr=no])]) + AS_IF([test x"$rb_cv_mcontext_t_ptr" = xyes], [ + AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t mc = (uc)->uc_mcontext) +@@ -2495,7 +2488,7 @@ AS_IF([test x"$ac_cv_header_ucontext_h" = xyes -o x"$rb_cv_ucontext_in_signal_h" + + AS_IF([test "$ac_cv_func_fork_works" = "yes" -a "$rb_with_pthread" = "yes"], [ + AC_CACHE_CHECK([if fork works with pthread], rb_cv_fork_with_pthread, +- [AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++ [AC_TRY_RUN([ + #include + #include + #include +@@ -2551,7 +2544,7 @@ main(int argc, char *argv[]) + } + + return EXIT_SUCCESS; +-}]])], ++}], + rb_cv_fork_with_pthread=yes, + rb_cv_fork_with_pthread=no, + rb_cv_fork_with_pthread=yes)]) +@@ -2574,7 +2567,7 @@ AC_ARG_WITH(dln-a-out, + with_dln_a_out=no])], [with_dln_a_out=no]) + + AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf, +-[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ ++[AC_TRY_LINK([],[], [ + AS_CASE(["`head -1 conftest$EXEEXT | tr -dc '\177ELF' | tr '\177' .`"], + [.ELF*], [rb_cv_binary_elf=yes], [rb_cv_binary_elf=no])], + rb_cv_binary_elf=no)]) +@@ -2849,7 +2842,7 @@ AC_CHECK_FUNCS(backtrace) + + AS_IF([test "x$ac_cv_func_backtrace" = xyes], [ + AC_CACHE_CHECK(for broken backtrace, rb_cv_broken_backtrace, +- [AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++ [AC_TRY_RUN([ + #include + #include + #include +@@ -2897,7 +2890,7 @@ main(void) + a[0] = 1; + return EXIT_SUCCESS; + } +-]])], ++], + rb_cv_broken_backtrace=no, + rb_cv_broken_backtrace=yes, + rb_cv_broken_backtrace=no)]) +@@ -2917,10 +2910,11 @@ AS_IF([test "$ac_cv_header_a_out_h" = yes], [ + AS_IF([test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown], [ + cat confdefs.h > config.h + AC_CACHE_CHECK(whether matz's dln works, rb_cv_dln_a_out, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ [AC_TRY_COMPILE([ + #define USE_DLN_A_OUT + #include "dln.c" +-]], [[]])], ++], ++ [], + rb_cv_dln_a_out=yes, + rb_cv_dln_a_out=no)]) + AS_IF([test "$rb_cv_dln_a_out" = yes], [ +@@ -2986,10 +2980,10 @@ AS_CASE(["$target_os"], + STRIP="$STRIP -A -n"]) + + AC_ARG_WITH(ext, +- AS_HELP_STRING([--with-ext=EXTS], ++ AC_HELP_STRING([--with-ext=EXTS], + [pass to --with-ext option of extmk.rb])) + AC_ARG_WITH(out-ext, +- AS_HELP_STRING([--with-out-ext=EXTS], ++ AC_HELP_STRING([--with-out-ext=EXTS], + [pass to --without-ext option of extmk.rb])) + EXTSTATIC= + AC_SUBST(EXTSTATIC)dnl +@@ -3453,7 +3447,7 @@ AS_IF([test "$rb_with_pthread" = "yes"], [ + THREAD_MODEL=pthread + ]) + AC_CACHE_CHECK([for prefix of external symbols], rb_cv_symbol_prefix, [ +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern void conftest_external(void) {}]], [[]])],[ ++ AC_TRY_COMPILE([extern void conftest_external(void) {}], [], [ + rb_cv_symbol_prefix=`$NM conftest.$ac_objext | + sed -n ['/.*T[ ]\([^ ]*\)conftest_external.*/!d;s//\1/p;q']` + ], +@@ -3464,7 +3458,7 @@ SYMBOL_PREFIX="$rb_cv_symbol_prefix" + test "x$SYMBOL_PREFIX" = xNONE && SYMBOL_PREFIX='' + DLNOBJ=dln.o + AC_ARG_ENABLE(dln, +- AS_HELP_STRING([--disable-dln], [disable dynamic link feature]), ++ AC_HELP_STRING([--disable-dln], [disable dynamic link feature]), + [test "$enableval" = yes || DLNOBJ=dmydln.o]) + AC_SUBST(DLNOBJ) + MINIDLNOBJ=dmydln.o +@@ -3596,12 +3590,13 @@ AS_IF([test "${universal_binary-no}" = yes ], [ + AC_CACHE_CHECK([for architecture macros], rb_cv_architecture_macros, [ + mv confdefs.h confdefs1.h + : > confdefs.h +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@if defined __`echo ${universal_archnames} | ++ AC_TRY_COMPILE([@%:@if defined __`echo ${universal_archnames} | + sed 's/=[^ ]*//g;s/ /__ || defined __/g'`__ + @%:@else + @%:@error + >>>>>><<<<<< +-@%:@endif]], [[]])],[ ++@%:@endif], [], ++[ + rb_cv_architecture_macros=yes + mv -f confdefs1.h confdefs.h + ], [ +@@ -3614,17 +3609,16 @@ AS_IF([test "${universal_binary-no}" = yes ], [ + CFLAGS="$new_cflags -arch $archs" + archs="__${archs}__" + AC_MSG_CHECKING([for macro ${archs} on ${cpu}]) +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@ifndef ${archs} ++ AC_TRY_COMPILE([@%:@ifndef ${archs} + @%:@error +-@%:@endif]], [[]])], +- [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) ++@%:@endif], [], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) + done + mv -f confdefs1.h confdefs.h + AC_MSG_ERROR([failed]) + ])]) + AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available, +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include +- const char arch[[]] = __ARCHITECTURE__;]], [[puts(arch);]])], ++ AC_TRY_COMPILE([@%:@include ++ const char arch[[]] = __ARCHITECTURE__;], [puts(arch);], + [rb_cv_architecture_available=yes], [rb_cv_architecture_available=no])) + ]) + +@@ -4039,7 +4033,7 @@ AC_CONFIG_FILES(Makefile:template/Makefile.in, [ + [EXEEXT='$EXEEXT' gnumake='$gnumake' GIT='$GIT']) + + AC_ARG_WITH([ruby-pc], +- AS_HELP_STRING([--with-ruby-pc=FILENAME], [pc file basename]), ++ AC_HELP_STRING([--with-ruby-pc=FILENAME], [pc file basename]), + [ruby_pc="$withval"], + [ruby_pc="${RUBY_BASE_NAME}-${MAJOR}.${MINOR}.pc"]) + AC_SUBST(ruby_pc) +diff --git a/missing/fileblocks.c b/missing/fileblocks.c +new file mode 100644 +index 0000000000..ccb8d667b4 +--- /dev/null ++++ b/missing/fileblocks.c +@@ -0,0 +1 @@ ++/* dummy for autoconf */ +diff --git a/tool/m4/ruby_check_builtin_setjmp.m4 b/tool/m4/ruby_check_builtin_setjmp.m4 +index 008fd45911..a4289e2e9d 100644 +--- a/tool/m4/ruby_check_builtin_setjmp.m4 ++++ b/tool/m4/ruby_check_builtin_setjmp.m4 +@@ -8,18 +8,18 @@ AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp, + ac_cv_func___builtin_setjmp=no + for cast in "" "(void **)"; do + RUBY_WERROR_FLAG( +- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include ++ [AC_TRY_LINK([@%:@include + @%:@include + jmp_buf jb; + @%:@ifdef NORETURN + NORETURN(void t(void)); + @%:@endif + void t(void) {__builtin_longjmp($cast jb, 1);} +- int jump(void) {(void)(__builtin_setjmp($cast jb) ? 1 : 0); return 0;}]], +- [[ ++ int jump(void) {(void)(__builtin_setjmp($cast jb) ? 1 : 0); return 0;}], ++ [ + void (*volatile f)(void) = t; + if (!jump()) printf("%d\n", f != 0); +- ]])], ++ ], + [ac_cv_func___builtin_setjmp="yes with cast ($cast)"]) + ]) + test "$ac_cv_func___builtin_setjmp" = no || break +diff --git a/tool/m4/ruby_check_printf_prefix.m4 b/tool/m4/ruby_check_printf_prefix.m4 +index 0415f9fa92..9007c18c0a 100644 +--- a/tool/m4/ruby_check_printf_prefix.m4 ++++ b/tool/m4/ruby_check_printf_prefix.m4 +@@ -4,7 +4,8 @@ AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[ + [rb_cv_pri_prefix_]AS_TR_SH($1)=[NONE] + RUBY_WERROR_FLAG(RUBY_APPEND_OPTIONS(CFLAGS, $rb_cv_wsuppress_flags) + for pri in $2; do +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ++ AC_TRY_COMPILE( ++ [@%:@include + @%:@include + @%:@ifdef __GNUC__ + @%:@if defined __MINGW_PRINTF_FORMAT +@@ -17,9 +18,9 @@ AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[ + @%:@else + @%:@define PRINTF_ARGS(decl, string_index, first_to_check) decl + @%:@endif +- PRINTF_ARGS(void test_sprintf(const char*, ...), 1, 2);]], +- [[printf("%]${pri}[d", (]$1[)42); +- test_sprintf("%]${pri}[d", (]$1[)42);]])], ++ PRINTF_ARGS(void test_sprintf(const char*, ...), 1, 2);], ++ [printf("%]${pri}[d", (]$1[)42); ++ test_sprintf("%]${pri}[d", (]$1[)42);], + [rb_cv_pri_prefix_]AS_TR_SH($1)[=[$pri]; break]) + done)]) + AS_IF([test "[$rb_cv_pri_prefix_]AS_TR_SH($1)" != NONE], [ +diff --git a/tool/m4/ruby_check_setjmp.m4 b/tool/m4/ruby_check_setjmp.m4 +index 66652984ea..59f38581b8 100644 +--- a/tool/m4/ruby_check_setjmp.m4 ++++ b/tool/m4/ruby_check_setjmp.m4 +@@ -2,14 +2,14 @@ + # used for AC_ARG_WITH(setjmp-type) + AC_DEFUN([RUBY_CHECK_SETJMP], [ + AC_CACHE_CHECK([for ]$1[ as a macro or function], ac_cv_func_$1, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++ [AC_TRY_COMPILE([ + @%:@include + ]AC_INCLUDES_DEFAULT([$3])[ + @%:@define JMPARGS_1 env + @%:@define JMPARGS_2 env,1 + @%:@define JMPARGS JMPARGS_]m4_ifval($2,2,1)[ +-]], +- [m4_ifval($2,$2,jmp_buf)[ env; $1(JMPARGS);]])], ++], ++ m4_ifval($2,$2,jmp_buf)[ env; $1(JMPARGS);], + ac_cv_func_$1=yes, + ac_cv_func_$1=no)] + ) +diff --git a/tool/m4/ruby_check_sysconf.m4 b/tool/m4/ruby_check_sysconf.m4 +index 8324be6764..f6b247a16f 100644 +--- a/tool/m4/ruby_check_sysconf.m4 ++++ b/tool/m4/ruby_check_sysconf.m4 +@@ -1,9 +1,9 @@ + # -*- Autoconf -*- + AC_DEFUN([RUBY_CHECK_SYSCONF], [dnl + AC_CACHE_CHECK([whether _SC_$1 is supported], rb_cv_have_sc_[]m4_tolower($1), +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +- ]], +- [[_SC_$1 >= 0]])], ++ [AC_TRY_COMPILE([#include ++ ], ++ [_SC_$1 >= 0], + rb_cv_have_sc_[]m4_tolower($1)=yes, + rb_cv_have_sc_[]m4_tolower($1)=no) + ]) +diff --git a/tool/m4/ruby_cppoutfile.m4 b/tool/m4/ruby_cppoutfile.m4 +index 495ae0aae4..7c81c4f354 100644 +--- a/tool/m4/ruby_cppoutfile.m4 ++++ b/tool/m4/ruby_cppoutfile.m4 +@@ -4,8 +4,8 @@ AC_DEFUN([RUBY_CPPOUTFILE], + [save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS='-o conftest-1.i' + rb_cv_cppoutfile=no +-AC_PREPROC_IFELSE([AC_LANG_SOURCE([[test-for-cppout]])], +- [grep test-for-cppout conftest-1.i > /dev/null && rb_cv_cppoutfile=yes]) ++AC_TRY_CPP([test-for-cppout], ++ [grep test-for-cppout conftest-1.i > /dev/null && rb_cv_cppoutfile=yes]) + CPPFLAGS="$save_CPPFLAGS" + rm -f conftest*]) + AS_IF([test "$rb_cv_cppoutfile" = yes], [ +diff --git a/tool/m4/ruby_decl_attribute.m4 b/tool/m4/ruby_decl_attribute.m4 +index 22358a079a..3187b9be60 100644 +--- a/tool/m4/ruby_decl_attribute.m4 ++++ b/tool/m4/ruby_decl_attribute.m4 +@@ -21,7 +21,7 @@ for mac in \ + "__declspec(attrib_code) x" \ + x; do + m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"}) +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ++ AC_TRY_COMPILE( + m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond}) + [@%:@define ]attrib[](attrib_params)[ $mac] + m4_ifval([$4],${rbcv_cond+[@%:@else]} +@@ -30,7 +30,7 @@ ${rbcv_cond+[@%:@endif]}) + $6 + @%:@define mesg ("") + @%:@define san "address" +- attrib[](attrib_params)[;]], [[]])], ++ attrib[](attrib_params)[;], [], + [rbcv="$mac"; break]) + done + ])]) +diff --git a/tool/m4/ruby_dtrace_available.m4 b/tool/m4/ruby_dtrace_available.m4 +index babffaffac..79586d152c 100644 +--- a/tool/m4/ruby_dtrace_available.m4 ++++ b/tool/m4/ruby_dtrace_available.m4 +@@ -7,7 +7,7 @@ AC_DEFUN([RUBY_DTRACE_AVAILABLE], + AS_FOR(opt, rb_dtrace_opt, ["-xnolibs" ""], [dnl + AS_IF([$DTRACE opt -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null], + [], [continue]) +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include "conftest_provider.h"]], [[CONFTEST_FIRE();]])], ++ AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], + [], [continue]) + # DTrace is available on the system + rb_cv_dtrace_available=yes${rb_dtrace_opt:+"(opt)"} +diff --git a/tool/m4/ruby_dtrace_postprocess.m4 b/tool/m4/ruby_dtrace_postprocess.m4 +index 1cb651b481..9ef088b3f8 100644 +--- a/tool/m4/ruby_dtrace_postprocess.m4 ++++ b/tool/m4/ruby_dtrace_postprocess.m4 +@@ -12,7 +12,7 @@ _PROBES + $DTRACE ${DTRACE_OPT} -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null && + : + }], [ +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include "conftest_provider.h"]], [[CONFTEST_FIRE();]])],[ ++ AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [ + AS_IF([{ + cp -p conftest.${ac_objext} conftest.${ac_objext}.save && + $DTRACE ${DTRACE_OPT} -G -s conftest_provider.d conftest.${ac_objext} 2>/dev/null && +diff --git a/tool/m4/ruby_mingw32.m4 b/tool/m4/ruby_mingw32.m4 +index 76b95f02a8..f44fe5575c 100644 +--- a/tool/m4/ruby_mingw32.m4 ++++ b/tool/m4/ruby_mingw32.m4 +@@ -3,11 +3,11 @@ AC_DEFUN([RUBY_MINGW32], + [AS_CASE(["$host_os"], + [cygwin*], [ + AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32, +-[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ ++[AC_TRY_CPP([ + #ifndef __MINGW32__ + # error + #endif +-]])],[rb_cv_mingw32=yes],[rb_cv_mingw32=no]) ++], rb_cv_mingw32=yes,rb_cv_mingw32=no) + rm -f conftest*]) + AS_IF([test "$rb_cv_mingw32" = yes], [ + target_os="mingw32" +diff --git a/tool/m4/ruby_rm_recursive.m4 b/tool/m4/ruby_rm_recursive.m4 +index e2c8f66ccc..e33ba1d97a 100644 +--- a/tool/m4/ruby_rm_recursive.m4 ++++ b/tool/m4/ruby_rm_recursive.m4 +@@ -1,6 +1,6 @@ + # -*- Autoconf -*- +-AC_DEFUN([RUBY_RM_RECURSIVE], [dnl +-m4_version_prereq([2.70], [], [dnl ++AC_DEFUN([RUBY_RM_RECURSIVE], [ ++m4_version_prereq([2.70], [-1], [ + # suppress error messages, rm: cannot remove 'conftest.dSYM', from + # AC_EGREP_CPP with CFLAGS=-g on Darwin. + AS_CASE([$build_os], [darwin*], [ +diff --git a/tool/m4/ruby_stack_grow_direction.m4 b/tool/m4/ruby_stack_grow_direction.m4 +index f5f93579a4..74ec219322 100644 +--- a/tool/m4/ruby_stack_grow_direction.m4 ++++ b/tool/m4/ruby_stack_grow_direction.m4 +@@ -6,7 +6,7 @@ AS_CASE(["$1"], + [m68*|x86*|x64|i?86|ppc*|sparc*|alpha*], [ $2=-1], + [hppa*], [ $2=+1], + [ +- AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++ AC_TRY_RUN([ + /* recurse to get rid of inlining */ + static int + stack_growup_p(addr, n) +@@ -23,7 +23,7 @@ int main() + int x; + return stack_growup_p(&x, 10); + } +-]])],[$2=-1],[$2=+1],[$2=0]) ++], $2=-1, $2=+1, $2=0) + ]) + eval stack_grow_dir=\$$2]) + eval $2=\$stack_grow_dir +diff --git a/tool/m4/ruby_try_cflags.m4 b/tool/m4/ruby_try_cflags.m4 +index 8c9f22d50c..86ab80e1e6 100644 +--- a/tool/m4/ruby_try_cflags.m4 ++++ b/tool/m4/ruby_try_cflags.m4 +@@ -3,7 +3,7 @@ AC_DEFUN([RUBY_TRY_CFLAGS], [ + AC_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS]) + RUBY_WERROR_FLAG([ + CFLAGS="[$]CFLAGS $1" +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$4]], [[$5]])], ++ AC_TRY_COMPILE([$4], [$5], + [$2 + AC_MSG_RESULT(yes)], + [$3 +diff --git a/tool/m4/ruby_try_ldflags.m4 b/tool/m4/ruby_try_ldflags.m4 +index d27940c7b2..b275107ed9 100644 +--- a/tool/m4/ruby_try_ldflags.m4 ++++ b/tool/m4/ruby_try_ldflags.m4 +@@ -4,7 +4,7 @@ AC_DEFUN([RUBY_TRY_LDFLAGS], [ + LDFLAGS="[$]LDFLAGS $1" + AC_MSG_CHECKING([whether $1 is accepted as LDFLAGS]) + RUBY_WERROR_FLAG([ +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$4]], [[$5]])], ++ AC_TRY_LINK([$4], [$5], + [$2 + AC_MSG_RESULT(yes)], + [$3 +diff --git a/win32/Makefile.sub b/win32/Makefile.sub +index 0bc5efbfb2..326bd7fa7a 100644 +--- a/win32/Makefile.sub ++++ b/win32/Makefile.sub +@@ -726,6 +726,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub + #define rb_gid_t int + #define rb_uid_t int + #define HAVE_STRUCT_STAT_ST_RDEV 1 ++#define HAVE_ST_RDEV 1 + #define HAVE_STRUCT_TIMEVAL 1 + !if $(MSC_VER) >= 1900 + #define HAVE_STRUCT_TIMESPEC +-- +2.31.1 + diff --git a/SOURCES/rubygems-3.2.13-test-gem-message.patch b/SOURCES/rubygems-3.2.13-test-gem-message.patch new file mode 100644 index 0000000..3ab9dfc --- /dev/null +++ b/SOURCES/rubygems-3.2.13-test-gem-message.patch @@ -0,0 +1,54 @@ +From 7efc7afcae6720e1af7ab49986d789b6f9d6fe0a Mon Sep 17 00:00:00 2001 +From: Hiroshi SHIBATA +Date: Mon, 8 Mar 2021 12:17:52 +0900 +Subject: [PATCH] Merge RubyGems-3.2.13 and Bundler-2.2.13 + +--- + lib/bundler/cli/gem.rb | 40 +++--- + lib/bundler/definition.rb | 47 ++++--- + lib/bundler/dsl.rb | 58 +++++--- + lib/bundler/inline.rb | 1 + + lib/bundler/lockfile_parser.rb | 20 +-- + lib/bundler/plugin.rb | 1 + + lib/bundler/plugin/installer.rb | 18 ++- + lib/bundler/plugin/source_list.rb | 4 + + lib/bundler/resolver.rb | 70 +++++----- + lib/bundler/source_list.rb | 33 ++--- + lib/bundler/templates/newgem/README.md.tt | 8 +- + lib/bundler/version.rb | 2 +- + lib/rubygems.rb | 2 +- + lib/rubygems/core_ext/tcpsocket_init.rb | 5 +- + lib/rubygems/platform.rb | 10 +- + spec/bundler/bundler/plugin_spec.rb | 1 + + spec/bundler/commands/exec_spec.rb | 131 ++++++++++++++--- + spec/bundler/commands/newgem_spec.rb | 94 +++++-------- + .../commands/post_bundle_message_spec.rb | 11 +- + spec/bundler/install/gemfile/gemspec_spec.rb | 15 +- + spec/bundler/install/gemfile/sources_spec.rb | 132 +++++++++++++++--- + spec/bundler/support/indexes.rb | 2 +- + test/rubygems/test_gem.rb | 10 +- + test/rubygems/test_gem_platform.rb | 29 ++++ + 24 files changed, 477 insertions(+), 267 deletions(-) + +diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb +index 1c6d790b25e6..8b028d3495a8 100644 +--- a/test/rubygems/test_gem.rb ++++ b/test/rubygems/test_gem.rb +@@ -1885,15 +1885,9 @@ def test_use_gemdeps_missing_gem + io.write 'gem "a"' + end + +- platform = Bundler::GemHelpers.generic_local_platform +- if platform == Gem::Platform::RUBY +- platform = '' +- else +- platform = " #{platform}" +- end +- + expected = <<-EXPECTED +-Could not find gem 'a#{platform}' in any of the gem sources listed in your Gemfile. ++Could not find gem 'a' in locally installed gems. ++The source does not contain any versions of 'a' + You may need to `gem install -g` to install missing gems + + EXPECTED diff --git a/SOURCES/rubygems-3.2.22-fix-requirement-equals.patch b/SOURCES/rubygems-3.2.22-fix-requirement-equals.patch new file mode 100644 index 0000000..d5da382 --- /dev/null +++ b/SOURCES/rubygems-3.2.22-fix-requirement-equals.patch @@ -0,0 +1,75 @@ +From c082c6eb7c786a432bea23cf78839f64585cb630 Mon Sep 17 00:00:00 2001 +From: Hiroshi SHIBATA +Date: Wed, 7 Jul 2021 14:07:29 +0900 +Subject: [PATCH] Sync RubyGems and Bundler with upstream + +--- + lib/bundler.rb | 2 +- + lib/bundler/cli/doctor.rb | 12 +- + lib/bundler/cli/install.rb | 2 +- + lib/bundler/compact_index_client.rb | 4 +- + lib/bundler/current_ruby.rb | 8 +- + lib/bundler/definition.rb | 44 +----- + lib/bundler/dsl.rb | 14 +- + lib/bundler/installer.rb | 8 +- + lib/bundler/lockfile_parser.rb | 22 +-- + lib/bundler/plugin/installer.rb | 2 +- + lib/bundler/rubygems_ext.rb | 2 + + lib/bundler/source/rubygems.rb | 13 -- + lib/bundler/source_list.rb | 55 +++++--- + .../lib/connection_pool/monotonic_time.rb | 2 +- + .../lib/connection_pool/timed_stack.rb | 4 +- + lib/bundler/worker.rb | 4 +- + lib/rubygems.rb | 2 +- + lib/rubygems/core_ext/tcpsocket_init.rb | 4 +- + lib/rubygems/deprecate.rb | 59 +++++++- + lib/rubygems/gemcutter_utilities.rb | 13 +- + lib/rubygems/installer.rb | 2 +- + lib/rubygems/remote_fetcher.rb | 15 +- + lib/rubygems/request/connection_pools.rb | 2 +- + lib/rubygems/request/http_pool.rb | 2 +- + lib/rubygems/request_set.rb | 2 +- + lib/rubygems/specification.rb | 2 +- + lib/rubygems/uri_parser.rb | 8 ++ + lib/rubygems/uri_parsing.rb | 23 --- + lib/rubygems/user_interaction.rb | 2 +- + spec/bundler/bundler/cli_spec.rb | 34 +++-- + spec/bundler/bundler/definition_spec.rb | 2 +- + spec/bundler/bundler/source_list_spec.rb | 42 +++--- + spec/bundler/commands/doctor_spec.rb | 24 +++- + spec/bundler/commands/update_spec.rb | 88 ++++++++++++ + .../install/gemfile/eval_gemfile_spec.rb | 32 +++++ + spec/bundler/install/gemfile/sources_spec.rb | 70 +++++++++ + .../install/gems/compact_index_spec.rb | 4 +- + .../install/gems/dependency_api_spec.rb | 4 +- + spec/bundler/install/global_cache_spec.rb | 7 +- + spec/bundler/lock/lockfile_spec.rb | 82 +---------- + spec/bundler/realworld/edgecases_spec.rb | 133 +----------------- + spec/bundler/realworld/slow_perf_spec.rb | 10 +- + spec/bundler/spec_helper.rb | 2 +- + spec/bundler/support/api_request_limit_hax.rb | 16 +++ + .../artifice/compact_index_rate_limited.rb | 2 +- + spec/bundler/support/artifice/endpoint.rb | 2 +- + spec/bundler/support/hax.rb | 25 ---- + spec/bundler/support/helpers.rb | 4 - + spec/bundler/support/matchers.rb | 8 +- + spec/bundler/support/path.rb | 4 + + test/rubygems/helper.rb | 2 +- + test/rubygems/test_gem_gemcutter_utilities.rb | 12 ++ + 52 files changed, 477 insertions(+), 466 deletions(-) + delete mode 100644 lib/rubygems/uri_parsing.rb + create mode 100644 spec/bundler/support/api_request_limit_hax.rb + +diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb +index c95664965c99..9828fc885c94 100644 +--- a/lib/bundler/rubygems_ext.rb ++++ b/lib/bundler/rubygems_ext.rb +@@ -134,6 +134,8 @@ def to_lock + class Requirement + module OrderIndependentComparison + def ==(other) ++ return unless Gem::Requirement === other ++ + if _requirements_sorted? && other._requirements_sorted? + super + else diff --git a/SOURCES/rubygems-bundler-gemspec-for-make-test-bundler.patch b/SOURCES/rubygems-bundler-gemspec-for-make-test-bundler.patch new file mode 100644 index 0000000..ca39d66 --- /dev/null +++ b/SOURCES/rubygems-bundler-gemspec-for-make-test-bundler.patch @@ -0,0 +1,15 @@ +--- a/lib/bundler/bundler.gemspec ++++ b/lib/bundler/bundler.gemspec +@@ -37,10 +37,9 @@ + s.files = Dir.glob("lib/bundler{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) } + + # include the gemspec itself because warbler breaks w/o it +- s.files += %w[bundler.gemspec] ++ s.files += %w[lib/bundler/bundler.gemspec] + +- s.files += %w[CHANGELOG.md LICENSE.md README.md] +- s.bindir = "exe" ++ s.bindir = "libexec" + s.executables = %w[bundle bundler] + s.require_paths = ["lib"] + end diff --git a/SPECS/ruby.spec b/SPECS/ruby.spec index d88626a..8bf2e03 100644 --- a/SPECS/ruby.spec +++ b/SPECS/ruby.spec @@ -3,7 +3,7 @@ %global major_version 2 %global minor_version 7 -%global teeny_version 3 +%global teeny_version 4 %global major_minor_version %{major_version}.%{minor_version} %global ruby_version %{major_minor_version}.%{teeny_version} @@ -20,12 +20,14 @@ %global rubygems_molinillo_version 0.5.7 # Default gems. -%global bundler_version 2.1.4 +%global bundler_version 2.2.24 %global bundler_connection_pool_version 2.2.2 -%global bundler_fileutils_version 1.3.0 -%global bundler_molinillo_version 0.6.6 -%global bundler_net_http_persistent_version 3.1.0 -%global bundler_thor_version 1.0.0 +%global bundler_fileutils_version 1.4.1 +%global bundler_molinillo_version 0.7.0 +%global bundler_net_http_persistent_version 4.0.0 +%global bundler_thor_version 1.1.0 +%global bundler_tmpdir_version 0.1.0 +%global bundler_uri_version 0.10.0 %global bigdecimal_version 2.0.0 %global did_you_mean_version 1.4.0 @@ -36,7 +38,7 @@ %global openssl_version 2.1.2 %global psych_version 3.1.0 %global racc_version 1.4.16 -%global rdoc_version 6.2.1 +%global rdoc_version 6.2.1.1 %global xmlrpc_version 0.3.0 # Bundled gems. @@ -62,6 +64,8 @@ %bcond_without gmp %bcond_without hostname %bcond_without systemtap +# Enable the tests requiring internet when building on local. +%bcond_with bundler_tests %if 0%{?fedora} %bcond_without hardening_test @@ -72,7 +76,7 @@ Name: %{?scl_prefix}ruby Version: %{ruby_version} # Use release tag directly dropping the %%{release_string} entirely # as %%{?!foo: %%define foo bar} does not work for rpm < 4.14 on RHEL 7. -Release: 129%{?dist} +Release: 130%{?dist} Group: Development/Languages # Public Domain for example for: include/ruby/st.h, strftime.c, missing/*, ... # MIT and CCO: ccan/* @@ -94,6 +98,9 @@ Source12: test_abrt.rb Source13: test_systemtap.rb # To test Ruby software collection Source14: test_dependent_scls.rb +# git clone --no-checkout git@github.com:rubygems/rubygems.git +# git -C rubygems archive --prefix=rubygems/ -v -o ruby-rubygems-bundler-v2.2.24.txz bundler-v2.2.24 +Source15: ruby-rubygems-bundler-v%{bundler_version}.txz # Call load builtin macro if it is defined (RPM 4.12+), # or call own load macro to avoid the error by "rhpkg srpm" on RPM 4.15+. @@ -139,9 +146,6 @@ Patch6: ruby-2.7.0-Initialize-ABRT-hook.patch # hardening features of glibc (rhbz#1361037). # https://bugs.ruby-lang.org/issues/12666 Patch9: ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch -# Revert commit which breaks bundled net-http-persistent version check. -# https://github.com/drbrain/net-http-persistent/pull/109 -Patch10: ruby-2.7.0-Remove-RubyGems-dependency.patch # Prevent issues with openssl loading when RubyGems are disabled. # https://github.com/ruby/openssl/pull/242 Patch13: ruby-2.8.0-remove-unneeded-gem-require-for-ipaddr.patch @@ -152,6 +156,21 @@ Patch19: ruby-2.7.1-Timeout-the-test_bug_reporter_add-witout-raising-err.patch # contains leading zero # https://bugzilla.redhat.com/show_bug.cgi?id=1944227 Patch20: ruby-3.0.0-Convert-ip-addresses-to-canonical-form.patch +# Revert a commit changing CFLAGS to avoid failures in test_jit.rb. +# https://bugs.ruby-lang.org/issues/18073 +# https://github.com/ruby/ruby/commit/29bbad939939c6dceb804aac667ba372fdee4ef5 +Patch21: ruby-2.7.4-Revert-fix-2.7-build-for-jit.patch +# Update `bundler.gemspec` from RubyGems, required to pass `make test-bundler`. +# Compare RubyGems `bundler/bundler.gemspec` with Ruby `lib/bundler/bundler.gemspec`. +Patch22: rubygems-bundler-gemspec-for-make-test-bundler.patch +# A missing gem error message is changed on RubyGems 3.2.13. +# https://github.com/ruby/ruby/commit/7efc7afcae6720e1af7ab49986d789b6f9d6fe0a +Patch23: rubygems-3.2.13-test-gem-message.patch +# Fix Gem::Requirement#== raising NoMethodError on RubyGems < 3.2.0. +# https://github.com/rubygems/rubygems/commit/d62539f23aa1624ae170008e47a5a3e15f0dc2ef +# https://github.com/ruby/ruby/commit/c082c6eb7c786a432bea23cf78839f64585cb630 +Patch24: rubygems-3.2.22-fix-requirement-equals.patch + # Skip some clocks that are not available on Brew build environment. # https://projects.engineering.redhat.com/browse/BST-1017 Patch100: ruby-2.7.0-skip-some-clocks.patch @@ -564,12 +583,21 @@ generates Ruby program. %prep -%setup -q -n %{ruby_archive} +%setup -q -n %{ruby_archive} -b15 # Remove bundled libraries to be sure they are not used. rm -rf ext/psych/yaml rm -rf ext/fiddle/libffi* +# Update Bundler to fix CVE-2020-36327. +# https://bugzilla.redhat.com/show_bug.cgi?id=1958999 +rm -rf lib/bundler{.rb,} +rm -rf {spec,tool}/bundler +cp -a %{_builddir}/rubygems/bundler/lib/bundler{.rb,} lib/ +cp -a %{_builddir}/rubygems/bundler/bundler.gemspec lib/bundler/ +cp -a %{_builddir}/rubygems/bundler/spec spec/bundler +cp -a %{_builddir}/rubygems/bundler/tool/bundler tool/bundler + %patch0 -p1 %patch1 -p1 %patch2 -p1 @@ -578,10 +606,13 @@ rm -rf ext/fiddle/libffi* %patch5 -p1 %patch6 -p1 %patch9 -p1 -%patch10 -p1 %patch13 -p1 %patch19 -p1 %patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 %patch100 -p1 # Provide an example of usage of the tapset: @@ -844,7 +875,7 @@ checksec -f libruby.so.%{ruby_version} | \ # FileUtils. [ "`make runruby TESTRUN_SCRIPT=\"-e \\\" \ module Bundler; end; \ - require 'bundler/vendor/fileutils/lib/fileutils/version'; \ + require 'bundler/vendor/fileutils/lib/fileutils'; \ puts Bundler::FileUtils::VERSION\\\"\" | tail -1`" \ == '%{bundler_fileutils_version}' ] @@ -870,6 +901,17 @@ checksec -f libruby.so.%{ruby_version} | \ puts Bundler::Thor::VERSION\\\"\" | tail -1`" \ == '%{bundler_thor_version}' ] +# tmpdir. +# TODO: There is no version in bundled tmpdir yet. +#%%{global bundler_tmpdir_version} + +# URI. +[ "`make runruby TESTRUN_SCRIPT=\"-e \\\" \ + module Bundler; end; \ + require 'bundler/vendor/uri/lib/uri/version'; \ + puts Bundler::URI::VERSION\\\"\" | tail -1`" \ + == '%{bundler_uri_version}' ] + # test_debug(TestRubyOptions) fails due to LoadError reported in debug mode, # when abrt.rb cannot be required (seems to be easier way then customizing @@ -903,6 +945,13 @@ sed -i '/assert_in_out_err/ s/)/, timeout: 30)/' test/-ext-/bug_reporter/test_bu make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS" +%if %{with bundler_tests} +# Fix some failing Bundler tests with old Git. +# https://github.com/rubygems/rubygems/pull/4851 +sed -i 's/branch -l /branch --list /' ./spec/bundler/support/builders.rb +make test-bundler +%endif + %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig @@ -1276,6 +1325,19 @@ make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS" %{gem_dir}/specifications/racc-%{racc_version}.gemspec %changelog +* Thu Jul 15 2021 Jun Aruga - 2.7.4-130 +- Upgrade to Ruby 2.7.4. +- Fix command injection vulnerability in RDoc. + Resolves: rhbz#1996669 +- Fix FTP PASV command response can cause Net::FTP to connect to arbitrary host. + Resolves: rhbz#1996666 +- Fix StartTLS stripping vulnerability in Net::IMAP. + Resolves: rhbz#1996668 +- Revert a commit changing CFLAGS to avoid failures in test_jit.rb. +- Upgrade to Bundler 2.2.24. + Resolves: CVE-2020-36327 +- Fix some failing Bundler tests with old Git. + * Tue Oct 13 2020 Vít Ondruch - 2.7.3-129 - Upgrade to Ruby 2.7.3. Resolves: rhbz#1947931