From c4dea86b35e352c3c2e79c148fff2d37e44c640a Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 21 2020 19:24:51 +0000 Subject: import ruby-2.6.3-106.module+el8.1.0+3653+beb38eb0 --- diff --git a/SOURCES/macros.rubygems b/SOURCES/macros.rubygems index 532ea6c..2552780 100644 --- a/SOURCES/macros.rubygems +++ b/SOURCES/macros.rubygems @@ -60,7 +60,7 @@ gem install \\\ # %gemspec_add_dep(g:s:d) \ read -d '' gemspec_add_dep_script << 'EOR' || : \ - gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}.gemspec}' \ + gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}%{?prerelease}.gemspec}' \ \ name = '%{-g*}' \ requirements = %{*}%{!?1:nil} \ @@ -97,7 +97,7 @@ unset -v gemspec_add_dep_script \ # %gemspec_remove_dep(g:s:d) \ read -d '' gemspec_remove_dep_script << 'EOR' || : \ - gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}.gemspec}' \ + gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}%{?prerelease}.gemspec}' \ \ name = '%{-g*}' \ requirements = %{*}%{!?1:nil} \ @@ -144,7 +144,7 @@ unset -v gemspec_remove_dep_script \ # %gemspec_add_file(s:tr) \ read -d '' gemspec_add_file_script << 'EOR' || : \ - gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}.gemspec}' \ + gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}%{?prerelease}.gemspec}' \ \ abort("gemspec_add_file: Use only one '-t' or '-r' at a time.") if "%{?-t}%{?-r}" == "-t-r" \ \ @@ -177,7 +177,7 @@ unset -v gemspec_add_file_script \ # %gemspec_remove_file(s:tr) \ read -d '' gemspec_remove_file_script << 'EOR' || : \ - gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}.gemspec}' \ + gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}%{?prerelease}.gemspec}' \ \ abort("gemspec_remove_file: Use only one '-t' or '-r' at a time.") if "%{?-t}%{?-r}" == "-t-r" \ \ diff --git a/SOURCES/ruby-2.6.3-fiddle-1.0.0-ffi-closure-alloc-default.patch b/SOURCES/ruby-2.6.3-fiddle-1.0.0-ffi-closure-alloc-default.patch new file mode 100644 index 0000000..c54f1e4 --- /dev/null +++ b/SOURCES/ruby-2.6.3-fiddle-1.0.0-ffi-closure-alloc-default.patch @@ -0,0 +1,61 @@ +diff --git a/ext/fiddle/closure.c b/ext/fiddle/closure.c +index 1a80b2b..b997e23 100644 +--- a/ext/fiddle/closure.c ++++ b/ext/fiddle/closure.c +@@ -13,25 +13,11 @@ typedef struct { + ffi_type **argv; + } fiddle_closure; + +-#if defined(USE_FFI_CLOSURE_ALLOC) +-#elif defined(__OpenBSD__) || defined(__APPLE__) || defined(__linux__) +-# define USE_FFI_CLOSURE_ALLOC 0 +-#elif defined(RUBY_LIBFFI_MODVERSION) && RUBY_LIBFFI_MODVERSION < 3000005 && \ +- (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_AMD64)) +-# define USE_FFI_CLOSURE_ALLOC 0 +-#else +-# define USE_FFI_CLOSURE_ALLOC 1 +-#endif +- + static void + dealloc(void * ptr) + { + fiddle_closure * cls = (fiddle_closure *)ptr; +-#if USE_FFI_CLOSURE_ALLOC + ffi_closure_free(cls->pcl); +-#else +- munmap(cls->pcl, sizeof(*cls->pcl)); +-#endif + if (cls->argv) xfree(cls->argv); + xfree(cls); + } +@@ -205,12 +191,7 @@ allocate(VALUE klass) + VALUE i = TypedData_Make_Struct(klass, fiddle_closure, + &closure_data_type, closure); + +-#if USE_FFI_CLOSURE_ALLOC + closure->pcl = ffi_closure_alloc(sizeof(ffi_closure), &closure->code); +-#else +- closure->pcl = mmap(NULL, sizeof(ffi_closure), PROT_READ | PROT_WRITE, +- MAP_ANON | MAP_PRIVATE, -1, 0); +-#endif + + return i; + } +@@ -257,17 +238,8 @@ initialize(int rbargc, VALUE argv[], VALUE self) + if (FFI_OK != result) + rb_raise(rb_eRuntimeError, "error prepping CIF %d", result); + +-#if USE_FFI_CLOSURE_ALLOC + result = ffi_prep_closure_loc(pcl, cif, callback, + (void *)self, cl->code); +-#else +- result = ffi_prep_closure(pcl, cif, callback, (void *)self); +- cl->code = (void *)pcl; +- i = mprotect(pcl, sizeof(*pcl), PROT_READ | PROT_EXEC); +- if (i) { +- rb_sys_fail("mprotect"); +- } +-#endif + + if (FFI_OK != result) + rb_raise(rb_eRuntimeError, "error prepping closure %d", result); diff --git a/SOURCES/ruby-2.7.0-preview1-IO.select-on-all-platforms-to-wait-for-input-with-recvfr.patch b/SOURCES/ruby-2.7.0-preview1-IO.select-on-all-platforms-to-wait-for-input-with-recvfr.patch new file mode 100644 index 0000000..f5d01ce --- /dev/null +++ b/SOURCES/ruby-2.7.0-preview1-IO.select-on-all-platforms-to-wait-for-input-with-recvfr.patch @@ -0,0 +1,131 @@ +From 920b924e5652884064a9529ffbd80d458a46fbc6 Mon Sep 17 00:00:00 2001 +From: eregon +Date: Tue, 5 Feb 2019 09:58:50 +0000 +Subject: [PATCH] Make sure to wait with IO.select before using + Socket#recvfrom_nonblock + +* On all platforms, as this is the recommended code pattern. + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + spec/ruby/library/socket/socket/recvfrom_nonblock_spec.rb | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/spec/ruby/library/socket/socket/recvfrom_nonblock_spec.rb b/spec/ruby/library/socket/socket/recvfrom_nonblock_spec.rb +index c1239ae637e0..74fd286c42ad 100644 +--- a/spec/ruby/library/socket/socket/recvfrom_nonblock_spec.rb ++++ b/spec/ruby/library/socket/socket/recvfrom_nonblock_spec.rb +@@ -36,12 +36,11 @@ + describe 'with data available' do + before do + @client.write('hello') +- +- platform_is(:darwin, :freebsd) { IO.select([@server]) } + end + + platform_is_not :windows do + it 'returns an Array containing the data and an Addrinfo' do ++ IO.select([@server]) + ret = @server.recvfrom_nonblock(1) + + ret.should be_an_instance_of(Array) +@@ -54,8 +53,7 @@ + 5.times do + @client.write('hello') + +- platform_is(:darwin, :freebsd) { IO.select([@server]) } +- ++ IO.select([@server]) + msg, _ = @server.recvfrom_nonblock(5) + + msg.should == 'hello' +@@ -66,6 +64,7 @@ + platform_is_not :windows do + describe 'the returned Array' do + before do ++ IO.select([@server]) + @array = @server.recvfrom_nonblock(1) + end + +@@ -80,6 +79,7 @@ + + describe 'the returned Addrinfo' do + before do ++ IO.select([@server]) + @addr = @server.recvfrom_nonblock(1)[1] + end + +From c1f0daeb6ac5c5414c9a4a58bb778a118006ae1f Mon Sep 17 00:00:00 2001 +From: eregon +Date: Tue, 5 Feb 2019 10:19:29 +0000 +Subject: [PATCH] Make sure to wait with IO.select before using + Socket#accept_nonblock and recvfrom_nonblock + +* On all platforms, as this is the recommended code pattern. + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + spec/ruby/library/socket/socket/accept_nonblock_spec.rb | 4 ++-- + spec/ruby/library/socket/udpsocket/recvfrom_nonblock_spec.rb | 5 +++-- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/spec/ruby/library/socket/socket/accept_nonblock_spec.rb b/spec/ruby/library/socket/socket/accept_nonblock_spec.rb +index 3ef219ed05a9..cde9e6a4b669 100644 +--- a/spec/ruby/library/socket/socket/accept_nonblock_spec.rb ++++ b/spec/ruby/library/socket/socket/accept_nonblock_spec.rb +@@ -86,8 +86,6 @@ + @client = Socket.new(family, :STREAM, 0) + + @client.connect(addr) +- +- platform_is(:darwin, :freebsd, :solaris) { IO.select([@server]) } + end + + after do +@@ -96,6 +94,7 @@ + end + + it 'returns an Array containing a Socket and an Addrinfo' do ++ IO.select([@server]) + @socket, addrinfo = @server.accept_nonblock + + @socket.should be_an_instance_of(Socket) +@@ -104,6 +103,7 @@ + + describe 'the returned Addrinfo' do + before do ++ IO.select([@server]) + @socket, @addr = @server.accept_nonblock + end + +diff --git a/spec/ruby/library/socket/udpsocket/recvfrom_nonblock_spec.rb b/spec/ruby/library/socket/udpsocket/recvfrom_nonblock_spec.rb +index 015109a05200..62bbaf0dc93a 100644 +--- a/spec/ruby/library/socket/udpsocket/recvfrom_nonblock_spec.rb ++++ b/spec/ruby/library/socket/udpsocket/recvfrom_nonblock_spec.rb +@@ -40,16 +40,16 @@ + describe 'with data available' do + before do + @client.write('hello') +- +- platform_is(:darwin, :freebsd) { IO.select([@server]) } + end + + it 'returns an Array containing the data and an Array' do ++ IO.select([@server]) + @server.recvfrom_nonblock(1).should be_an_instance_of(Array) + end + + describe 'the returned Array' do + before do ++ IO.select([@server]) + @array = @server.recvfrom_nonblock(1) + end + +@@ -64,6 +64,7 @@ + + describe 'the returned address Array' do + before do ++ IO.select([@server]) + @addr = @server.recvfrom_nonblock(1)[1] + end + diff --git a/SPECS/ruby.spec b/SPECS/ruby.spec index 9f255b3..e09834e 100644 --- a/SPECS/ruby.spec +++ b/SPECS/ruby.spec @@ -21,7 +21,7 @@ %endif -%global release 105 +%global release 106 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} # The RubyGems library has to stay out of Ruby directory tree, since the @@ -154,6 +154,18 @@ Patch22: ruby-2.6.0-config-support-include-directive.patch # https://github.com/ruby/openssl/pull/217 Patch23: ruby-2.6.0-use-larger-keys-for-SSL-tests.patch +# IO.select on all platforms to wait for input with recvfrom_nonblock +# and accept_nonblock +# https://bugzilla.redhat.com/show_bug.cgi?id=1719743 +# https://github.com/ruby/ruby/commit/920b924e5652884064a9529ffbd80d458a46fbc6 +# https://github.com/ruby/ruby/commit/c1f0daeb6ac5c5414c9a4a58bb778a118006ae1f +Patch24: ruby-2.7.0-preview1-IO.select-on-all-platforms-to-wait-for-input-with-recvfr.patch +# Use ffi_closure_alloc to avoid segmentation fault by libffi on aarch64. +# https://bugzilla.redhat.com/show_bug.cgi?id=1727832 +# https://bugzilla.redhat.com/show_bug.cgi?id=1721569 +# https://github.com/ruby/fiddle/pull/20 +Patch25: ruby-2.6.3-fiddle-1.0.0-ffi-closure-alloc-default.patch + Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick Recommends: ruby(rubygems) >= %{rubygems_version} @@ -546,6 +558,8 @@ rm -rf ext/fiddle/libffi* %patch12 -p1 %patch22 -p1 %patch23 -p1 +%patch24 -p1 +%patch25 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -558,17 +572,6 @@ cp -a %{SOURCE6} . %build autoconf -# Overide CFLAGS to avoid below error on aarch64, -# removing "-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" option. -# rpm 4.14.2 is used on rhel-8.1.0. -# https://src.osci.redhat.com/rpms/rpm/blob/rhel-8.1.0/f/rpm.spec#_31 -# https://github.com/rpm-software-management/rpm/blob/rpm-4.14.2-release/macros.in#L1008 -# gcc failed with "annobin: conftest.c: ICE: Should be 64-bit target" -# https://bugzilla.redhat.com/show_bug.cgi?id=1720179 -%ifarch aarch64 -%define optflags -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -%endif - %configure \ --with-rubylibprefix='%{ruby_libdir}' \ --with-archlibdir='%{_libdir}' \ @@ -848,13 +851,6 @@ DISABLE_TESTS="$DISABLE_TESTS -n !/test_segv_\(setproctitle\|test\|loaded_featur # https://bugs.ruby-lang.org/issues/14175 sed -i '/def test_mdns_each_address$/,/^ end$/ s/^/#/' test/resolv/test_mdns.rb -# Skip random failed UDPSocket#recvfrom_nonblock tests -# https://bugzilla.redhat.com/show_bug.cgi?id=1719743 -sed -i "/^ describe 'with data available' do$/,/^ end$/ s/^/#/" \ - spec/ruby/library/socket/udpsocket/recvfrom_nonblock_spec.rb -sed -i "/^ describe 'with data available' do$/,/^ end$/ s/^/#/" \ - spec/ruby/library/socket/socket/recvfrom_nonblock_spec.rb - # RHEL8 is using stronger crypto policies then Fedora ATM and upstream does # not support them yet. Disable the RHEL8 configuration for the moment. # https://github.com/ruby/openssl/issues/215 @@ -1204,6 +1200,12 @@ OPENSSL_SYSTEM_CIPHERS_OVERRIDE=xyz_nonexistent_file OPENSSL_CONF='' \ %{_mandir}/man5/gemfile.5* %changelog +* Thu Jul 04 2019 Jun Aruga - 2.6.3-106 +- Use ffi_closure_alloc to avoid segmentation fault by libffi on aarch64. + Resolves: rhbz#1727832 +- Properly support %%prerelease in %%gemspec_ macros. + Related: rhbz#1672575 + * Tue Jun 11 2019 Jun Aruga - 2.6.3-105 - Update to Ruby 2.6.3 by merging Fedora master branch (commit: 1cc2a49) * Properly generate "ruby(rubygems)" versioned dependencies.