Commit Graph

674 Commits

Author SHA1 Message Date
Jarek Prokop
c2026da175 Disable Fiddle test cases making use of FFI closure.
Fiddle::Closure object is making use of FFI closure
from libffi. When such object is created (instantiated) in Ruby,
and then the process forks on an SELinux-enabled system, the memory
will become corrupted. That is usually not a problem until the
The garbage collector sweeps the object and tries to free it, in which case the
Ruby process will fail with signal SIGABRT.

Tests in test/fiddle/test_closure.rb, test/fiddle/test_func.rb,
and test/fiddle/test_function.rb use the `Fiddle::Closure` class
directly and fiddle/test_import.rb use the class indirectly through
`bind_function` method, therefore they are disabled to prevent
introducing the problematic object into the Ruby GC during test suite
execution instead of relying on that fork and subsequent
garbage collection will not happen.

If an FFI closure object is allocated in Ruby
and the `fork` function is used afterward, the memory
pointing to the closure gets corrupted, and if Ruby GC
tries to collect the object in that state, a SIGABRT
error occurs.

The minimal Ruby reproducer for the issue is the following:
~~~
$ cat fiddle_fork.rb
require 'fiddle/closure'
require 'fiddle/struct'

Fiddle::Closure.new(Fiddle::TYPE_VOID, [])

fork { }

GC.start
~~~

We allocate an unused Closure object,
so it is free for the GC to pick up. Before we call `GC.start`
we fork the process as that corrupts the memory.

Running this with ruby-3.1.2-167.fc37.x86_64 on SELinux enabled system:
~~~
$ ruby fiddle_fork.rb
Aborted (core dumped)
~~~

Such issues may appear at random (depending on the use of forking and GC)
in larger applications that use Fiddle::Closure but can be spotted by the
following functions appearing in the coredump backtrace:
~~~
0x00007f6284d3e5b3 in dlfree (mem=<optimized out>) at ../src/dlmalloc.c:4350
0x00007f6284d6d0b1 in dealloc () from /usr/lib64/ruby/fiddle.so
0x00007f6295e432ec in finalize_list () from /lib64/libruby.so.3.1
0x00007f6295e43420 in finalize_deferred.lto_priv () from /lib64/libruby.so.3.1
0x00007f6295e4ff1c in gc_start_internal.lto_priv () from /lib64/libruby.so.3.1
~~~

Possible solutions to prevent Ruby from crashing:
* Do not use Fiddle::Closure.
* Use the Fiddle::Closure object only in isolated subprocess that
  will not fork further.
* Enable static trampolines in libffi as noted in bugzilla comment:
  <https://bugzilla.redhat.com/show_bug.cgi?id=2040380#c9>

See related discussion on
<https://bugzilla.redhat.com/show_bug.cgi?id=2040380>

Ruby upstream ticket:
<https://bugs.ruby-lang.org/issues/18914>

Ruby Fiddle ticket:
<https://github.com/ruby/fiddle/issues/102>
2022-09-02 14:54:35 +02:00
Jun Aruga
3f106c188e Add IRB to ruby-bundled-gems recommends.
Resolves: rhbz#2120562
2022-08-29 15:11:15 +02:00
Jun Aruga
bf921512e2 Make RDoc soft dependnecy in IRB.
Resolves: rhbz#2119964
2022-08-29 15:05:44 +02:00
Jun Aruga
ad7f78b5c8 Fix tests with Europe/Amsterdam pre-1970 time on tzdata version 2022b.
Resolves: rhbz#2120354
2022-08-24 15:58:40 +02:00
Jarek Prokop
f93afdebdd Fix Ruby build failing due to unremovable tmp subdirectory.
RPM 4.18.0-beta1 or later versions remove the build directory
automatically, the build fails on removing temporary directories with
the missing 'w' bit.

RubyGems contain this patch since version 3.3.8.
This was merged to ruby_3_1 branch in upstream ruby, but it is not
included in the v3_1_2 tag, so new Ruby 3.1 release should contain this
change.

