Upgrade to Ruby 3.0.3.

This commit is contained in:
Vít Ondruch 2021-11-25 17:46:12 +01:00
parent c4f8814a93
commit d584a5bfb3
20 changed files with 185 additions and 336 deletions

View File

@ -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
@@ -3941,6 +3945,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]

View File

@ -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,
@@ -3857,56 +3854,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
@@ -3923,6 +3926,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',

View File

@ -8,7 +8,7 @@ on Red Hat platforms.
This workaround rhbz#1361037
---
test/fiddle/helper.rb | 3 +++
test/fiddle/helper.rb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb

View File

@ -0,0 +1,84 @@
From 202ff1372a40a8adf9aac74bfe8a39141b0c57e5 Mon Sep 17 00:00:00 2001
From: Kazuki Yamaguchi <k@rhe.jp>
Date: Mon, 27 Sep 2021 00:38:38 +0900
Subject: [PATCH] ext/openssl/extconf.rb: require OpenSSL version >= 1.0.1, < 3
Ruby/OpenSSL 2.1.x and 2.2.x will not support OpenSSL 3.0 API. Let's
make extconf.rb explicitly check the version number to be within the
acceptable range, since it will not compile anyway.
Reference: https://bugs.ruby-lang.org/issues/18192
---
ext/openssl/extconf.rb | 43 ++++++++++++++++++++++++------------------
1 file changed, 25 insertions(+), 18 deletions(-)
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 264130bb..7e817ae2 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -33,9 +33,6 @@
have_library("ws2_32")
end
-Logging::message "=== Checking for required stuff... ===\n"
-result = pkg_config("openssl") && have_header("openssl/ssl.h")
-
if $mingw
append_cflags '-D_FORTIFY_SOURCE=2'
append_ldflags '-fstack-protector'
@@ -92,19 +89,33 @@ def find_openssl_library
return false
end
-unless result
- unless find_openssl_library
- Logging::message "=== Checking for required stuff failed. ===\n"
- Logging::message "Makefile wasn't created. Fix the errors above.\n"
- raise "OpenSSL library could not be found. You might want to use " \
- "--with-openssl-dir=<dir> option to specify the prefix where OpenSSL " \
- "is installed."
- end
+Logging::message "=== Checking for required stuff... ===\n"
+pkg_config_found = pkg_config("openssl") && have_header("openssl/ssl.h")
+
+if !pkg_config_found && !find_openssl_library
+ Logging::message "=== Checking for required stuff failed. ===\n"
+ Logging::message "Makefile wasn't created. Fix the errors above.\n"
+ raise "OpenSSL library could not be found. You might want to use " \
+ "--with-openssl-dir=<dir> option to specify the prefix where OpenSSL " \
+ "is installed."
end
-unless checking_for("OpenSSL version is 1.0.1 or later") {
- try_static_assert("OPENSSL_VERSION_NUMBER >= 0x10001000L", "openssl/opensslv.h") }
- raise "OpenSSL >= 1.0.1 or LibreSSL is required"
+version_ok = if have_macro("LIBRESSL_VERSION_NUMBER", "openssl/opensslv.h")
+ is_libressl = true
+ checking_for("LibreSSL version >= 2.5.0") {
+ try_static_assert("LIBRESSL_VERSION_NUMBER >= 0x20500000L", "openssl/opensslv.h") }
+else
+ checking_for("OpenSSL version >= 1.0.1 and < 3.0.0") {
+ try_static_assert("OPENSSL_VERSION_NUMBER >= 0x10001000L", "openssl/opensslv.h") &&
+ !try_static_assert("OPENSSL_VERSION_MAJOR >= 3", "openssl/opensslv.h") }
+end
+unless version_ok
+ raise "OpenSSL >= 1.0.1, < 3.0.0 or LibreSSL >= 2.5.0 is required"
+end
+
+# Prevent wincrypt.h from being included, which defines conflicting macro with openssl/x509.h
+if is_libressl && ($mswin || $mingw)
+ $defs.push("-DNOCRYPT")
end
Logging::message "=== Checking for OpenSSL features... ===\n"
@@ -116,10 +127,6 @@ def find_openssl_library
have_func("ENGINE_load_#{name}()", "openssl/engine.h")
}
-if ($mswin || $mingw) && have_macro("LIBRESSL_VERSION_NUMBER", "openssl/opensslv.h")
- $defs.push("-DNOCRYPT")
-end
-
# added in 1.0.2
have_func("EC_curve_nist2nid")
have_func("X509_REVOKED_dup")

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Get rid of type-punning pointer casts [Bug #18062]
---
vm_eval.c | 4 +++-
vm_insnhelper.c | 7 +++++--
vm_method.c | 41 +++++++++++++++++++++++++---------------
vm_method.c | 41 ++++++++++++++++++++++++++---------------
3 files changed, 34 insertions(+), 18 deletions(-)
diff --git a/vm_eval.c b/vm_eval.c
@ -30,7 +30,7 @@ diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 14928b2afe8e..e186376b24d7 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1636,9 +1636,11 @@ vm_search_cc(const VALUE klass, const struct rb_callinfo * const ci)
@@ -1637,9 +1637,11 @@ vm_search_cc(const VALUE klass, const struct rb_callinfo * const ci)
const ID mid = vm_ci_mid(ci);
struct rb_id_table *cc_tbl = RCLASS_CC_TBL(klass);
struct rb_class_cc_entries *ccs = NULL;
@ -43,7 +43,7 @@ index 14928b2afe8e..e186376b24d7 100644
const int ccs_len = ccs->len;
VM_ASSERT(vm_ccs_verify(ccs, mid, klass));
@@ -1705,8 +1707,9 @@ vm_search_cc(const VALUE klass, const struct rb_callinfo * const ci)
@@ -1706,8 +1708,9 @@ vm_search_cc(const VALUE klass, const struct rb_callinfo * const ci)
if (ccs == NULL) {
VM_ASSERT(cc_tbl != NULL);
@ -123,7 +123,7 @@ index 016dba1dbb18..1fd0bd57f7ca 100644
RB_DEBUG_COUNTER_INC(cc_invalidate_negative);
}
@@ -1023,6 +1024,7 @@ prepare_callable_method_entry(VALUE defined_class, ID id, const rb_method_entry_
@@ -1023,6 +1025,7 @@ prepare_callable_method_entry(VALUE defined_class, ID id, const rb_method_entry_
{
struct rb_id_table *mtbl;
const rb_callable_method_entry_t *cme;
@ -131,7 +131,7 @@ index 016dba1dbb18..1fd0bd57f7ca 100644
if (me) {
if (me->defined_class == 0) {
@@ -1032,7 +1034,8 @@ prepare_callable_method_entry(VALUE defined_class, ID id, const rb_method_entry_
@@ -1032,7 +1035,8 @@ prepare_callable_method_entry(VALUE defined_class, ID id, const rb_method_entry_
mtbl = RCLASS_CALLABLE_M_TBL(defined_class);
@ -141,7 +141,7 @@ index 016dba1dbb18..1fd0bd57f7ca 100644
RB_DEBUG_COUNTER_INC(mc_cme_complement_hit);
VM_ASSERT(callable_method_entry_p(cme));
VM_ASSERT(!METHOD_ENTRY_INVALIDATED(cme));
@@ -1076,9 +1079,10 @@ cached_callable_method_entry(VALUE klass, ID mid)
@@ -1076,9 +1080,10 @@ cached_callable_method_entry(VALUE klass, ID mid)
ASSERT_vm_locking();
struct rb_id_table *cc_tbl = RCLASS_CC_TBL(klass);
@ -154,7 +154,7 @@ index 016dba1dbb18..1fd0bd57f7ca 100644
VM_ASSERT(vm_ccs_p(ccs));
if (LIKELY(!METHOD_ENTRY_INVALIDATED(ccs->cme))) {
@@ -1104,12 +1108,14 @@ cache_callable_method_entry(VALUE klass, ID mid, const rb_callable_method_entry_
@@ -1104,12 +1109,14 @@ cache_callable_method_entry(VALUE klass, ID mid, const rb_callable_method_entry_
struct rb_id_table *cc_tbl = RCLASS_CC_TBL(klass);
struct rb_class_cc_entries *ccs;
@ -170,7 +170,7 @@ index 016dba1dbb18..1fd0bd57f7ca 100644
VM_ASSERT(ccs->cme == cme);
}
else {
@@ -1123,8 +1129,12 @@ negative_cme(ID mid)
@@ -1123,8 +1130,12 @@ negative_cme(ID mid)
{
rb_vm_t *vm = GET_VM();
const rb_callable_method_entry_t *cme;

View File

@ -13,7 +13,7 @@ diff --git a/addr2line.c b/addr2line.c
index fed1a8da84e5..92c6da5e3bea 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -1592,14 +1592,31 @@ di_read_cu(DebugInfoReader *reader)
@@ -1593,14 +1593,31 @@ di_read_cu(DebugInfoReader *reader)
}
static void
@ -47,7 +47,7 @@ index fed1a8da84e5..92c6da5e3bea 100644
if (!di_read_die(reader, &die)) goto finish;
/* enumerate abbrev */
@@ -1664,7 +1681,7 @@ debug_info_read(DebugInfoReader *reader, int num_traces, void **traces,
@@ -1665,7 +1682,7 @@ debug_info_read(DebugInfoReader *reader, int num_traces, void **traces,
/* 1 or 3 */
break; /* goto skip_die; */
case DW_AT_abstract_origin:

View File

@ -1100,15 +1100,15 @@ index 829529d4b9..f52e67079d 100644
- StringValue(data);
- StringValue(sig);
-
- switch (ECDSA_verify(0, (unsigned char *) RSTRING_PTR(data), RSTRING_LENINT(data), (unsigned char *) RSTRING_PTR(sig), (int)RSTRING_LEN(sig), ec)) {
- case 1: return Qtrue;
- case 0: return Qfalse;
- default: break;
- switch (ECDSA_verify(0, (unsigned char *)RSTRING_PTR(data), RSTRING_LENINT(data),
- (unsigned char *)RSTRING_PTR(sig), RSTRING_LENINT(sig), ec)) {
- case 1:
- return Qtrue;
- case 0:
- return Qfalse;
- default:
- ossl_raise(eECError, "ECDSA_verify");
- }
-
- ossl_raise(eECError, "ECDSA_verify");
-
- UNREACHABLE;
-}
-
/*

View File

@ -95,7 +95,7 @@ diff --git a/ext/openssl/ossl_ts.c b/ext/openssl/ossl_ts.c
index 692c0d620f..f1da7c1947 100644
--- a/ext/openssl/ossl_ts.c
+++ b/ext/openssl/ossl_ts.c
@@ -816,7 +816,7 @@ ossl_ts_resp_verify(int argc, VALUE *argv, VALUE self)
@@ -820,7 +820,7 @@ ossl_ts_resp_verify(int argc, VALUE *argv, VALUE self)
X509_up_ref(cert);
}
@ -126,7 +126,7 @@ diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 4b7efa39f5..ec430bfb0c 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -1522,8 +1522,8 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self)
@@ -1535,8 +1535,8 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self)
static inline int
ssl_started(SSL *ssl)
{

View File

@ -63,7 +63,7 @@ method name.
This resolves [Bug #16936].
---
tool/lib/minitest/unit.rb | 12 +++++++++---
1 file changed, 9 insertion(+), 3 deletion(-)
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tool/lib/minitest/unit.rb b/tool/lib/minitest/unit.rb
index c58a609bfa..d5af6cb906 100644

View File

@ -2,7 +2,7 @@ diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 3b425ca..40e748c 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -1844,6 +1844,11 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
@@ -1870,6 +1870,11 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
return str;
GetSSL(self, ssl);

View File

@ -1,6 +1,18 @@
From 3b91792d3d644d6d6b0059cb315c9fe5d3626bab Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@ruby-lang.org>
Date: Sat, 6 Mar 2021 00:03:57 +0900
Subject: [PATCH] Support GCC's DWARF 5 [Bug #17585]
Co-Authored-By: xtkoba (Tee KOBAYASHI) <xtkoba+ruby@gmail.com>
---
addr2line.c | 119 ++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 97 insertions(+), 22 deletions(-)
diff --git a/addr2line.c b/addr2line.c
index 0029cffbca..855efb40d4 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -159,11 +159,12 @@
@@ -159,11 +159,12 @@ typedef struct obj_info {
struct dwarf_section debug_info;
struct dwarf_section debug_line;
struct dwarf_section debug_ranges;
@ -14,7 +26,7 @@
static struct dwarf_section *
obj_dwarf_section_at(obj_info_t *obj, int n)
@@ -173,6 +174,7 @@
@@ -173,6 +174,7 @@ obj_dwarf_section_at(obj_info_t *obj, int n)
&obj->debug_info,
&obj->debug_line,
&obj->debug_ranges,
@ -22,7 +34,7 @@
&obj->debug_str
};
if (n < 0 || DWARF_SECTION_COUNT <= n) {
@@ -411,7 +413,7 @@
@@ -411,7 +413,7 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
FILL_LINE();
break;
case DW_LNS_advance_pc:
@ -31,7 +43,7 @@
addr += a;
break;
case DW_LNS_advance_line: {
@@ -450,7 +452,7 @@
@@ -451,7 +453,7 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
/* isa = (unsigned int)*/(void)uleb128((char **)&p);
break;
case 0:
@ -40,7 +52,7 @@
op = *p++;
switch (op) {
case DW_LNE_end_sequence:
@@ -807,6 +809,18 @@
@@ -808,6 +810,18 @@ enum
DW_FORM_addrx4 = 0x2c
};
@ -59,10 +71,11 @@
enum {
VAL_none = 0,
VAL_cstr = 1,
@@ -961,6 +975,23 @@
@@ -961,6 +975,23 @@ debug_info_reader_init(DebugInfoReader *reader, obj_info_t *obj)
reader->current_low_pc = 0;
}
static void
+static void
+di_skip_die_attributes(char **p)
+{
+ for (;;) {
@ -79,11 +92,10 @@
+ }
+}
+
+static void
static void
di_read_debug_abbrev_cu(DebugInfoReader *reader)
{
uint64_t prev = 0;
@@ -974,12 +1005,7 @@
@@ -975,12 +1006,7 @@ di_read_debug_abbrev_cu(DebugInfoReader *reader)
prev = abbrev_number;
uleb128(&p); /* tag */
p++; /* has_children */
@ -97,7 +109,7 @@
}
}
@@ -1243,12 +1269,7 @@
@@ -1244,12 +1270,7 @@ di_find_abbrev(DebugInfoReader *reader, uint64_t abbrev_number)
/* skip 255th record */
uleb128(&p); /* tag */
p++; /* has_children */
@ -111,7 +123,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 @@ di_find_abbrev(DebugInfoReader *reader, uint64_t abbrev_number)
}
uleb128(&p); /* tag */
p++; /* has_children */
@ -125,7 +137,7 @@
}
return p;
}
@@ -1389,6 +1405,21 @@
@@ -1390,6 +1406,21 @@ ranges_set(ranges_t *ptr, DebugInfoValue *v)
}
}
@ -147,7 +159,7 @@
static uintptr_t
ranges_include(DebugInfoReader *reader, ranges_t *ptr, uint64_t addr)
{
@@ -1402,8 +1433,50 @@
@@ -1403,8 +1434,50 @@ ranges_include(DebugInfoReader *reader, ranges_t *ptr, uint64_t addr)
}
else if (ptr->ranges_set) {
/* TODO: support base address selection entry */
@ -199,7 +211,7 @@
for (;;) {
uintptr_t from = read_uintptr(&p);
uintptr_t to = read_uintptr(&p);
@@ -1747,6 +1820,7 @@
@@ -1750,6 +1823,7 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
".debug_info",
".debug_line",
".debug_ranges",
@ -207,7 +219,7 @@
".debug_str"
};
@@ -2003,6 +2077,7 @@
@@ -2006,6 +2080,7 @@ found_mach_header:
"__debug_info",
"__debug_line",
"__debug_ranges",

View File

@ -11,7 +11,7 @@ diff --git a/addr2line.c b/addr2line.c
index 8ee4416650d3..fed1a8da84e5 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -1137,12 +1137,12 @@ debug_info_reader_read_value(DebugInfoReader *reader, uint64_t form, DebugInfoVa
@@ -1138,12 +1138,12 @@ debug_info_reader_read_value(DebugInfoReader *reader, uint64_t form, DebugInfoVa
set_uint_value(v, read_uleb128(reader));
break;
case DW_FORM_ref_addr:

View File

@ -15,7 +15,7 @@ diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
index 6095d545b5..9e9b8b9b69 100644
--- a/test/openssl/test_ssl.rb
+++ b/test/openssl/test_ssl.rb
@@ -955,7 +955,9 @@ def test_connect_certificate_verify_failed_exception_message
@@ -964,7 +964,9 @@ def test_connect_certificate_verify_failed_exception_message
start_server(ignore_listener_error: true) { |port|
ctx = OpenSSL::SSL::SSLContext.new
ctx.set_params

View File

@ -227,7 +227,7 @@ diff --git a/test/openssl/utils.rb b/test/openssl/utils.rb
index c1d737b2ab..f664bd3074 100644
--- a/test/openssl/utils.rb
+++ b/test/openssl/utils.rb
@@ -305,32 +305,6 @@ def check_component(base, test, keys)
@@ -313,32 +313,6 @@ def check_component(base, test, keys)
assert_equal base.send(comp), test.send(comp)
}
end

View File

@ -1,6 +1,6 @@
%global major_version 3
%global minor_version 0
%global teeny_version 2
%global teeny_version 3
%global major_minor_version %{major_version}.%{minor_version}
%global ruby_version %{major_minor_version}.%{teeny_version}
@ -22,7 +22,7 @@
%endif
%global release 153
%global release 154
%{!?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.32
%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.32
%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//')*
@ -142,13 +142,11 @@ 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
# Load user installed RubyGems plugins.
# https://github.com/rubygems/rubygems/issues/4823
Patch10: rubygems-3.2.26-Also-load-user-installed-rubygems-plugins.patch
# Fix DWARF5 support.
# https://bugzilla.redhat.com/show_bug.cgi?id=1920533
# https://bugs.ruby-lang.org/issues/17585
Patch15: ruby-dwarf5-avoid_crash-r1.patch
# https://github.com/ruby/ruby/pull/4240
Patch15: ruby-3.1.0-Support-GCCs-DWARF-5.patch
# Fix segfaults with enabled LTO.
# https://bugs.ruby-lang.org/issues/18062
# https://github.com/ruby/ruby/pull/4716
@ -175,18 +173,15 @@ Patch21: ruby-3.1.0-Properly-exclude-test-cases.patch
# OpenSSL 3.0 compatibility patches
# Switch from legacy DES-CBC to AES-256-CBC.
# https://github.com/rubygems/rubygems/pull/4986
Patch30: rubygems-3.2.30-Switch-from-DES-CBC-to-AES-256-CBC.patch
# Revert OpenSSL < 3.x enforcement.
# https://github.com/ruby/openssl/commit/202ff1372a40a8adf9aac74bfe8a39141b0c57e5
Patch30: ruby-3.0.3-ext-openssl-extconf.rb-require-OpenSSL-version-1.0.1.patch
# Fix test broken by wrongly formatted distinguished name submitted to
# `OpenSSL::X509::Name.parse`.
# https://github.com/ruby/openssl/issues/470
# https://github.com/rubygems/rubygems/pull/5030
Patch31: rubygems-3.2.30-Provide-distinguished-name-which-will-be-correctly-p.patch
# Fix TestGemRequest#test_verify_certificate_extra_message compatibility
# with OpenSSL 3.x.
# https://github.com/rubygems/rubygems/pull/5040
Patch32: rubygems-3.2.30-Use-OpenSSL-constants-for-error-codes.patch
# Refactor PEM/DER serialization code.
# https://github.com/ruby/openssl/pull/328
@ -676,7 +671,6 @@ rm -rf ext/fiddle/libffi*
%patch5 -p1
%patch6 -p1
%patch9 -p1
%patch10 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
@ -684,9 +678,8 @@ rm -rf ext/fiddle/libffi*
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch30 -p1
%patch30 -p1 -R
%patch31 -p1
%patch32 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
@ -1243,30 +1236,30 @@ DISABLE_TESTS="$DISABLE_TESTS -n !/OpenSSL::TestCipher#test_ciphers/"
%{_rpmconfigdir}/rubygems.con
%files default-gems
%{gem_dir}/specifications/default/english-0.7.1.gemspec
%{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/english-0.7.1.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
@ -1275,33 +1268,33 @@ DISABLE_TESTS="$DISABLE_TESTS -n !/OpenSSL::TestCipher#test_ciphers/"
%{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
@ -1314,7 +1307,7 @@ DISABLE_TESTS="$DISABLE_TESTS -n !/OpenSSL::TestCipher#test_ciphers/"
%{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
@ -1408,7 +1401,6 @@ DISABLE_TESTS="$DISABLE_TESTS -n !/OpenSSL::TestCipher#test_ciphers/"
%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
@ -1464,6 +1456,9 @@ DISABLE_TESTS="$DISABLE_TESTS -n !/OpenSSL::TestCipher#test_ciphers/"
%changelog
* Thu Nov 25 2021 Vít Ondruch <vondruch@redhat.com> - 3.0.2-154
- Upgrade to Ruby 3.0.3.
* Fri Nov 05 2021 Vít Ondruch <vondruch@redhat.com> - 3.0.2-153
- Fix OpenSSL 3.0 compatibility.
Resolves: rhbz#2021922

View File

@ -1,61 +0,0 @@
From 82960c262fea081cdd3df14ebe573ff1c4925d0c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@riseup.net>
Date: Fri, 6 Aug 2021 12:21:23 +0200
Subject: [PATCH] Also load user installed rubygems plugins
---
lib/rubygems.rb | 4 +++-
test/rubygems/test_gem.rb | 25 +++++++++++++++++++++++++
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index a631cde8bf8..17881e2e0e9 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -1063,7 +1063,9 @@ def self.load_plugin_files(plugins) # :nodoc:
# Find rubygems plugin files in the standard location and load them
def self.load_plugins
- load_plugin_files Gem::Util.glob_files_in_dir("*#{Gem.plugin_suffix_pattern}", plugindir)
+ Gem.path.each do |gem_path|
+ load_plugin_files Gem::Util.glob_files_in_dir("*#{Gem.plugin_suffix_pattern}", plugindir(gem_path))
+ end
end
##
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index 0d4b1571ca7..da154dac75b 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -1581,6 +1581,31 @@ def test_load_plugins
assert_equal %w[plugin], PLUGINS_LOADED
end
+ def test_load_user_installed_plugins
+ plugin_path = File.join "lib", "rubygems_plugin.rb"
+
+ Dir.chdir @tempdir do
+ FileUtils.mkdir_p 'lib'
+ File.open plugin_path, "w" do |fp|
+ fp.puts "class TestGem; PLUGINS_LOADED << 'plugin'; end"
+ end
+
+ foo = util_spec 'foo', '1' do |s|
+ s.files << plugin_path
+ end
+
+ install_gem_user foo
+ end
+
+ Gem.paths = { "GEM_PATH" => [Gem.dir, Gem.user_dir].join(File::PATH_SEPARATOR) }
+
+ gem 'foo'
+
+ Gem.load_plugins
+
+ assert_equal %w[plugin], PLUGINS_LOADED
+ end
+
def test_load_env_plugins
with_plugin('load') { Gem.load_env_plugins }
assert_equal :loaded, TEST_PLUGIN_LOAD rescue nil

View File

@ -30,7 +30,7 @@ diff --git a/lib/rubygems/security.rb b/lib/rubygems/security.rb
index c80639af6d..12de141f36 100644
--- a/lib/rubygems/security.rb
+++ b/lib/rubygems/security.rb
@@ -476,7 +476,7 @@ def self.email_to_name(email_address)
@@ -510,7 +510,7 @@ def self.email_to_name(email_address)
dcs = dcs.split '.'

View File

@ -1,106 +0,0 @@
From 467be1c90bda755710943e9e2a42a42262dde909 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Thu, 14 Oct 2021 09:46:03 +0200
Subject: [PATCH] Switch from DES-CBC to AES-256-CBC.
DES-CBS is considered legacy and disabled in OpenSSL 3.x+ [[1], [2]].
This cause causes Ruby test failures:
~~~
ruby -v: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]
/builddir/build/BUILD/ruby-3.0.2/lib/rubygems/test_case.rb:1542:in `initialize': Neither PUB key nor PRIV key (OpenSSL::PKey::RSAError)
from /builddir/build/BUILD/ruby-3.0.2/lib/rubygems/test_case.rb:1542:in `new'
from /builddir/build/BUILD/ruby-3.0.2/lib/rubygems/test_case.rb:1542:in `load_key'
from /builddir/build/BUILD/ruby-3.0.2/lib/rubygems/test_case.rb:1562:in `<class:TestCase>'
from /builddir/build/BUILD/ruby-3.0.2/lib/rubygems/test_case.rb:105:in `<top (required)>'
from <internal:/builddir/build/BUILD/ruby-3.0.2/lib/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/builddir/build/BUILD/ruby-3.0.2/lib/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /builddir/build/BUILD/ruby-3.0.2/test/rdoc/test_rdoc_rubygems_hook.rb:2:in `<top (required)>'
from <internal:/builddir/build/BUILD/ruby-3.0.2/lib/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/builddir/build/BUILD/ruby-3.0.2/lib/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /builddir/build/BUILD/ruby-3.0.2/tool/lib/test/unit.rb:1049:in `block in non_options'
from /builddir/build/BUILD/ruby-3.0.2/tool/lib/test/unit.rb:1043:in `each'
from /builddir/build/BUILD/ruby-3.0.2/tool/lib/test/unit.rb:1043:in `non_options'
from /builddir/build/BUILD/ruby-3.0.2/tool/lib/test/unit.rb:65:in `process_args'
from /builddir/build/BUILD/ruby-3.0.2/tool/lib/test/unit.rb:143:in `process_args'
from /builddir/build/BUILD/ruby-3.0.2/tool/lib/test/unit.rb:1237:in `process_args'
from /builddir/build/BUILD/ruby-3.0.2/tool/lib/test/unit.rb:1242:in `run'
from /builddir/build/BUILD/ruby-3.0.2/tool/lib/test/unit.rb:1249:in `run'
from /builddir/build/BUILD/ruby-3.0.2/tool/test/runner.rb:23:in `<top (required)>'
from ./test/runner.rb:11:in `require_relative'
from ./test/runner.rb:11:in `<main>'
~~~
Therefore use AES-256-CBC instead. This is essentially revert of
ca228b76b, which was fixing https://github.com/jruby/jruby/issues/919
[1]: https://github.com/openssl/openssl/blob/master/doc/man7/migration_guide.pod#legacy-algorithms
[2]: https://github.com/openssl/openssl/blob/master/doc/man7/OSSL_PROVIDER-legacy.pod
---
test/rubygems/encrypted_private_key.pem | 52 ++++++++++++-------------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/test/rubygems/encrypted_private_key.pem b/test/rubygems/encrypted_private_key.pem
index 868f332b7c..d9667689a6 100644
--- a/test/rubygems/encrypted_private_key.pem
+++ b/test/rubygems/encrypted_private_key.pem
@@ -1,30 +1,30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yeOuFODjBNW4qt0WylSi9bwwy3ZwaZLRqhngz6+tCV
+Jp45Gk881XiVe3aVU0l+4DmJJ9/5vwqjH5Vo/GJqFU6gzB+Zv/0plYeNkuE0Xo2z
+ecdxnGKVPl42q44lvczjDw2KX0ahxQrfrbcl48//zR295u9POzCL97d6zpioI2NR
-----END RSA PRIVATE KEY-----
--
2.32.0

View File

@ -1,75 +0,0 @@
From 8acf8e95dcaebe227f779271b8213c15eceb846f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Mon, 1 Nov 2021 18:40:06 +0100
Subject: [PATCH] Use OpenSSL constants for error codes.
This fixes the following test error testing against OpenSSL 3.x:
~~~
2) Failure:
TestGemRequest#test_verify_certificate_extra_message [/builddir/build/BUILD/ruby-3.0.2/test/rubygems/test_gem_request.rb:358]:
<"ERROR: SSL verification error at depth 0: invalid CA certificate (24)\n" +
"ERROR: Certificate is an invalid CA certificate\n"> expected but was
<"ERROR: SSL verification error at depth 0: invalid CA certificate (79)\n" +
"ERROR: Certificate is an invalid CA certificate\n">.
~~~
Where the root cause is this OpenSSL commit:
https://github.com/openssl/openssl/commit/1e41dadfa7b9f792ed0f4714a3d3d36f070cf30e
It seems that OpenSSL upstream considers the constant value just an
implementation detail and therefore this changes the test case to
follow the suite.
---
test/rubygems/test_gem_request.rb | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/test/rubygems/test_gem_request.rb b/test/rubygems/test_gem_request.rb
index 66477be7bc..47654f6fa4 100644
--- a/test/rubygems/test_gem_request.rb
+++ b/test/rubygems/test_gem_request.rb
@@ -328,30 +328,36 @@ def test_user_agent_revision_missing
def test_verify_certificate
pend if Gem.java_platform?
+
+ error_number = OpenSSL::X509::V_ERR_OUT_OF_MEM
+
store = OpenSSL::X509::Store.new
context = OpenSSL::X509::StoreContext.new store
- context.error = OpenSSL::X509::V_ERR_OUT_OF_MEM
+ context.error = error_number
use_ui @ui do
Gem::Request.verify_certificate context
end
- assert_equal "ERROR: SSL verification error at depth 0: out of memory (17)\n",
+ assert_equal "ERROR: SSL verification error at depth 0: out of memory (#{error_number})\n",
@ui.error
end
def test_verify_certificate_extra_message
pend if Gem.java_platform?
+
+ error_number = OpenSSL::X509::V_ERR_INVALID_CA
+
store = OpenSSL::X509::Store.new
context = OpenSSL::X509::StoreContext.new store
- context.error = OpenSSL::X509::V_ERR_INVALID_CA
+ context.error = error_number
use_ui @ui do
Gem::Request.verify_certificate context
end
expected = <<-ERROR
-ERROR: SSL verification error at depth 0: invalid CA certificate (24)
+ERROR: SSL verification error at depth 0: invalid CA certificate (#{error_number})
ERROR: Certificate is an invalid CA certificate
ERROR
--
2.32.0

View File

@ -1 +1 @@
SHA512 (ruby-3.0.2.tar.xz) = 0f702e2d8ca1342a9d4284dbdd234a3588e057b92566353aa7c21835cf09a3932864b2acf459a976960a1704e9befa562155d36b98b7cda8bd99526e10a374c4
SHA512 (ruby-3.0.3.tar.xz) = bb9ea426278d5a7ac46595296f03b82d43df8b7db41045cdf85611e05e26c703c53f700494cd7cf5d4c27fa953bdc5c144317d7720812db0a6e3b6f4bc4d2e00