The package rpms/ruby.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/ruby.git/commit/?id=da89057b70502...
https://src.fedoraproject.org/cgit/rpms/ruby.git/commit/?id=4f392def2643c....
Change:
-%ifarch ppc64le
+%ifarch ppc64le
Thanks.
Full change:
============
commit da89057b7050262c877500341a8e51f2bb851fb8
Author: Vít Ondruch <vondruch(a)redhat.com>
Date: Thu Apr 21 11:42:08 2022 +0200
Fix GC test failures on ppc64le.
Fix /test_\(ast_compacts\|compact_count\|complex_hash_keys\|gc_compact_stats\)/
test failures on ppc64le. It seems that upstream forgot to backport
this patch.
https://bugs.ruby-lang.org/issues/18394
diff --git a/ruby-3.1.0-Use-mmap-for-allocating-heap-pages-in-the-GC.patch
b/ruby-3.1.0-Use-mmap-for-allocating-heap-pages-in-the-GC.patch
new file mode 100644
index 0000000..512be18
--- /dev/null
+++ b/ruby-3.1.0-Use-mmap-for-allocating-heap-pages-in-the-GC.patch
@@ -0,0 +1,359 @@
+From bcab8c3cd877506de75f50e0f9ed98827ed554b0 Mon Sep 17 00:00:00 2001
+From: Peter Zhu <peter(a)peterzhu.ca>
+Date: Tue, 23 Feb 2021 16:28:56 -0500
+Subject: [PATCH] Use mmap for allocating heap pages
+
+---
+ configure.ac | 16 ++++
+ gc.c | 149 ++++++++++++++++++++++++++---------
+ test/ruby/test_gc_compact.rb | 41 ++++++----
+ 3 files changed, 155 insertions(+), 51 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2dcebdde9f..b1b190004d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1944,6 +1944,7 @@ AC_CHECK_FUNCS(memmem)
+ AC_CHECK_FUNCS(mkfifo)
+ AC_CHECK_FUNCS(mknod)
+ AC_CHECK_FUNCS(mktime)
++AC_CHECK_FUNCS(mmap)
+ AC_CHECK_FUNCS(openat)
+ AC_CHECK_FUNCS(pipe2)
+ AC_CHECK_FUNCS(poll)
+@@ -2666,6 +2667,21 @@ main(int argc, char *argv[])
+ rb_cv_fork_with_pthread=yes)])
+ test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
+ ])
++
++AC_CHECK_HEADERS([sys/user.h])
++AS_IF([test "x$ac_cv_func_mmap" = xyes], [
++ AC_CACHE_CHECK([whether PAGE_SIZE is compile-time const], rb_cv_const_page_size,
++ [malloc_headers=`sed -n '/MALLOC_HEADERS_BEGIN/,/MALLOC_HEADERS_END/p'
${srcdir}/gc.c`
++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$malloc_headers
++ typedef char conftest_page[PAGE_SIZE];
++ ]], [[]])],
++ [rb_cv_const_page_size=yes],
++ [rb_cv_const_page_size=no])])
++])
++AS_IF([test "x$rb_cv_const_page_size" = xyes],
++ [AC_DEFINE(HAVE_CONST_PAGE_SIZE, 1)],
++ [AC_DEFINE(HAVE_CONST_PAGE_SIZE, 0)]
++)
+ }
+
+ : "runtime section" && {
+diff --git a/gc.c b/gc.c
+index f6acf3e117..6f8e5f242d 100644
+--- a/gc.c
++++ b/gc.c
+@@ -32,6 +32,7 @@
+ #include <stdarg.h>
+ #include <stdio.h>
+
++/* MALLOC_HEADERS_BEGIN */
+ #ifndef HAVE_MALLOC_USABLE_SIZE
+ # ifdef _WIN32
+ # define HAVE_MALLOC_USABLE_SIZE
+@@ -54,6 +55,12 @@
+ # endif
+ #endif
+
++#if !defined(PAGE_SIZE) && defined(HAVE_SYS_USER_H)
++/* LIST_HEAD conflicts with sys/queue.h on macOS */
++# include <sys/user.h>
++#endif
++/* MALLOC_HEADERS_END */
++
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+@@ -821,6 +828,25 @@ enum {
+ HEAP_PAGE_BITMAP_SIZE = (BITS_SIZE * HEAP_PAGE_BITMAP_LIMIT),
+ HEAP_PAGE_BITMAP_PLANES = 4 /* RGENGC: mark, unprotected, uncollectible, marking */
+ };
++#define HEAP_PAGE_ALIGN (1 << HEAP_PAGE_ALIGN_LOG)
++#define HEAP_PAGE_SIZE HEAP_PAGE_ALIGN
++
++#ifdef HAVE_MMAP
++# if HAVE_CONST_PAGE_SIZE
++/* If we have the HEAP_PAGE and it is a constant, then we can directly use it. */
++static const bool USE_MMAP_ALIGNED_ALLOC = (PAGE_SIZE <= HEAP_PAGE_SIZE);
++# elif defined(PAGE_MAX_SIZE) && (PAGE_MAX_SIZE <= HEAP_PAGE_SIZE)
++/* PAGE_SIZE <= HEAP_PAGE_SIZE */
++static const bool USE_MMAP_ALIGNED_ALLOC = true;
++# else
++/* Otherwise, fall back to determining if we can use mmap during runtime. */
++# define USE_MMAP_ALIGNED_ALLOC (use_mmap_aligned_alloc != false)
++
++static bool use_mmap_aligned_alloc;
++# endif
++#elif !defined(__MINGW32__) && !defined(_WIN32)
++static const bool USE_MMAP_ALIGNED_ALLOC = false;
++#endif
+
+ struct heap_page {
+ short total_slots;
+@@ -1760,14 +1786,14 @@ heap_unlink_page(rb_objspace_t *objspace, rb_heap_t *heap, struct
heap_page *pag
+ heap->total_slots -= page->total_slots;
+ }
+
+-static void rb_aligned_free(void *ptr);
++static void rb_aligned_free(void *ptr, size_t size);
+
+ static void
+ heap_page_free(rb_objspace_t *objspace, struct heap_page *page)
+ {
+ heap_allocated_pages--;
+ objspace->profile.total_freed_pages++;
+- rb_aligned_free(GET_PAGE_BODY(page->start));
++ rb_aligned_free(GET_PAGE_BODY(page->start), HEAP_PAGE_SIZE);
+ free(page);
+ }
+
+@@ -1819,7 +1845,7 @@ heap_page_allocate(rb_objspace_t *objspace)
+ /* assign heap_page entry */
+ page = calloc1(sizeof(struct heap_page));
+ if (page == 0) {
+- rb_aligned_free(page_body);
++ rb_aligned_free(page_body, HEAP_PAGE_SIZE);
+ rb_memerror();
+ }
+
+@@ -3159,15 +3185,18 @@ Init_heap(void)
+ {
+ rb_objspace_t *objspace = &rb_objspace;
+
+-#if defined(HAVE_SYSCONF) && defined(_SC_PAGE_SIZE)
+- /* If Ruby's heap pages are not a multiple of the system page size, we
+- * cannot use mprotect for the read barrier, so we must disable automatic
+- * compaction. */
+- int pagesize;
+- pagesize = (int)sysconf(_SC_PAGE_SIZE);
+- if ((HEAP_PAGE_SIZE % pagesize) != 0) {
+- ruby_enable_autocompact = 0;
+- }
++#if defined(HAVE_MMAP) && !HAVE_CONST_PAGE_SIZE &&
!defined(PAGE_MAX_SIZE)
++ /* Need to determine if we can use mmap at runtime. */
++# ifdef PAGE_SIZE
++ /* If the PAGE_SIZE macro can be used. */
++ use_mmap_aligned_alloc = PAGE_SIZE <= HEAP_PAGE_SIZE;
++# elif defined(HAVE_SYSCONF) && defined(_SC_PAGE_SIZE)
++ /* If we can use sysconf to determine the page size. */
++ use_mmap_aligned_alloc = sysconf(_SC_PAGE_SIZE) <= HEAP_PAGE_SIZE;
++# else
++ /* Otherwise we can't determine the system page size, so don't use mmap. */
++ use_mmap_aligned_alloc = FALSE;
++# endif
+ #endif
+
+ objspace->next_object_id = INT2FIX(OBJ_ID_INITIAL);
+@@ -8533,6 +8562,14 @@ gc_start_internal(rb_execution_context_t *ec, VALUE self, VALUE
full_mark, VALUE
+
+ /* For now, compact implies full mark / sweep, so ignore other flags */
+ if (RTEST(compact)) {
++ /* If not MinGW, Windows, or does not have mmap, we cannot use mprotect for
++ * the read barrier, so we must disable compaction. */
++#if !defined(__MINGW32__) && !defined(_WIN32)
++ if (!USE_MMAP_ALIGNED_ALLOC) {
++ rb_raise(rb_eNotImpError, "Compaction isn't available on this
platform");
++ }
++#endif
++
+ reason |= GPR_FLAG_COMPACT;
+ } else {
+ if (!RTEST(full_mark)) reason &= ~GPR_FLAG_FULL_MARK;
+@@ -9944,16 +9981,14 @@ gc_disable(rb_execution_context_t *ec, VALUE _)
+ static VALUE
+ gc_set_auto_compact(rb_execution_context_t *ec, VALUE _, VALUE v)
+ {
+-#if defined(HAVE_SYSCONF) && defined(_SC_PAGE_SIZE)
+- /* If Ruby's heap pages are not a multiple of the system page size, we
+- * cannot use mprotect for the read barrier, so we must disable automatic
+- * compaction. */
+- int pagesize;
+- pagesize = (int)sysconf(_SC_PAGE_SIZE);
+- if ((HEAP_PAGE_SIZE % pagesize) != 0) {
++ /* If not MinGW, Windows, or does not have mmap, we cannot use mprotect for
++ * the read barrier, so we must disable automatic compaction. */
++#if !defined(__MINGW32__) && !defined(_WIN32)
++ if (!USE_MMAP_ALIGNED_ALLOC) {
+ rb_raise(rb_eNotImpError, "Automatic compaction isn't available on this
platform");
+ }
+ #endif
++
+ ruby_enable_autocompact = RTEST(v);
+ return v;
+ }
+@@ -10350,22 +10385,54 @@ rb_aligned_malloc(size_t alignment, size_t size)
+ #elif defined _WIN32
+ void *_aligned_malloc(size_t, size_t);
+ res = _aligned_malloc(size, alignment);
+-#elif defined(HAVE_POSIX_MEMALIGN)
+- if (posix_memalign(&res, alignment, size) == 0) {
+- return res;
++#else
++ if (USE_MMAP_ALIGNED_ALLOC) {
++ GC_ASSERT(alignment % sysconf(_SC_PAGE_SIZE) == 0);
++
++ char *ptr = mmap(NULL, alignment + size, PROT_READ | PROT_WRITE, MAP_PRIVATE |
MAP_ANONYMOUS, -1, 0);
++ if (ptr == MAP_FAILED) {
++ return NULL;
++ }
++
++ char *aligned = ptr + alignment;
++ aligned -= ((VALUE)aligned & (alignment - 1));
++ GC_ASSERT(aligned > ptr);
++ GC_ASSERT(aligned <= ptr + alignment);
++
++ size_t start_out_of_range_size = aligned - ptr;
++ GC_ASSERT(start_out_of_range_size % sysconf(_SC_PAGE_SIZE) == 0);
++ if (start_out_of_range_size > 0) {
++ if (munmap(ptr, start_out_of_range_size)) {
++ rb_bug("rb_aligned_malloc: munmap failed for start");
++ }
++ }
++
++ size_t end_out_of_range_size = alignment - start_out_of_range_size;
++ GC_ASSERT(end_out_of_range_size % sysconf(_SC_PAGE_SIZE) == 0);
++ if (end_out_of_range_size > 0) {
++ if (munmap(aligned + size, end_out_of_range_size)) {
++ rb_bug("rb_aligned_malloc: munmap failed for end");
++ }
++ }
++
++ res = (void *)aligned;
+ }
+ else {
+- return NULL;
++# if defined(HAVE_POSIX_MEMALIGN)
++ if (posix_memalign(&res, alignment, size) != 0) {
++ return NULL;
++ }
++# elif defined(HAVE_MEMALIGN)
++ res = memalign(alignment, size);
++# else
++ char* aligned;
++ res = malloc(alignment + size + sizeof(void*));
++ aligned = (char*)res + alignment + sizeof(void*);
++ aligned -= ((VALUE)aligned & (alignment - 1));
++ ((void**)aligned)[-1] = res;
++ res = (void*)aligned;
++# endif
+ }
+-#elif defined(HAVE_MEMALIGN)
+- res = memalign(alignment, size);
+-#else
+- char* aligned;
+- res = malloc(alignment + size + sizeof(void*));
+- aligned = (char*)res + alignment + sizeof(void*);
+- aligned -= ((VALUE)aligned & (alignment - 1));
+- ((void**)aligned)[-1] = res;
+- res = (void*)aligned;
+ #endif
+
+ /* alignment must be a power of 2 */
+@@ -10375,16 +10442,26 @@ rb_aligned_malloc(size_t alignment, size_t size)
+ }
+
+ static void
+-rb_aligned_free(void *ptr)
++rb_aligned_free(void *ptr, size_t size)
+ {
+ #if defined __MINGW32__
+ __mingw_aligned_free(ptr);
+ #elif defined _WIN32
+ _aligned_free(ptr);
+-#elif defined(HAVE_MEMALIGN) || defined(HAVE_POSIX_MEMALIGN)
+- free(ptr);
+ #else
+- free(((void**)ptr)[-1]);
++ if (USE_MMAP_ALIGNED_ALLOC) {
++ GC_ASSERT(size % sysconf(_SC_PAGE_SIZE) == 0);
++ if (munmap(ptr, size)) {
++ rb_bug("rb_aligned_free: munmap failed");
++ }
++ }
++ else {
++# if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN)
++ free(ptr);
++# else
++ free(((void**)ptr)[-1]);
++# endif
++ }
+ #endif
+ }
+
+diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb
+index 4a8cff33f4..f5cab55ba7 100644
+--- a/test/ruby/test_gc_compact.rb
++++ b/test/ruby/test_gc_compact.rb
+@@ -4,12 +4,32 @@
+ require 'etc'
+
+ class TestGCCompact < Test::Unit::TestCase
+- class AutoCompact < Test::Unit::TestCase
++ module SupportsCompact
+ def setup
+ skip "autocompact not supported on this platform" unless
supports_auto_compact?
+ super
+ end
+
++ private
++
++ def supports_auto_compact?
++ return true unless defined?(Etc::SC_PAGE_SIZE)
++
++ begin
++ return GC::INTERNAL_CONSTANTS[:HEAP_PAGE_SIZE] % Etc.sysconf(Etc::SC_PAGE_SIZE)
== 0
++ rescue NotImplementedError
++ rescue ArgumentError
++ end
++
++ true
++ end
++ end
++
++ include SupportsCompact
++
++ class AutoCompact < Test::Unit::TestCase
++ include SupportsCompact
++
+ def test_enable_autocompact
+ before = GC.auto_compact
+ GC.auto_compact = true
+@@ -59,26 +79,17 @@ def test_implicit_compaction_does_something
+ ensure
+ GC.auto_compact = before
+ end
+-
+- private
+-
+- def supports_auto_compact?
+- return true unless defined?(Etc::SC_PAGE_SIZE)
+-
+- begin
+- return GC::INTERNAL_CONSTANTS[:HEAP_PAGE_SIZE] % Etc.sysconf(Etc::SC_PAGE_SIZE)
== 0
+- rescue NotImplementedError
+- rescue ArgumentError
+- end
+-
+- true
+- end
+ end
+
+ def os_page_size
+ return true unless defined?(Etc::SC_PAGE_SIZE)
+ end
+
++ def setup
++ skip "autocompact not supported on this platform" unless
supports_auto_compact?
++ super
++ end
++
+ def test_gc_compact_stats
+ list = []
+
+--
+2.30.1 (Apple Git-130)
+
diff --git a/ruby.spec b/ruby.spec
index a68ad9f..7218bf3 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -153,6 +153,11 @@ Patch15: ruby-dwarf5-avoid_crash-r1.patch
# Avoid possible timeout errors in TestBugReporter#test_bug_reporter_add.
#
https://bugs.ruby-lang.org/issues/16492
Patch19: ruby-2.7.1-Timeout-the-test_bug_reporter_add-witout-raising-err.patch
+# Fix /test_\(ast_compacts\|compact_count\|complex_hash_keys\|gc_compact_stats\)/
+# test failures on ppc64le.
+#
https://bugs.ruby-lang.org/issues/18746
+#
https://bugs.ruby-lang.org/issues/18394
+Patch20: ruby-3.1.0-Use-mmap-for-allocating-heap-pages-in-the-GC.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Suggests: rubypick
@@ -599,6 +604,7 @@ rm -rf ext/fiddle/libffi*
%patch9 -p1
%patch15 -p1
%patch19 -p1
+%patch20 -p1
# Provide an example of usage of the tapset:
cp -a %{SOURCE3} .
@@ -874,12 +880,6 @@ make runruby TESTRUN_SCRIPT="--enable-gems %{SOURCE13}"
DISABLE_TESTS=""
MSPECOPTS=""
-%ifarch ppc64le
-# `Couldn't unprotect page` error.
-#
https://bugs.ruby-lang.org/issues/18746
-DISABLE_TESTS="$DISABLE_TESTS -n
!/test_\(ast_compacts\|compact_count\|complex_hash_keys\|gc_compact_stats\)/"
-%endif
-
# Avoid `hostname' dependency.
%{!?with_hostname:MSPECOPTS="-P 'Socket.gethostname returns the host
name'"}
commit 4f392def2643c04a48416e14e3ebbee3945029f4
Author: Vít Ondruch <vondruch(a)redhat.com>
Date: Tue Apr 19 14:11:12 2022 +0200
Upgrade to Ruby 3.0.4.
diff --git a/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch
b/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch
index 118203c..437d09f 100644
--- a/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch
+++ b/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
-@@ -3881,7 +3881,8 @@ AS_CASE(["$ruby_version_dir_name"],
+@@ -3886,7 +3886,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/ruby-2.1.0-always-use-i386.patch b/ruby-2.1.0-always-use-i386.patch
index de58295..46584d7 100644
--- a/ruby-2.1.0-always-use-i386.patch
+++ b/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
-@@ -3945,6 +3945,8 @@ AC_SUBST(vendorarchdir)dnl
+@@ -3950,6 +3950,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/ruby-2.1.0-custom-rubygems-location.patch
b/ruby-2.1.0-custom-rubygems-location.patch
index b7157ff..6946429 100644
--- a/ruby-2.1.0-custom-rubygems-location.patch
+++ b/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
-@@ -3917,6 +3917,10 @@ AC_ARG_WITH(vendorarchdir,
+@@ -3922,6 +3922,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=''
-@@ -3941,6 +3941,7 @@ AC_SUBST(sitearchdir)dnl
+@@ -3946,6 +3950,7 @@ AC_SUBST(sitearchdir)dnl
AC_SUBST(vendordir)dnl
AC_SUBST(vendorlibdir)dnl
AC_SUBST(vendorarchdir)dnl
@@ -75,7 +75,7 @@ index e9110a17ca..76a1f0a315 100755
mandir = CONFIG["mandir", true]
docdir = CONFIG["docdir", true]
enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
-@@ -581,7 +581,16 @@ def stub
+@@ -581,7 +582,16 @@ def stub
install?(:local, :comm, :lib) do
prepare "library scripts", rubylibdir
noinst = %w[*.txt *.rdoc *.gemspec]
diff --git a/ruby-2.3.0-ruby_version.patch b/ruby-2.3.0-ruby_version.patch
index 4fd6530..fd545e5 100644
--- a/ruby-2.3.0-ruby_version.patch
+++ b/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
-@@ -3832,9 +3832,6 @@ AS_CASE(["$target_os"],
+@@ -3837,9 +3837,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],
-@@ -3857,56 +3857,62 @@ AC_ARG_WITH(ridir,
+@@ -3862,56 +3859,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)
-@@ -3923,6 +3923,7 @@ AC_SUBST(sitearchincludedir)dnl
+@@ -3928,6 +3931,7 @@ AC_SUBST(sitearchincludedir)dnl
AC_SUBST(arch)dnl
AC_SUBST(sitearch)dnl
AC_SUBST(ruby_version)dnl
@@ -237,7 +237,7 @@ diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index b25068405d..e9fef4a311 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
-@@ -1452,7 +1452,8 @@ def test_self_use_paths
+@@ -1440,7 +1440,8 @@ def test_self_use_paths
def test_self_user_dir
parts = [@userhome, '.gem', Gem.ruby_engine]
@@ -247,7 +247,7 @@ index b25068405d..e9fef4a311 100644
FileUtils.mkdir_p File.join(parts)
-@@ -1530,7 +1531,7 @@ def test_self_vendor_dir
+@@ -1516,7 +1517,7 @@ def test_self_vendor_dir
vendordir(File.join(@tempdir, 'vendor')) do
expected =
File.join RbConfig::CONFIG['vendordir'], 'gems',
diff --git a/ruby-dwarf5-avoid_crash-r1.patch b/ruby-dwarf5-avoid_crash-r1.patch
index c14642b..b183f8f 100644
--- a/ruby-dwarf5-avoid_crash-r1.patch
+++ b/ruby-dwarf5-avoid_crash-r1.patch
@@ -31,7 +31,7 @@
addr += a;
break;
case DW_LNS_advance_line: {
-@@ -450,7 +452,7 @@
+@@ -451,7 +453,7 @@
/* isa = (unsigned int)*/(void)uleb128((char **)&p);
break;
case 0:
@@ -40,7 +40,7 @@
op = *p++;
switch (op) {
case DW_LNE_end_sequence:
-@@ -807,6 +809,18 @@
+@@ -808,6 +810,18 @@
DW_FORM_addrx4 = 0x2c
};
@@ -59,7 +59,7 @@
enum {
VAL_none = 0,
VAL_cstr = 1,
-@@ -961,6 +975,23 @@
+@@ -962,6 +976,23 @@
}
static void
@@ -83,7 +83,7 @@
di_read_debug_abbrev_cu(DebugInfoReader *reader)
{
uint64_t prev = 0;
-@@ -974,12 +1005,7 @@
+@@ -975,12 +1006,7 @@
prev = abbrev_number;
uleb128(&p); /* tag */
p++; /* has_children */
@@ -97,7 +97,7 @@
}
}
-@@ -1243,12 +1269,7 @@
+@@ -1244,12 +1270,7 @@
/* skip 255th record */
uleb128(&p); /* tag */
p++; /* has_children */
@@ -111,7 +111,7 @@
for (uint64_t n = uleb128(&p); abbrev_number != n; n = uleb128(&p)) {
if (n == 0) {
fprintf(stderr,"%d: Abbrev Number %"PRId64" not
found\n",__LINE__, abbrev_number);
-@@ -1256,12 +1277,7 @@
+@@ -1257,12 +1278,7 @@
}
uleb128(&p); /* tag */
p++; /* has_children */
@@ -125,7 +125,7 @@
}
return p;
}
-@@ -1389,6 +1405,21 @@
+@@ -1390,6 +1406,21 @@
}
}
@@ -147,7 +147,7 @@
static uintptr_t
ranges_include(DebugInfoReader *reader, ranges_t *ptr, uint64_t addr)
{
-@@ -1402,8 +1433,50 @@
+@@ -1403,8 +1434,50 @@
}
else if (ptr->ranges_set) {
/* TODO: support base address selection entry */
@@ -199,7 +199,7 @@
for (;;) {
uintptr_t from = read_uintptr(&p);
uintptr_t to = read_uintptr(&p);
-@@ -1747,6 +1820,7 @@
+@@ -1750,6 +1823,7 @@
".debug_info",
".debug_line",
".debug_ranges",
@@ -207,7 +207,7 @@
".debug_str"
};
-@@ -2003,6 +2077,7 @@
+@@ -2006,6 +2080,7 @@
"__debug_info",
"__debug_line",
"__debug_ranges",
diff --git a/ruby.spec b/ruby.spec
index 347dc48..a68ad9f 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -1,6 +1,6 @@
%global major_version 3
%global minor_version 0
-%global teeny_version 2
+%global teeny_version 4
%global major_minor_version %{major_version}.%{minor_version}
%global ruby_version %{major_minor_version}.%{teeny_version}
@@ -22,7 +22,7 @@
%endif
-%global release 149
+%global release 152
%{!?release_string:%define release_string
%{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}}
# The RubyGems library has to stay out of Ruby directory tree, since the
@@ -30,12 +30,12 @@
%global rubygems_dir %{_datadir}/rubygems
# Bundled libraries versions
-%global rubygems_version 3.2.22
+%global rubygems_version 3.2.33
%global rubygems_molinillo_version 0.7.0
# Default gems.
-%global bundler_version 2.2.22
-%global bundler_connection_pool_version 2.2.2
+%global bundler_version 2.2.33
+%global bundler_connection_pool_version 2.3.0
%global bundler_fileutils_version 1.4.1
%global bundler_molinillo_version 0.7.0
%global bundler_net_http_persistent_version 4.0.0
@@ -49,20 +49,20 @@
%global io_console_version 0.5.7
%global irb_version 1.3.5
%global json_version 2.5.1
-%global openssl_version 2.2.0
-%global psych_version 3.3.0
-%global racc_version 1.5.1
-%global rdoc_version 6.3.1
+%global openssl_version 2.2.1
+%global psych_version 3.3.2
+%global racc_version 1.5.2
+%global rdoc_version 6.3.3
# Bundled gems.
%global minitest_version 5.14.2
%global power_assert_version 1.2.0
%global rake_version 13.0.3
-%global rbs_version 1.0.4
+%global rbs_version 1.4.0
%global test_unit_version 3.3.7
%global rexml_version 3.2.5
%global rss_version 0.2.9
-%global typeprof_version 0.12.0
+%global typeprof_version 0.15.2
%global tapset_libdir %(echo %{_libdir} | sed 's/64//')*
@@ -874,6 +874,12 @@ make runruby TESTRUN_SCRIPT="--enable-gems %{SOURCE13}"
DISABLE_TESTS=""
MSPECOPTS=""
+%ifarch ppc64le
+# `Couldn't unprotect page` error.
+#
https://bugs.ruby-lang.org/issues/18746
+DISABLE_TESTS="$DISABLE_TESTS -n
!/test_\(ast_compacts\|compact_count\|complex_hash_keys\|gc_compact_stats\)/"
+%endif
+
# Avoid `hostname' dependency.
%{!?with_hostname:MSPECOPTS="-P 'Socket.gethostname returns the host
name'"}
@@ -1138,26 +1144,26 @@ MSPECOPTS=""
%{gem_dir}/specifications/default/abbrev-0.1.0.gemspec
%{gem_dir}/specifications/default/base64-0.1.0.gemspec
%{gem_dir}/specifications/default/benchmark-0.1.1.gemspec
-%{gem_dir}/specifications/default/cgi-0.2.0.gemspec
+%{gem_dir}/specifications/default/cgi-0.2.1.gemspec
%{gem_dir}/specifications/default/csv-3.1.9.gemspec
-%{gem_dir}/specifications/default/date-3.1.0.gemspec
+%{gem_dir}/specifications/default/date-3.1.3.gemspec
%{gem_dir}/specifications/default/dbm-1.1.0.gemspec
-%{gem_dir}/specifications/default/debug-0.1.0.gemspec
+%{gem_dir}/specifications/default/debug-0.2.1.gemspec
%{gem_dir}/specifications/default/delegate-0.2.0.gemspec
%{gem_dir}/specifications/default/did_you_mean-%{did_you_mean_version}.gemspec
%{gem_dir}/specifications/default/digest-3.0.0.gemspec
-%{gem_dir}/specifications/default/drb-2.0.4.gemspec
+%{gem_dir}/specifications/default/drb-2.0.5.gemspec
%{gem_dir}/specifications/default/erb-%{erb_version}.gemspec
-%{gem_dir}/specifications/default/etc-1.2.0.gemspec
-%{gem_dir}/specifications/default/fcntl-1.0.0.gemspec
-%{gem_dir}/specifications/default/fiddle-1.0.6.gemspec
+%{gem_dir}/specifications/default/etc-1.3.0.gemspec
+%{gem_dir}/specifications/default/fcntl-1.0.1.gemspec
+%{gem_dir}/specifications/default/fiddle-1.0.8.gemspec
%{gem_dir}/specifications/default/fileutils-1.5.0.gemspec
%{gem_dir}/specifications/default/find-0.1.0.gemspec
%{gem_dir}/specifications/default/forwardable-1.3.2.gemspec
%{gem_dir}/specifications/default/gdbm-2.1.0.gemspec
%{gem_dir}/specifications/default/getoptlong-0.1.1.gemspec
%{gem_dir}/specifications/default/io-nonblock-0.1.0.gemspec
-%{gem_dir}/specifications/default/io-wait-0.1.0.gemspec
+%{gem_dir}/specifications/default/io-wait-0.2.0.gemspec
%{gem_dir}/specifications/default/ipaddr-1.2.2.gemspec
%{gem_dir}/specifications/default/logger-1.4.3.gemspec
%{gem_dir}/specifications/default/matrix-0.3.1.gemspec
@@ -1166,33 +1172,33 @@ MSPECOPTS=""
%{gem_dir}/specifications/default/net-http-0.1.1.gemspec
%{gem_dir}/specifications/default/net-imap-0.1.1.gemspec
%{gem_dir}/specifications/default/net-pop-0.1.1.gemspec
-%{gem_dir}/specifications/default/net-protocol-0.1.0.gemspec
+%{gem_dir}/specifications/default/net-protocol-0.1.1.gemspec
%{gem_dir}/specifications/default/net-smtp-0.2.1.gemspec
%{gem_dir}/specifications/default/nkf-0.1.0.gemspec
%{gem_dir}/specifications/default/observer-0.1.1.gemspec
%{gem_dir}/specifications/default/open3-0.1.1.gemspec
%{gem_dir}/specifications/default/open-uri-0.1.0.gemspec
-%{gem_dir}/specifications/default/optparse-0.1.0.gemspec
+%{gem_dir}/specifications/default/optparse-0.1.1.gemspec
%{gem_dir}/specifications/default/openssl-%{openssl_version}.gemspec
%{gem_dir}/specifications/default/ostruct-0.3.1.gemspec
%{gem_dir}/specifications/default/pathname-0.1.0.gemspec
-%{gem_dir}/specifications/default/pp-0.1.0.gemspec
-%{gem_dir}/specifications/default/prettyprint-0.1.0.gemspec
+%{gem_dir}/specifications/default/pp-0.2.1.gemspec
+%{gem_dir}/specifications/default/prettyprint-0.1.1.gemspec
%{gem_dir}/specifications/default/prime-0.1.2.gemspec
%{gem_dir}/specifications/default/pstore-0.1.1.gemspec
%{gem_dir}/specifications/default/racc-%{racc_version}.gemspec
%{gem_dir}/specifications/default/readline-0.0.2.gemspec
%{gem_dir}/specifications/default/readline-ext-0.1.1.gemspec
%{gem_dir}/specifications/default/reline-0.2.5.gemspec
-%{gem_dir}/specifications/default/resolv-0.2.0.gemspec
+%{gem_dir}/specifications/default/resolv-0.2.1.gemspec
%{gem_dir}/specifications/default/resolv-replace-0.1.0.gemspec
-%{gem_dir}/specifications/default/rinda-0.1.0.gemspec
+%{gem_dir}/specifications/default/rinda-0.1.1.gemspec
%{gem_dir}/specifications/default/securerandom-0.1.0.gemspec
%{gem_dir}/specifications/default/set-1.0.1.gemspec
%{gem_dir}/specifications/default/shellwords-0.1.0.gemspec
%{gem_dir}/specifications/default/singleton-0.1.1.gemspec
-%{gem_dir}/specifications/default/stringio-3.0.0.gemspec
-%{gem_dir}/specifications/default/strscan-3.0.0.gemspec
+%{gem_dir}/specifications/default/stringio-3.0.1.gemspec
+%{gem_dir}/specifications/default/strscan-3.0.1.gemspec
%{gem_dir}/specifications/default/syslog-0.1.0.gemspec
%{gem_dir}/specifications/default/tempfile-0.1.1.gemspec
%{gem_dir}/specifications/default/time-0.1.0.gemspec
@@ -1205,7 +1211,7 @@ MSPECOPTS=""
%{gem_dir}/specifications/default/weakref-0.1.1.gemspec
#%%{gem_dir}/specifications/default/win32ole-1.8.8.gemspec
%{gem_dir}/specifications/default/yaml-0.1.1.gemspec
-%{gem_dir}/specifications/default/zlib-1.1.0.gemspec
+%{gem_dir}/specifications/default/zlib-2.0.0.gemspec
%{gem_dir}/gems/erb-%{erb_version}
# Use standalone rubygem-racc if Racc binary is required. Shipping this
@@ -1299,7 +1305,6 @@ MSPECOPTS=""
%doc %{gem_dir}/gems/rbs-%{rbs_version}/README.md
%{gem_dir}/gems/rbs-%{rbs_version}/Rakefile
%{gem_dir}/gems/rbs-%{rbs_version}/Steepfile
-%{gem_dir}/gems/rbs-%{rbs_version}/bin
%{gem_dir}/gems/rbs-%{rbs_version}/core
%doc %{gem_dir}/gems/rbs-%{rbs_version}/docs
%{gem_dir}/gems/rbs-%{rbs_version}/exe
@@ -1355,6 +1360,9 @@ MSPECOPTS=""
%changelog
+* Tue Apr 19 2022 Vít Ondruch <vondruch(a)redhat.com> - 3.0.2-152
+- Upgrade to Ruby 3.0.4.
+
* Tue Jul 13 2021 Jarek Prokop <jprokop(a)redhat.com> - 3.0.2-149
- Upgrade to Ruby 3.0.2.
- Fix command injection vulnerability in RDoc.
diff --git a/sources b/sources
index fc750ca..acb6fbe 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (ruby-3.0.2.tar.xz) =
0f702e2d8ca1342a9d4284dbdd234a3588e057b92566353aa7c21835cf09a3932864b2acf459a976960a1704e9befa562155d36b98b7cda8bd99526e10a374c4
+SHA512 (ruby-3.0.4.tar.xz) =
53bf7dd403b0c68af9691882ad8ed7422c8d1f496627428fb4c3caf0b0313715524b744c5f453aced2d49e16e55f3f45b46b9a77aa3097dbfcae7caa0208194b