Relevant RPM upstream PR: https://github.com/rpm-software-management/rpm/pull/2080
Relevant bug: https://bugzilla.redhat.com/show_bug.cgi?id=2105393
2022-07-25 11:55:57 +02:00
Fedora Release Engineering
e2951e6856 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-23 01:10:40 +00:00
Jarek Prokop
ca94aff023 Define the GC compaction support during run time.
Previous commit changed GC compaction methods to not be implemented
when not supported. However, that commit only does compile time checks,
but there are additional compaction support checks during run time.

This commit changes it so that GC compaction methods aren't defined
also during run time if the platform does not support GC compaction.

The patch is manually backported from following change set:
https://github.com/ruby/ruby/pull/6019
2c19086323

To apply the patch included with this commit,
first apply `ruby-3.2.0-define-unsupported-gc-compaction-methods-as-rb_f_notimplement.patch`
and then apply the `ruby-3.2.0-detect_compaction_support_during_runtime.patch`.

Related upstream issue: https://bugs.ruby-lang.org/issues/18829
2022-06-24 14:09:42 +02:00
Jarek Prokop
b7b5473796 Define compaction methods as rb_f_notimplement on unsupported platforms.
The patch implements the methods as rb_f_notimplement.
To test for compaction users can now use `GC.respond_to?(:compact)`.

The upstream patch relies on the macro `GC_COMPACTION_SUPPORTED`
that is defined when the `__wasi__` is false. The define is defined by
an arch conditional in the specfile, which is not optimal but works in our case.
663833b08f
https://bugs.ruby-lang.org/issues/18829

This also requires regenerating the gc.rbinc and miniprelude.c
since the patch touches gc.rb. This patch is available in
ruby-3.2.0-define-unsupported-gc-compaction-methods_generated-files.patch.

To regenerate the gc.rbinc and miniprelude.c files patch:
~~~
tar -Jxvf ./ruby-3.1.2.tar.xz
git clone https://github.com/ruby/ruby.git
cd ruby && git checkout v3_1_2
patch -p1 < ../ruby-3.2.0-define-unsupported-gc-compaction-methods-as-rb_f_notimplement.patch
./autogen.sh && ./configure
make gc.rbinc miniprelude.c
cd ..
diff -u {ruby-3.1.2,ruby}/gc.rbinc > ruby-3.2.0-define-unsupported-gc-compaction-methods_generated-files.patch
diff -u {ruby-3.1.2,ruby}/miniprelude.c >> ruby-3.2.0-define-unsupported-gc-compaction-methods_generated-files.patch
~~~

Uptream bug: https://bugs.ruby-lang.org/issues/18779
Upstream PR: https://github.com/ruby/ruby/pull/5934
2022-06-14 12:59:25 +02:00
Jun Aruga
2c91b113bb Update a comment about make verbose option, dropping Q= explanation.
According to the <https://bugs.ruby-lang.org/issues/18756>, the `Q=` is not
recommended. The `V=1` is recommended to output for the verbose mode.
The `make V=1` suppresses some logs that `make` without `V=1` outputs rather
than just adding verbose logs.

While the `V=1 ECHO0=echo` is more equivalent with `Q=`, the
`make V=1 ECHO0=echo` doesn't really output meaningful logs additionally.
So, the `make V=1` is the best option for us to check the compiler flags.
2022-05-12 11:50:01 +02:00
Jun Aruga
03e8cec9fe Drop Q= in make options.
Because the `%make_build` macro includes the `V=1`. Note there is no actual
difference of build.log between before and after this commit.

```
$ rpm --eval %make_build
/usr/bin/make -O -j8 V=1 VERBOSE=1
```
2022-04-29 16:01:56 +02:00
Vít Ondruch
c2061af620 Use upstream patch for correct build of gem extensions. 2022-04-14 13:50:23 +02:00
Vít Ondruch
09d0e79c2b Upgrade to Ruby 3.1.2. 2022-04-14 13:50:23 +02:00
Vít Ondruch
22d91a0910 Properly build binary gem extensions.
Because the gem extensions were built in `%{buildroot}` they referred
`BUILDROOT` directory, which would be under normal circumstances
reported by RPM, but there was a bug in RPM due to changes in grep:

