Upgrade to Ruby 3.3.0 (a7ad9f3836).

This commit is contained in:
Vít Ondruch 2023-12-13 16:06:37 +01:00
commit 3b14779a1f
2 changed files with 84 additions and 95 deletions

View file

@ -1,71 +0,0 @@
From 3583079b8a746256d762c69fd8f58f30ce314276 Mon Sep 17 00:00:00 2001
From: KJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>
Date: Sat, 9 Dec 2023 12:30:39 +1100
Subject: [PATCH] Partially revert "Set AI_ADDRCONFIG when making
getaddrinfo(3) calls"
This _partially_ reverts commit
d2ba8ea54a4089959afdeecdd963e3c4ff391748, but for UDP sockets only.
With TCP sockets (and other things which use `rsock_init_inetsock`), the
order of operations is to call `getaddrinfo(3)` with AF_UNSPEC, look at
the returned addresses, pick one, and then call `socket(2)` with the
family for that address (i.e. AF_INET or AF_INET6).
With UDP sockets, however, this is reversed; `UDPSocket.new` takes an
address family as an argument, and then calls `socket(2)` with that
family. A subsequent call to UDPSocket#connect will then call
`getaddrinfo(3)` with that family.
The problem here is that...
* If you are in a networking situation that _only_ has loopback addrs,
* And you want to look up a name like "localhost" (or NULL)
* And you pass AF_INET or AF_INET6 as the ai_family argument to
getaddrinfo(3),
* And you pass AI_ADDRCONFIG to the hints argument as well,
then glibc on Linux will not return an address. This is because
AI_ADDRCONFIG is supposed to return addresses for families we actually
have an address for and could conceivably connect to, but also is
documented to explicitly ignore localhost in that situation.
It honestly doesn't make a ton of sense to pass AI_ADDRCONFIG if you're
explicitly passing the address family anyway, because you're not looking
for "an address for this name we can connect to"; you're looking for "an
IPv(4|6) address for this name". And the original glibc bug that
d2ba8ea5 was supposed to work around was related to parallel issuance of
A and AAAA queries, which of course won't happen if an address family is
explicitly specified.
So, we fix this by not passing AI_ADDRCONFIG for calls to
`rsock_addrinfo` that we also pass an explicit family to (i.e. for
UDPsocket).
[Bug #20048]
---
ext/socket/udpsocket.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/ext/socket/udpsocket.c b/ext/socket/udpsocket.c
index cf3eb6ab9a69f..5224e48a96a1f 100644
--- a/ext/socket/udpsocket.c
+++ b/ext/socket/udpsocket.c
@@ -88,16 +88,9 @@ udp_connect(VALUE sock, VALUE host, VALUE port)
{
struct udp_arg arg;
VALUE ret;
- int addrinfo_hints = 0;
GetOpenFile(sock, arg.fptr);
-
-#ifdef HAVE_CONST_AI_ADDRCONFIG
- addrinfo_hints |= AI_ADDRCONFIG;
-#endif
-
- arg.res = rsock_addrinfo(host, port, rsock_fd_family(arg.fptr->fd), SOCK_DGRAM,
- addrinfo_hints);
+ arg.res = rsock_addrinfo(host, port, rsock_fd_family(arg.fptr->fd), SOCK_DGRAM, 0);
ret = rb_ensure(udp_connect_internal, (VALUE)&arg,
rsock_freeaddrinfo, (VALUE)arg.res);
if (!ret) rsock_sys_fail_host_port("connect(2)", host, port);

108
ruby.spec
View file

@ -10,7 +10,7 @@
#%%global milestone rc1
# Keep the revision enabled for pre-releases from GIT.
%global revision 1ab91b12fa
%global revision a7ad9f3836
%global ruby_archive %{name}-%{ruby_version}
@ -29,15 +29,19 @@
# Bundled libraries versions
%global rubygems_version 3.5.0.dev
%global rubygems_molinillo_version 0.8.0
%global rubygems_net_http_version 0.4.0
%global rubygems_net_protocol_version 0.2.2
%global rubygems_optparse_version 0.3.0
%global rubygems_resolv_version 0.2.2
%global rubygems_timeout_version 0.4.1
%global rubygems_tsort_version 0.1.0
# Default gems.
%global bundler_version 2.5.0.dev
%global bundler_connection_pool_version 2.3.0
%global bundler_fileutils_version 1.7.0
%global bundler_pub_grub_version 0.5.0
%global bundler_net_http_persistent_version 4.0.2
%global bundler_pub_grub_version 0.5.0
%global bundler_thor_version 1.3.0
%global bundler_tsort_version 0.1.1
%global bundler_uri_version 0.12.2
@ -55,15 +59,15 @@
%global english_version 0.8.0
%global erb_version 4.0.3
%global error_highlight_version 0.6.0
%global etc_version 1.4.3.dev.1
%global etc_version 1.4.3
%global fcntl_version 1.1.0
%global fiddle_version 1.1.2
%global fileutils_version 1.7.2
%global find_version 0.2.0
%global forwardable_version 1.3.3
%global getoptlong_version 0.2.1
%global io_nonblock_version 0.2.0
%global io_wait_version 0.3.0
%global io_nonblock_version 0.3.0
%global io_wait_version 0.3.1
%global ipaddr_version 1.2.5
%global logger_version 1.6.0
%global mutex_m_version 0.2.0
@ -82,7 +86,7 @@
%global pstore_version 0.1.3
%global readline_version 0.0.3
%global reline_version 0.4.0
%global resolv_version 0.2.2
%global resolv_version 0.3.0
%global resolv_replace_version 0.1.1
%global rinda_version 0.2.0
%global ruby2_keywords_version 0.0.5
@ -109,7 +113,7 @@
# Gemified default gems.
%global bigdecimal_version 3.1.5
%global io_console_version 0.6.1.dev.1
%global io_console_version 0.7.0
%global irb_version 1.10.1
%global json_version 2.7.1
%global psych_version 5.1.1.1
@ -123,7 +127,7 @@
%global rexml_version 3.2.6
%global rss_version 0.3.0
%global net_ftp_version 0.3.0
%global net_imap_version 0.4.7
%global net_imap_version 0.4.8
%global net_pop_version 0.1.2
%global net_smtp_version 0.4.0
%global matrix_version 0.4.2
@ -228,9 +232,6 @@ Patch6: ruby-2.7.0-Initialize-ABRT-hook.patch
# Disable syntax_suggest test suite, which tries to download its dependencies.
# https://bugs.ruby-lang.org/issues/19297
Patch9: ruby-3.3.0-Disable-syntax-suggest-test-case.patch
# Fix `UDPSocket#remote_address` spec errors, running without network connection.
# https://github.com/ruby/ruby/pull/9177
Patch10: ruby-3.3.0-Partially-revert-Set-AI-ADDRCONFIG-when-making.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%{?with_rubypick:Suggests: rubypick}
@ -330,8 +331,13 @@ This package includes the libruby, necessary to run Ruby.
%package -n rubygems
Summary: The Ruby standard for packaging ruby libraries
Version: %{rubygems_version}
# BSD-2-Clause: lib/rubygems/tsort/
# BSD-2-Clause OR Ruby: lib/rubygems/optparse/
# BSD-2-Clause OR Ruby:
# lib/rubygems/net-http/
# lib/rubygems/net-protocol/
# lib/rubygems/optparse/
# lib/rubygems/resolv/
# lib/rubygems/timeout/
# lib/rubygems/tsort/
# MIT: lib/rubygems/resolver/molinillo
License: (Ruby OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Ruby) AND MIT
Requires: ruby(release)
@ -343,8 +349,13 @@ Provides: gem = %{version}-%{release}
Provides: ruby(rubygems) = %{version}-%{release}
# https://github.com/rubygems/rubygems/pull/1189#issuecomment-121600910
Provides: bundled(rubygem-molinillo) = %{rubygems_molinillo_version}
Provides: bundled(rubygem-net-http) = %{rubygems_net_http_version}
Provides: bundled(rubygem-net-protocol) = %{rubygems_net_protocol_version}
Provides: bundled(rubygem-optparse) = %{rubygems_optparse_version}
Provides: bundled(rubygem-resolv) = %{rubygems_resolv_version}
Provides: bundled(rubygem-timeout) = %{rubygems_timeout_version}
Provides: bundled(rubygem-tsort) = %{rubygems_tsort_version}
BuildArch: noarch
%description -n rubygems
@ -490,13 +501,23 @@ serialize and de-serialize most Ruby objects to and from the YAML format.
%package -n rubygem-bundler
Summary: Library and utilities to manage a Ruby application's gem dependencies
Version: %{bundler_version}
License: MIT
# BSD-2-Clause OR Ruby:
# lib/bundler/vendor/fileutils
# lib/bundler/vendor/tsort
# lib/bundler/vendor/uri
# MIT:
# lib/bundler/vendor/connection_pool
# lib/bundler/vendor/net-http-persistent
# lib/bundler/vendor/pub_brub
# lib/bundler/vendor/thor
# lib/rubygems/resolver/molinillo
License: MIT AND (Ruby OR BSD-2-Clause)
Requires: rubygem(io-console)
# https://github.com/bundler/bundler/issues/3647
Provides: bundled(rubygem-connection_pool) = %{bundler_connection_pool_version}
Provides: bundled(rubygem-fileutils) = %{bundler_fileutils_version}
Provides: bundled(rubygem-pub_grub) = %{bundler_pub_grub_version}
Provides: bundled(rubygem-net-http-persistent) = %{bundler_net_http_persistent_version}
Provides: bundled(rubygem-pub_grub) = %{bundler_pub_grub_version}
Provides: bundled(rubygem-thor) = %{bundler_thor_version}
Provides: bundled(rubygem-uri) = %{bundler_uri_version}
BuildArch: noarch
@ -654,7 +675,6 @@ analysis result in RBS format, a standard type description format for Ruby
%patch 4 -p1
%patch 6 -p1
%patch 9 -p1
%patch 10 -p1
# Provide an example of usage of the tapset:
cp -a %{SOURCE3} .
@ -875,6 +895,24 @@ make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
exit 1 if Gem::Resolver::Molinillo::VERSION != '%{rubygems_molinillo_version}'; \
\""
# Net::HTTP.
make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
module Gem; module Net; end; end; \
require 'rubygems/net-http/lib/net/http'; \
puts '%%{rubygems_net_http_version}: %{rubygems_net_http_version}'; \
puts %Q[Gem::Net::HTTP::VERSION: #{Gem::Net::HTTP::VERSION}]; \
exit 1 if Gem::Net::HTTP::VERSION != '%{rubygems_net_http_version}'; \
\""
# Net::Protocol.
make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
module Gem; module Net; end; end; \
require 'rubygems/net-protocol/lib/net/protocol'; \
puts '%%{rubygems_net_protocol_version}: %{rubygems_net_protocol_version}'; \
puts %Q[Gem::Net::Protocol::VERSION: #{Gem::Net::Protocol::VERSION}]; \
exit 1 if Gem::Net::Protocol::VERSION != '%{rubygems_net_protocol_version}'; \
\""
# OptParse.
make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
module Gem; end; \
@ -884,8 +922,29 @@ make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
exit 1 if Gem::OptionParser::Version != '%{rubygems_optparse_version}'; \
\""
# Resolv.
# TODO: The version is not available in Resolv 2.2.0 yet:
# https://github.com/ruby/resolv/commit/6ab2385e89ba0462c5d7f12a88a6d8f372cdbc60
make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
module Gem; end; \
require 'rubygems/resolv/lib/resolv'; \
# puts '%%{rubygems_resolv_version}: %{rubygems_resolv_version}'; \
# puts %Q[Gem::Resolv::VERSION: #{Gem::Resolv::VERSION}]; \
# exit 1 if Gem::Resolve::VERSION != '%{rubygems_resolv_version}'; \
\""
# Timeout.
make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
module Gem; end; \
require 'rubygems/timeout/lib/timeout'; \
puts '%%{rubygems_timeout_version}: %{rubygems_timeout_version}'; \
puts %Q[Gem::Timeout::VERSION: #{Gem::Timeout::VERSION}]; \
exit 1 if Gem::Timeout::VERSION != '%{rubygems_timeout_version}'; \
\""
# tsort
# TODO: Provide some real version test if version is available.
# TODO: Provide some real version test if version is available:
# https://github.com/ruby/tsort/commit/09f22759580d25aee3962e46966ebd908d618c80
make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
module Gem; end;\
require 'rubygems/tsort/lib/tsort'\""
@ -924,12 +983,12 @@ make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
# constant Gem (NameError) issue.
# https://github.com/rubygems/rubygems/issues/5119
make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
module Bundler; module Persistent; module Net; module HTTP; \
end; end; end; end; \
module Gem; end; \
module Bundler; end; \
require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'; \
puts '%%{bundler_net_http_persistent_version}: %{bundler_net_http_persistent_version}'; \
puts %Q[Bundler::Persistent::Net::HTTP::Persistent::VERSION: #{Bundler::Persistent::Net::HTTP::Persistent::VERSION}]; \
exit 1 if Bundler::Persistent::Net::HTTP::Persistent::VERSION != '%{bundler_net_http_persistent_version}'; \
puts %Q[Gem::Net::HTTP::Persistent::VERSION: #{Gem::Net::HTTP::Persistent::VERSION}]; \
exit 1 if Gem::Net::HTTP::Persistent::VERSION != '%{bundler_net_http_persistent_version}'; \
\""
# Thor.
@ -942,7 +1001,8 @@ make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
\""
# tsort
# TODO: Provide some real version test if version is available.
# TODO: Provide some real version test if version is available:
# https://github.com/ruby/tsort/commit/09f22759580d25aee3962e46966ebd908d618c80
#%%{global bundler_tsort_version}
make -C %{_vpath_builddir} -s runruby TESTRUN_SCRIPT="-e \" \
module Bundler; end; \
@ -1552,8 +1612,8 @@ make -C %{_vpath_builddir} runruby TESTRUN_SCRIPT=" \
%changelog
* Mon Dec 11 2023 Vít Ondruch <vondruch@redhat.com> - 3.3.0-184
- Upgrade to Ruby 3.3.0 (1ab91b12fa).
* Wed Dec 13 2023 Vít Ondruch <vondruch@redhat.com> - 3.3.0-184
- Upgrade to Ruby 3.3.0 (a7ad9f3836).
* Thu Nov 09 2023 Jun Aruga <jaruga@redhat.com> - 3.2.2-183
- ssl: use ffdhe2048 from RFC 7919 as the default DH group parameters