Commit Graph

686 Commits

Author SHA1 Message Date
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
Jun Aruga
4108f57be7 Ignore the rpmlint "W: unversioned-explicit-provides".
Ignore the following warnings for bundled ccan-* libraries.

```
ruby.spec:231: W: unversioned-explicit-provides bundled(ccan-build_assert)
ruby.spec:232: W: unversioned-explicit-provides bundled(ccan-check_type)
ruby.spec:233: W: unversioned-explicit-provides bundled(ccan-container_of)
ruby.spec:234: W: unversioned-explicit-provides bundled(ccan-list)
ruby.src:231: W: unversioned-explicit-provides bundled(ccan-build_assert)
ruby.src:232: W: unversioned-explicit-provides bundled(ccan-check_type)
ruby.src:233: W: unversioned-explicit-provides bundled(ccan-container_of)
ruby.src:234: W: unversioned-explicit-provides bundled(ccan-list)
```
2021-03-24 14:33:39 +01:00
Jun Aruga
b65d1d3090 Ignore the rpmlint "E: use-of-RPM_SOURCE_DIR".
Ignore the following errors.

```
ruby.spec:20: E: use-of-RPM_SOURCE_DIR
ruby.src:20: E: use-of-RPM_SOURCE_DIR
```
2021-03-24 14:33:24 +01:00
Jun Aruga
303495d1bf Add ruby.rpmlintrc.
Ignore the false positive errors and warnings by the
`rpmlint --file ruby.rpmlintrc`, that is executed by Zuul CI.

You can run the command on your local like this.

```
$ rpmlint --file ruby.rpmlintrc ruby.spec /var/lib/mock/fedora-rawhide-x86_64/result/*.rpm
```

The `rpmlint` without `--file` option shows the original result.
2021-03-24 14:19:53 +01:00
Vít Ondruch
dae90ef93d Summary should not end with . 2021-03-22 10:10:27 +01:00
Vít Ondruch
cb0039f53c Remove excesive space. 2021-03-05 14:06:28 +01:00
Vít Ondruch
9b149e59e4 Properly support DWARF5 debug information.
Resolves: rhbz#1920533
2021-03-03 11:26:27 +01:00
Vít Ondruch
2bc8b3d5d5 Apply patch fixing flaky excon test suite. 2021-03-02 11:05:16 +01:00
Vít Ondruch
3210f66fb1 Avoid ruby-spec to be stuck in "C-API Kernel function rb_rescue2". 2021-02-16 10:00:33 +01:00
Vít Ondruch
35f28c9a68 Use proper path for plugin wrappers. 2021-01-27 14:03:19 +01:00
Vít Ondruch
b7229da165 Disable test which started to fail presumably after move to DWARF5
https://bugzilla.redhat.com/show_bug.cgi?id=1920533

Unfortunately, these used to be problematic already before:
https://bugs.ruby-lang.org/issues/13758
2021-01-27 14:03:19 +01:00
Vít Ondruch
b3e2d7fc60 Add missing rubygem- prefix for bundled provide.
The `bundled()` provide name must corresponded with package name. This
was omited due to mistake probably.
2021-01-26 12:32:40 +01:00
Vít Ondruch
c7513cd67c Bundle OpenSSL into StdLib.
Symlinks to StdLib provided to preserve `--disable-gems` functionality
together with `require_relative` cause double loading issues [1], e.g.:

~~~
$ ruby --disable-gems -e 'require "openssl"; require "openssl/digest"'
/usr/share/ruby/openssl/digest.rb:45: warning: already initialized constant OpenSSL::Digest::MD4
/usr/share/gems/gems/openssl-2.2.0/lib/openssl/digest.rb:45: warning: previous definition of MD4 was here
/usr/share/ruby/openssl/digest.rb:45: warning: already initialized constant OpenSSL::Digest::MD5
/usr/share/gems/gems/openssl-2.2.0/lib/openssl/digest.rb:45: warning: previous definition of MD5 was here
/usr/share/ruby/openssl/digest.rb:45: warning: already initialized constant OpenSSL::Digest::RIPEMD160
/usr/share/gems/gems/openssl-2.2.0/lib/openssl/digest.rb:45: warning: previous definition of RIPEMD160 was here
/usr/share/ruby/openssl/digest.rb:45: warning: already initialized constant OpenSSL::Digest::SHA1
/usr/share/gems/gems/openssl-2.2.0/lib/openssl/digest.rb:45: warning: previous definition of SHA1 was here
/usr/share/ruby/openssl/digest.rb:45: warning: already initialized constant OpenSSL::Digest::SHA224
/usr/share/gems/gems/openssl-2.2.0/lib/openssl/digest.rb:45: warning: previous definition of SHA224 was here
/usr/share/ruby/openssl/digest.rb:45: warning: already initialized constant OpenSSL::Digest::SHA256
/usr/share/gems/gems/openssl-2.2.0/lib/openssl/digest.rb:45: warning: previous definition of SHA256 was here
/usr/share/ruby/openssl/digest.rb:45: warning: already initialized constant OpenSSL::Digest::SHA384
/usr/share/gems/gems/openssl-2.2.0/lib/openssl/digest.rb:45: warning: previous definition of SHA384 was here
/usr/share/ruby/openssl/digest.rb:45: warning: already initialized constant OpenSSL::Digest::SHA512
/usr/share/gems/gems/openssl-2.2.0/lib/openssl/digest.rb:45: warning: previous definition of SHA512 was here
/usr/share/ruby/openssl/digest.rb:52:in `<class:Digest>': superclass mismatch for class Digest (TypeError)
	from /usr/share/ruby/openssl/digest.rb:16:in `<module:OpenSSL>'
	from /usr/share/ruby/openssl/digest.rb:15:in `<top (required)>'
	from -e:1:in `require'
	from -e:1:in `<main>'
~~~

We could maintain a downstream patch reverting the `require_relative`,
but given that how much troubles the extracted gems cause, it'll be
better to keep them bundled. This will provide similar experience to
upstream and prevent similar issues.

[1]: https://bugs.ruby-lang.org/issues/16978#note-11
2021-01-26 11:57:47 +01:00
Jun Aruga
cdeff9e00a Refactor small issues. 2021-01-18 19:03:49 +01:00
Vít Ondruch
1e72602218 Fix SEGFAULT in rubygem-shoulda-matchers test suite. 2021-01-16 11:44:56 +01:00
Vít Ondruch
0256efd992 Provide gem.build_complete file for binary gems.
When the `gem.build_complete` file is not present, Bundler treats the
package as uninstalled, therefore leaves it out from the dependency
resolution with error such as:

~~~
Could not find gem 'openssl', which is required by gem 'net-ssh', in any of the sources.
~~~

[1] 1969e8adfc/bundler/lib/bundler/source/rubygems.rb (L353-L384)
2021-01-12 18:20:07 +01:00
Vít Ondruch
64975231d1 Re-enable test suite.
It was disabled by mistake in fcc584306b
when I was trying to come up with fix for armv7hl.
2021-01-11 10:19:35 +01:00
Vít Ondruch
f63d6e5cd4 Remove time from changelog
It makes some tools to complain about changelog ordering.
2021-01-11 09:27:24 +01:00
Vít Ondruch
0e7ccf2b47 ruby-default-gems have to depend on rubygem(io-console) due to reline.
This fixes IRB failures:

~~~
$ irb
/usr/share/rubygems/rubygems/specification.rb:1398:in `rescue in block in activate_dependencies': Could not find 'io-console' (~> 0.5) among 76 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/builddir/.local/share/gem/ruby:/usr/share/gems:/usr/local/share/gems' at: /usr/share/gems/specifications/reline-0.2.0.gemspec, execute `gem env` for more information
	from /usr/share/rubygems/rubygems/specification.rb:1395:in `block in activate_dependencies'
	from /usr/share/rubygems/rubygems/specification.rb:1384:in `each'
	from /usr/share/rubygems/rubygems/specification.rb:1384:in `activate_dependencies'
	from /usr/share/rubygems/rubygems/specification.rb:1366:in `activate'
	from /usr/share/rubygems/rubygems/specification.rb:1402:in `block in activate_dependencies'
	from /usr/share/rubygems/rubygems/specification.rb:1384:in `each'
	from /usr/share/rubygems/rubygems/specification.rb:1384:in `activate_dependencies'
	from /usr/share/rubygems/rubygems/specification.rb:1366:in `activate'
	from /usr/share/rubygems/rubygems.rb:302:in `block in activate_bin_path'
	from /usr/share/rubygems/rubygems.rb:301:in `synchronize'
	from /usr/share/rubygems/rubygems.rb:301:in `activate_bin_path'
	from /usr/bin/irb:23:in `<main>'