https://github.com/rpm-software-management/rpm/issues/1968
2022-04-04 12:30:05 +02:00
Jun Aruga
796a198176 Add Bundler tests.
* Add `make test-bundler-parallel` executed on the upstream CI.
  See <41a48535d1/.github/workflows/ubuntu.yml (L22)>.
* The tests are disabled as a default, as it requires the internet.
  Run the Bundler tests as follows.
  ```
  $ mock --with bundler_tests ruby-3.1.0-161.fc37.src.rpm
  ```
* Fix a test for `bin/bundle update --bundler` in `make test-bundler`.
2022-03-22 19:10:01 +01:00
Jun Aruga
aee17a2180 ruby.rpmlintrc: Add a filter for "E: shared-lib-without-dependency-information".
Add a filter for "E: shared-lib-without-dependency-information" for
rpmlint 1.11 compatibility in Zuul CI.
2022-03-15 23:15:53 +01:00
Jun Aruga
df8cc89df4 ruby.rpmlintrc: Recover the filter to ignore a false positive missing-call-to-chdir-with-chroot error.
The filter was deleted at the b0ce095f6d . But it
is still needed to pass Zuul CI.
2022-03-15 23:15:49 +01:00
Jun Aruga
9e774fba70 ruby.rpmlintrc: Ignore zero-length error for gem.build_complete file.
This error is gone as false positive in rpmlint 2.0+. However the rpmlint
version on Zuul CI running on the Fedora 34 container is still 1.11. After Zuul
CI is upgraded to Fedora 35+ container, and uses the rpmlint 2, we can notice
this filter is not used by "E: unused-rpmlintrc-filter" error, and remove it.
2022-03-15 23:15:44 +01:00
Vít Ondruch
74983bcd56 Upgrade to Ruby 3.1.1. 2022-03-15 13:26:14 +01:00
Jun Aruga
67d5a7b3c6 Revert "Remove colon from load call."
This is for a compatibility of Zuul CI still using RPM 4.16 on F34.

This reverts commit 46ee70614f.
2022-03-14 11:28:52 +01:00
Vít Ondruch
204bab4f7f Prevent segfaults running with SystemTap. 2022-02-10 14:14:12 +01:00
Vít Ondruch
8157cd4820 Revert "Temporary bump rubygem-json release."
This reverts commit 1ff09bed2b.
2022-01-26 15:33:43 +01:00
Vít Ondruch
1ff09bed2b Temporary bump rubygem-json release.
This allow to rebuild independent rubygem-json package, which would have
otherwise higher release and caused issues with build of other packages.
2022-01-26 09:54:45 +01:00
Vít Ondruch
b0ce095f6d Upgrade to Ruby 3.1.0.
For details of the evolution please check `private-ruby-3.1` branch.
2022-01-26 09:54:13 +01:00
Vít Ondruch
a51a61214c Drop Puma workaround.
This is considered as Puma issue which should be addressed in latest
release:

https://github.com/puma/puma/issues/2753
2022-01-25 18:25:09 +01:00
Vít Ondruch
2da7a540e7 Update OpenSSL 3 compatibility patches.
This replaces the parts of the original PR with official patches which
landed in [ruby/openssl](https://github.com/ruby/openssl) repository and
should reflect the state of OpenSSL 3 support in Ruby 3.1.
2022-01-25 18:24:19 +01:00
Vít Ondruch
a0bcb33eaa Disable package notes to prevent rubygem- build breakage.
The embedded linker flags breaks build of rubygem- packages with binary
extension:

~~~
gcc -shared -o nio4r_ext.so bytebuffer.o monitor.o nio4r_ext.o selector.o -L. -L/usr/lib64 -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/.package_note-rubygem-nio4r-2.5.2-6.fc36.x86_64.ld -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/.package_note-ruby-0.15.2-157.fc36.x86_64.ld  -m64  -lruby  -lm   -lc
/usr/bin/ld: cannot open linker script file /builddir/build/BUILD/.package_note-ruby-0.15.2-157.fc36.x86_64.ld: No such file or directory
~~~
2022-01-20 17:27:08 +01:00
Vít Ondruch
a28556f684 Fix segfault in TestArray#test_sample on s390x.
~~~
... snip ...

[ 3104/21226] TestArray#test_sample/builddir/build/BUILD/ruby-3.0.3/test/ruby/test_array.rb:2871: [BUG] Segmentation fault at 0x00000000c04fb000
ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [s390x-linux]
-- Control frame information -----------------------------------------------
c:0031 p:---- s:0176 e:000175 CFUNC  :srand
c:0030 p:0011 s:0171 e:000170 METHOD /builddir/build/BUILD/ruby-3.0.3/test/ruby/test_array.rb:2871
c:0029 p:0052 s:0165 e:000164 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1283
c:0028 p:0065 s:0159 e:000158 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:1330
c:0027 p:0013 s:0150 e:000149 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit/testcase.rb:18
c:0026 p:0077 s:0145 e:000144 BLOCK  /builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:979 [FINISH]
c:0025 p:---- s:0138 e:000137 CFUNC  :map
c:0024 p:0006 s:0134 E:0012c8 BLOCK  /builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:972
c:0023 p:0186 s:0130 E:000ba0 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:999
c:0022 p:0042 s:0118 E:000888 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1136
c:0021 p:0010 s:0111 E:0007a0 BLOCK  /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:627 [FINISH]
c:0020 p:---- s:0105 e:000104 CFUNC  :each
c:0019 p:0054 s:0101 E:001588 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:625
c:0018 p:0008 s:0094 E:001eb8 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:662
c:0017 p:0140 s:0087 E:0011a8 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:908
c:0016 p:0016 s:0074 E:001ca8 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1073
c:0015 p:0005 s:0069 E:000710 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:1147
c:0014 p:0006 s:0065 E:000438 BLOCK  /builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:1134 [FINISH]
c:0013 p:---- s:0061 e:000060 CFUNC  :each
c:0012 p:0047 s:0057 E:0022b8 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:1133
c:0011 p:0013 s:0052 E:000288 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:1121
c:0010 p:0008 s:0047 E:000c70 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:847
c:0009 p:0008 s:0041 E:0008d0 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:695
c:0008 p:0015 s:0035 E:001f08 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:34
c:0007 p:0006 s:0030 E:0003c8 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1175
c:0006 p:0032 s:0025 E:000e80 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1245
c:0005 p:0009 s:0021 E:0018b8 METHOD /builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1249
c:0004 p:0172 s:0016 E:0001b8 TOP    /builddir/build/BUILD/ruby-3.0.3/tool/test/runner.rb:23 [FINISH]
c:0003 p:---- s:0011 e:000010 CFUNC  :require_relative
c:0002 p:0092 s:0006 E:001bf0 EVAL   ./test/runner.rb:11 [FINISH]
c:0001 p:0000 s:0003 E:0004f0 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
./test/runner.rb:11:in `<main>'
./test/runner.rb:11:in `require_relative'
/builddir/build/BUILD/ruby-3.0.3/tool/test/runner.rb:23:in `<top (required)>'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1249:in `run'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1245:in `run'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1175:in `run'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:34:in `run'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:695:in `run'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:847:in `run'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:1121:in `run'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:1133:in `_run'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:1133:in `each'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:1134:in `block in _run'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:1147:in `run_tests'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1073:in `_run_anything'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:908:in `_run_anything'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:662:in `_run_suites'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:625:in `_run_suites'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:625:in `each'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:627:in `block in _run_suites'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1136:in `_run_suite'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:999:in `_run_suite'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:972:in `block in _run_suite'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:972:in `map'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:979:in `block (2 levels) in _run_suite'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit/testcase.rb:18:in `run'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/minitest/unit.rb:1330:in `run'
/builddir/build/BUILD/ruby-3.0.3/tool/lib/test/unit.rb:1283:in `run_test'
/builddir/build/BUILD/ruby-3.0.3/test/ruby/test_array.rb:2871:in `test_sample'
/builddir/build/BUILD/ruby-3.0.3/test/ruby/test_array.rb:2871:in `srand'
-- C level backtrace information -------------------------------------------
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_print_backtrace+0x1c) [0x3ffab964c5c] vm_dump.c:758
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_vm_bugreport.constprop.0+0x4ba) [0x3ffab977f0a] vm_dump.c:998
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_bug_for_fatal_signal+0xb2) [0x3ffab7b2252] error.c:786
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(sigsegv+0x58) [0x3ffab8d2fb8] signal.c:963
[0x3ffabb7e490]
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_free_tmp_buffer+0x4) [0x3ffab7d1114] gc.c:11047
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rand_init+0x122) [0x3ffab896892] random.c:387
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_f_srand+0x6e) [0x3ffab8975fe] random.c:873
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_call_cfunc_with_frame+0x170) [0x3ffab9421f0] vm_insnhelper.c:2931
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_sendish+0x53a) [0x3ffab94659a] vm_insnhelper.c:4532
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_exec_core.lto_priv.0+0xe6) [0x3ffab947d16] insns.def:789
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_vm_exec+0x1ee) [0x3ffab96129e] vm.c:2172
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_yield+0xaa) [0x3ffab951a6a] vm.c:1398
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_ary_collect.lto_priv.0+0x6a) [0x3ffab742d6a] array.c:3635
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_call_cfunc_with_frame+0x170) [0x3ffab9421f0] vm_insnhelper.c:2931
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_sendish+0x53a) [0x3ffab94659a] vm_insnhelper.c:4532
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_exec_core.lto_priv.0+0x21c0) [0x3ffab949df0] insns.def:770
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_vm_exec+0x1ee) [0x3ffab96129e] vm.c:2172
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_yield+0xaa) [0x3ffab951a6a] vm.c:1398
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_ary_each+0x4c) [0x3ffab742aac] array.c:2523
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_call_cfunc_with_frame+0x170) [0x3ffab9421f0] vm_insnhelper.c:2931
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_call_method_each_type+0x530) [0x3ffab942d20] vm_insnhelper.c:3400
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_sendish+0x53a) [0x3ffab94659a] vm_insnhelper.c:4532
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_exec_core.lto_priv.0+0x21c0) [0x3ffab949df0] insns.def:770
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_vm_exec+0x1ee) [0x3ffab96129e] vm.c:2172
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_yield+0xaa) [0x3ffab951a6a] vm.c:1398
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_ary_each+0x4c) [0x3ffab742aac] array.c:2523
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_call_cfunc_with_frame+0x170) [0x3ffab9421f0] vm_insnhelper.c:2931
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_call_method_each_type+0x530) [0x3ffab942d20] vm_insnhelper.c:3400
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_sendish+0x53a) [0x3ffab94659a] vm_insnhelper.c:4532
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_exec_core.lto_priv.0+0x21c0) [0x3ffab949df0] insns.def:770
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_vm_exec+0x1ee) [0x3ffab96129e] vm.c:2172
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(require_internal.lto_priv.0+0xbc6) [0x3ffab809be6] load.c:1109
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_require_string+0x48) [0x3ffab809db8] load.c:1186
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_call_cfunc_with_frame+0x170) [0x3ffab9421f0] vm_insnhelper.c:2931
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_sendish+0x53a) [0x3ffab94659a] vm_insnhelper.c:4532
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(vm_exec_core.lto_priv.0+0xe6) [0x3ffab947d16] insns.def:789
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_vm_exec+0x1ee) [0x3ffab96129e] vm.c:2172
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(rb_ec_exec_node+0x10c) [0x3ffab7b71ac] eval.c:317
/builddir/build/BUILD/ruby-3.0.3/libruby.so.3.0.3(ruby_run_node+0x70) [0x3ffab7b72c0] eval.c:375
[0x2aa26e811f0]
[0x3ffab4b3872]
[0x3ffab4b3950]
[0x2aa26e81250]

... snip ...
~~~
2022-01-20 11:20:01 +01:00
Vít Ondruch
b6d9b2acd1 Disable some Fiddle test by libffi-3.4.2. 2022-01-19 17:08:19 +01:00
Vít Ondruch
46ee70614f Remove colon from load call.
This is not needed by RPM 4.17+ and might improve backwared compatibilty
with RHEL 7, where the original LUA implementation of `load` macro was
used.
2022-01-19 17:07:44 +01:00
Jun Aruga
b24ebf5ec1 Remove the patch applied to pass the test/fiddle/test_import.rb on PPC.
In Ruby 3.0.3, a new logic with the hard-coded "libc.so.6" to detect glibc
works on PPC, both Power 8 and 9.
See <https://bugs.ruby-lang.org/issues/12666#note-13>.

Note the logic also fixes the following error on a Power 9 environment where
the path is `/lib64/glibc-hwcaps/power9/libc-2.28.so`.

```
/builddir/build/BUILD/ruby-2.6.9/.ext/common/fiddle/import.rb:299:in `import_function': cannot find the function: strcpy() (Fiddle::DLError)
    from /builddir/build/BUILD/ruby-2.6.9/.ext/common/fiddle/import.rb:172:in `extern'
    from /builddir/build/BUILD/ruby-2.6.9/test/fiddle/test_import.rb:17:in `<module:LIBC>'
    from /builddir/build/BUILD/ruby-2.6.9/test/fiddle/test_import.rb:10:in `<module:Fiddle>'
    from /builddir/build/BUILD/ruby-2.6.9/test/fiddle/test_import.rb:9:in `<top (required)>'
    from /builddir/build/BUILD/ruby-2.6.9/test/lib/test/unit.rb:958:in `require'
    from /builddir/build/BUILD/ruby-2.6.9/test/lib/test/unit.rb:958:in `block in non_options'
    from /builddir/build/BUILD/ruby-2.6.9/test/lib/test/unit.rb:952:in `each'
    from /builddir/build/BUILD/ruby-2.6.9/test/lib/test/unit.rb:952:in `non_options'
    from /builddir/build/BUILD/ruby-2.6.9/test/lib/test/unit.rb:64:in `process_args'
    from /builddir/build/BUILD/ruby-2.6.9/test/lib/test/unit.rb:130:in `process_args'
    from /builddir/build/BUILD/ruby-2.6.9/test/lib/test/unit.rb:1136:in `process_args'
    from /builddir/build/BUILD/ruby-2.6.9/test/lib/test/unit.rb:1141:in `run'
    from /builddir/build/BUILD/ruby-2.6.9/test/lib/test/unit.rb:1148:in `run'
    from ./test/runner.rb:33:in `<main>'