/usr/share/rubygems/rubygems/dependency.rb:307:in `to_specs': Could not find 'io-console' (~> 0.5) among 76 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/builddir/.local/share/gem/ruby:/usr/share/gems:/usr/local/share/gems' , execute `gem env` for more information
	from /usr/share/rubygems/rubygems/specification.rb:1396:in `block in activate_dependencies'
	from /usr/share/rubygems/rubygems/specification.rb:1384:in `each'
	from /usr/share/rubygems/rubygems/specification.rb:1384:in `activate_dependencies'
	from /usr/share/rubygems/rubygems/specification.rb:1366:in `activate'
	from /usr/share/rubygems/rubygems/specification.rb:1402:in `block in activate_dependencies'
	from /usr/share/rubygems/rubygems/specification.rb:1384:in `each'
	from /usr/share/rubygems/rubygems/specification.rb:1384:in `activate_dependencies'
	from /usr/share/rubygems/rubygems/specification.rb:1366:in `activate'
	from /usr/share/rubygems/rubygems.rb:302:in `block in activate_bin_path'
	from /usr/share/rubygems/rubygems.rb:301:in `synchronize'
	from /usr/share/rubygems/rubygems.rb:301:in `activate_bin_path'
	from /usr/bin/irb:23:in `<main>'
~~~
2021-01-08 18:49:16 +01:00
Vít Ondruch
071cbd0906 Rename patch to the correct name. 2021-01-08 16:14:30 +01:00
Vít Ondruch
fcc584306b Fix SEGFAULT preventing rubygem-unicode to build on armv7hl. 2021-01-08 15:38:01 +01:00
Vít Ondruch
9a03f61609 Add %{gem_plugin} convenience macro.
This allows easy plugin stub ownership for RubyGems plugin packages.
2021-01-06 14:26:09 +01:00
Vít Ondruch
15d70f8b4a Properly own RubyGems plugin directory.
RubyGems 3.2.0 rewored their plugins system for improvement performance
[[1]]. Each RubyGems plugins has now generated loader stub during
installation. This directory needs to have proper ownership.

[1]: https://github.com/rubygems/rubygems/pull/3108
2021-01-06 14:26:09 +01:00
Vít Ondruch
f11a9b4fe3 Upgrade to Ruby 3.0.0.
* Extract RSS and REXML into separate subpackages, because they were moved from
  default gems to bundled gems.

* Obsolete Net::Telnet and XMLRPC packages, because they were dropped from Ruby.

The detailed changelog leading to this release is preserved in
private-ruby-3.0 branch.
2021-01-04 16:42:55 +01:00
Pavel Valena
2a352348bd Add Recommends: redhat-rpm-config to devel subpackage
as it's needed for building (gem install ...) gems with binary extensions.

This is a workaround to have /usr/lib/rpm/redhat/redhat-hardened-cc1
on the system, as same CFLAGS are reused from when Ruby was built.

Resolves: rhbz#1905222
2020-12-17 02:53:30 +01:00
Vít Ondruch
986dc48123 Add explicit BR: make. 2020-11-25 11:01:43 +01:00
Vít Ondruch
be9961f6d0 Add missing patch. 2020-10-13 17:54:53 +02:00
Vít Ondruch
946f8b8693 Enable arm64 optimizations.
The same already exists for power/x86.

Resolves: rhbz#1884728
2020-10-13 17:03:50 +02:00
Vít Ondruch
8b746d13cf Upgrade to Ruby 2.7.2. 2020-10-13 16:22:15 +02:00
Jun Aruga
78c9d9e324 Give an option to increase the timeout in tests.
Because setting the option makes some tests stable that are currently randomly
failing with error on especially s390x and aarch64.

We observed the failing tests are calling `assert_in_out_err` method
calling `invoke_ruby` calling method.

Then when the `th_stdout.join(timeout)` or `th_stderr.join(timeout)` returns
`nil` as thread timeout in `invoke_ruby` method, it causes the error. [1][2]

The `test_timeout_scale` macro is to set the environment variable
`RUBY_TEST_TIMEOUT_SCALE` to increase the timeout in `apply_timeout_scale`
method as <new timeout> = <timeout> * <timeout scale>.

As an example, `TestBugReporter#test_bug_reporter_add` test's
maximum thread timeout was 56+ seconds for the default timeout 10 seconds. [3]
In this case setting `RUBY_TEST_TIMEOUT_SCALE=6` (6 * 10 = 60) is good enough
for 56+ seconds.

[1] https://github.com/ruby/ruby/blob/v2_7_1/tool/lib/envutil.rb#L149
[2] https://bugs.ruby-lang.org/issues/16492#note-8
[3] https://bugs.ruby-lang.org/issues/16492#note-4
2020-08-05 14:23:50 +02:00
Fedora Release Engineering
d471fb8f62 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-29 06:02:07 +00:00
Vít Ondruch
4979be53ac Avoid possible timeout errors in TestBugReporter#test_bug_reporter_add. 2020-07-27 17:16:51 +02:00
Vít Ondruch
d461276d48 Disable LTO, which appear to cause issues with SIGSEV handler.
5baaf4a99c
2020-07-27 17:15:32 +02:00
Jun Aruga
064a0517d6 Add ruby-default-gems dependency on irb.
Resolves: rhbz#1850541
2020-06-25 11:25:42 +02:00
Vít Ondruch
bc5cb6094e Fix require behavior allowing to load libraries multiple times.
Resolves: rhbz#1835836
2020-06-24 14:43:04 +02:00
Jun Aruga
0963ae5102 Fix FTBFS due to libyaml 0.2.5.
Resolves: rhbz#1845530
2020-06-16 14:31:54 +02:00
Vít Ondruch
29816481d1 Relax rubygems-devel dependency on rubygems.
Independent rubygems package used to provide rubygems-devel subpackages,
but this is going to change to ease the independent rubygems package
maitenance and therefore ruby package will become the ultimate source of
rubygems-devel package.
2020-05-15 17:52:30 +02:00
Vít Ondruch
26bc2eb795 Fix changelog identation. 2020-04-16 10:35:30 +02:00
Vít Ondruch
102ff85d98 Prevent issues with openssl loading when RubyGems are disabled. 2020-04-15 18:48:14 +02:00