```
2022-01-11 11:50:01 +01:00
Miro Hrončok
08a1249d7f Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34 2022-01-10 11:55:34 +01:00
Vít Ondruch
5d3688479a Fix loading of default gems.
Resolves: rhbz#2027099
2021-12-10 17:06:26 +01:00
Vít Ondruch
dbe75d1cb5 Fix wrong version in changelog. 2021-12-08 12:10:25 +01:00
Vít Ondruch
d584a5bfb3 Upgrade to Ruby 3.0.3. 2021-11-25 17:46:48 +01:00
Vít Ondruch
c4f8814a93 Fix OpenSSL 3.0 compatibility.
Resolves: rhbz#2021922
2021-11-22 18:21:04 +01:00
Jun Aruga
78a9fbc351 Add AC_PROG_CC to make C++ compiler dependency optional on autoconf >= 2.70.
Resolves: rhbz#1999479
2021-10-04 12:23:30 +02:00
Sahana Prasad
d75a6c86f9 Rebuilt with OpenSSL 3.0.0 2021-09-14 19:13:53 +02:00
Vít Ondruch
11a27766bd Load user installed RubyGems plugins. 2021-08-24 18:23:20 +02:00
Vít Ondruch
1170d812fe Enable LTO. 2021-08-24 17:37:08 +02:00
Fedora Release Engineering
089c0a1928 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 11:43:38 +00:00
Jarek Prokop
63065e7db7 Upgrade to Ruby 3.0.2.
- Fix command injection vulnerability in RDoc.
  Resolves: CVE-2021-31799
- Fix FTP PASV command response can cause Net::FTP to connect to arbitrary host.
  Resolves: CVE-2021-31810
- Fix StartTLS stripping vulnerability in Net::IMAP.
  Resolves: CVE-2021-32066
- Fix dependencies of gems with explicit source installed from a different
  source.
  Resolves: CVE-2020-36327
2021-07-15 14:02:23 +02:00
Timm Bäder
6b2ff68f33 Pass ldflags to gem install
We have them, so we may as well pass them. This also fixes building ruby
gems with clang.
2021-05-31 10:25:26 +00:00
Jun Aruga
e6a3dff909 ruby.rpmlintrc: Remove prefix match.
A result of ruby.spec file depends on how the spec file is called by rpmlint.

```
$ rpmlint ruby.spec
ruby.spec:20: E: use-of-RPM_SOURCE_DIR
..
0 packages and 1 specfiles checked; 3 errors, 4 warnings.

$ rpmlint ./ruby.spec
./ruby.spec:20: E: use-of-RPM_SOURCE_DIR
..
0 packages and 1 specfiles checked; 3 errors, 4 warnings.
```
2021-05-18 15:40:11 +02:00
Jun Aruga
a09dbbec17 ruby.rpmlintrc: Ignore a shared-lib-without-dependency-information error.
Nothing referred and no dependency information should be no problem.

Ignore the following error.

```
ruby-libs.x86_64: E: shared-lib-without-dependency-information /usr/lib64/ruby/enc/gb2312.so
```
2021-05-18 15:40:05 +02:00
Jun Aruga
882d68b75c ruby.rpmlintrc: Ignore a false positive missing-call-to-chdir-with-chroot error.
The `chroot` in the `dir.c` is just used as a Ruby binding `Dir.chroot`
for the function.

Ignore the following error.

```
ruby-libs.x86_64: E: missing-call-to-chdir-with-chroot /usr/lib64/libruby.so.3.0.1
```
2021-05-18 15:40:00 +02:00
Jun Aruga
26bc979446 ruby.rpmlintrc: Ignore the non-executable-script errors in bundled gems.
The bundled gem files permissions are overridden as 644 by `make install`.
Ignore following errors in bundled gems.

```
rubygem-power_assert.noarch: E: non-executable-script /usr/share/gems/gems/power_assert-1.2.0/bin/console 644 /usr/bin/env ruby
rubygem-power_assert.noarch: E: non-executable-script /usr/share/gems/gems/power_assert-1.2.0/bin/setup 644 /usr/bin/env bash
rubygem-rake.noarch: E: non-executable-script /usr/share/gems/gems/rake-13.0.3/bin/bundle 644 /usr/bin/env ruby
rubygem-rake.noarch: E: non-executable-script /usr/share/gems/gems/rake-13.0.3/bin/console 644 /usr/bin/env ruby
rubygem-rake.noarch: E: non-executable-script /usr/share/gems/gems/rake-13.0.3/bin/rake 644 /usr/bin/env ruby
rubygem-rake.noarch: E: non-executable-script /usr/share/gems/gems/rake-13.0.3/bin/rdoc 644 /usr/bin/env ruby
rubygem-rake.noarch: E: non-executable-script /usr/share/gems/gems/rake-13.0.3/bin/rubocop 644 /usr/bin/env ruby
rubygem-rake.noarch: E: non-executable-script /usr/share/gems/gems/rake-13.0.3/bin/setup 644 /usr/bin/env bash
rubygem-rbs.noarch: E: non-executable-script /usr/share/gems/gems/rbs-1.0.4/bin/annotate-with-rdoc 644 /usr/bin/env ruby
rubygem-rbs.noarch: E: non-executable-script /usr/share/gems/gems/rbs-1.0.4/bin/console 644 /usr/bin/env ruby
rubygem-rbs.noarch: E: non-executable-script /usr/share/gems/gems/rbs-1.0.4/bin/query-rdoc 644 /usr/bin/env ruby
rubygem-rbs.noarch: E: non-executable-script /usr/share/gems/gems/rbs-1.0.4/bin/rbs-prof 644 /usr/bin/env ruby
rubygem-rbs.noarch: E: non-executable-script /usr/share/gems/gems/rbs-1.0.4/bin/setup 644 /usr/bin/env bash
rubygem-rbs.noarch: E: non-executable-script /usr/share/gems/gems/rbs-1.0.4/bin/sort 644 /usr/bin/env ruby
rubygem-rbs.noarch: E: non-executable-script /usr/share/gems/gems/rbs-1.0.4/bin/steep 644 /bin/sh
rubygem-rbs.noarch: E: non-executable-script /usr/share/gems/gems/rbs-1.0.4/bin/test_runner.rb 644 /usr/bin/env ruby
rubygem-test-unit.noarch: E: non-executable-script /usr/share/gems/gems/test-unit-3.3.7/test/run-test.rb 644 /usr/bin/env ruby
```
2021-05-18 15:39:53 +02:00
Jun Aruga
fbaee91204 ruby.rpmlintrc: Ignore non executable template files for Bundler.
The template files do not have to have executable bits.
Ignore the following errors.

```
rubygem-bundler.noarch: E: non-executable-script /usr/share/gems/gems/bundler-2.2.15/lib/bundler/templates/Executable 644 /usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
rubygem-bundler.noarch: E: non-executable-script /usr/share/gems/gems/bundler-2.2.15/lib/bundler/templates/Executable.bundler 644 /usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
rubygem-bundler.noarch: E: non-executable-script /usr/share/gems/gems/bundler-2.2.15/lib/bundler/templates/Executable.standalone 644 /usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
rubygem-bundler.noarch: E: non-executable-script /usr/share/gems/gems/bundler-2.2.15/lib/bundler/templates/newgem/bin/console.tt 644 /usr/bin/env ruby
rubygem-bundler.noarch: E: non-executable-script /usr/share/gems/gems/bundler-2.2.15/lib/bundler/templates/newgem/bin/setup.tt 644 /usr/bin/env bash
rubygem-bundler.noarch: E: non-executable-script /usr/share/gems/gems/bundler-2.2.15/lib/bundler/templates/newgem/exe/newgem.tt 644 /usr/bin/env ruby
```
2021-05-18 15:39:38 +02:00
Jun Aruga
1b641ac57f Fix FTBFS due to an incompatible load.
The FTBFS has started to happen with rpm-4.16.90-0.git15395.2.fc35.

root.log

```
DEBUG util.py:444:  error: line 116: Unknown tag: /chroot_tmpdir/srpm_unpacked/SOURCES/macros.ruby
```

As the `%{?load:...}` is undocumented, it is gone.

https://github.com/rpm-software-management/rpm/issues/1669
2021-05-05 14:15:31 +02:00
Vít Ondruch
9e656cf658 Upgrade to Ruby 3.0.1. 2021-04-06 12:57:56 +02:00
Vít Ondruch
fd8c8ee765 Remove IRB dependency from rubygem-rdoc.
The IRB dependency was dropped in RDoc 6.0.0 already, but nobody
noticed:

https://github.com/ruby/rdoc/pull/512
2021-04-01 13:10:34 +02:00