Dne 05. 11. 24 v 11:15 Mamoru TASAKA via ruby-sig napsal(a):
Vít Ondruch via ruby-sig wrote on 2024/11/05 19:01:
No I am looking into rubygem-activesupport build issue. I have locally applied patches to remove `mutex_m` dependency. However now the build fails with error such as:
+ ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' /usr/share/gems/gems/minitest-5.25.1/lib/minitest/mock.rb:33: warning: redefining 'object_id' may cause serious problems /usr/share/ruby/did_you_mean/core_ext/name_error.rb:11: warning: drb is not part of the default gems starting from Ruby 3.4.0. Install drb from RubyGems. <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require': cannot load such file -- drb (LoadError) Did you mean? erb from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require' from /builddir/build/BUILD/rubygem-activesupport-7.0.8-build/activesupport-7.0.8/usr/share/gems/gems/activesupport-7.0.8/lib/active_support/testing/parallelization.rb:3:in '<top (required)>' from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require' from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require' from /builddir/build/BUILD/rubygem-activesupport-7.0.8-build/activesupport-7.0.8/usr/share/gems/gems/activesupport-7.0.8/lib/active_support/test_case.rb:14:in '<top (required)>' from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require' from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require' from /builddir/build/BUILD/rubygem-activesupport-7.0.8-build/activesupport-7.0.8/usr/share/gems/gems/activesupport-7.0.8/test/abstract_unit.rb:30:in '<top (required)>' from /builddir/build/BUILD/rubygem-activesupport-7.0.8-build/activesupport-7.0.8/usr/share/gems/gems/activesupport-7.0.8/test/actionable_error_test.rb:3:in 'Kernel#require_relative' from /builddir/build/BUILD/rubygem-activesupport-7.0.8-build/activesupport-7.0.8/usr/share/gems/gems/activesupport-7.0.8/test/actionable_error_test.rb:3:in '<top (required)>' from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require' from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require' from <internal:dir>:412:in 'Dir.glob' from -e:1:in '<main>'
The issue is actually here:
... snip ... Package Arch Version Repository Size Installing: memcached x86_64 1.6.32-1.fc42 fedora 475.3 KiB ruby x86_64 3.4.0~20241016git3da3cabf98-15.fc42 copr_base 84.4 KiB ruby-default-gems noarch 3.3.5-15.fc42 fedora 76.3 KiB ruby-libs x86_64 3.4.0~20241016git3da3cabf98-15.fc42 copr_base 14.7 MiB rubygem-bigdecimal x86_64 3.1.8-15.fc42 copr_base 134.8 KiB rubygem-builder noarch 3.3.0-1.fc42 copr_base 27.5 KiB rubygem-concurrent-ruby noarch 1.1.9-7.fc42 copr_base 693.0 KiB rubygem-connection_pool noarch 2.2.5-9.fc42 copr_base 18.5 KiB rubygem-dalli noarch 3.2.0-7.fc42 copr_base 111.4 KiB rubygem-i18n noarch 1.14.1-6.fc41 fedora 158.5 KiB rubygem-listen noarch 3.7.1-6.fc42 copr_base 64.6 KiB rubygem-minitest noarch 5.25.1-100.fc42 copr_base 149.5 KiB rubygem-rack noarch 1:2.2.4-6.fc41 fedora 306.0 KiB rubygem-redis noarch 5.2.0-1.fc42 copr_base 181.9 KiB rubygem-rexml noarch 3.3.8-15.fc42 copr_base 455.4 KiB rubygem-tzinfo noarch 2.0.6-4.fc42 copr_base 278.5 KiB rubygems-devel noarch 3.6.0.dev-15.fc42 copr_base 13.4 KiB tzdata noarch 2024a-9.fc41 fedora 1.7 MiB Installing dependencies: ... snip ... rubygem-ffi x86_64 1.17.0-1.fc42 copr_base 577.6 KiB rubygem-io-console x86_64 0.7.2-15.fc42 copr_base 33.3 KiB rubygem-json x86_64 2.7.5-201.fc42 copr_base 167.8 KiB rubygem-psych x86_64 5.2.0~beta1-15.fc42 copr_base 132.8 KiB rubygem-rb-inotify noarch 0.10.1-10.fc42 copr_base 25.0 KiB rubygem-rdoc noarch 6.7.0-15.fc42 copr_base 1.8 MiB rubygem-redis-client noarch 0.22.2-1.fc41 fedora 61.6 KiB rubygems noarch 3.6.0.dev-15.fc42 copr_base 1.4 MiB rubypick noarch 1.1.1-21.fc42 copr_base 4.4 KiB systemd x86_64 256.7-1.fc42 fedora 17.0 MiB systemd-pam x86_64 256.7-1.fc42 fedora 1.1 MiB systemd-rpm-macros noarch 256.7-1.fc42 fedora 10.7 KiB ... snip ...
If you have not spotted it, then `ruby-default-gems noarch 3.3.5-15.fc42 fedora 76.3 KiB` is wrong version, coming from Ruby 3.3, which provides `rubygem(drb)`, where newly is provided by `rubygem-bundled-gems`. I think that DNF miniminzes the dependency chain and `ruby-default-gems` is enough to satisfy the dependency.
The question is how to workaround this, because neither `ruby-default-gems` nor `rubygem-bundled-gems` are installed explicitly. Does anybody have any idea? Could e.g. `Suggests: rubygem-bundled-gems >= 3.4` help? Or some `Obsolete` somewhere?
Making ruby-libs have "Obsoletes: ruby-default-gems < 3.3.999" and "Obsoletes: rubygem-bundled-gems < 3.3.999" helps here
Right, that might be one option. Thaks 👍 Other might be rubygem-bundled-gems obsoleting the `rubygem(drb)` and other similar.
(because ruby-libs will be always installed when building rubygem-foo pkgs) (My scratch build already added this workaround.)
I actually consider this change:
~~~
$ git show commit 43ee23809d26d8e1050cf1ff20f8a1139c1fe677 (HEAD -> ruby-3.4) Author: Vít Ondruch vondruch@redhat.com Date: Tue Nov 5 11:47:24 2024 +0100
Include ruby-{default,bundled}-gems by default.
Users are expecting to have them available, because that is what upstream does.
diff --git a/ruby.spec b/ruby.spec index 704900e..e75b370 100644 --- a/ruby.spec +++ b/ruby.spec @@ -284,6 +284,8 @@ Patch9: ruby-3.3.0-Disable-syntax-suggest-test-case.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} %{?with_rubypick:Suggests: rubypick} Recommends: ruby(rubygems) >= %{rubygems_version} +Recommends: ruby-default-gems >= %{version}-%{release} +Recommends: ruby-bundled-gems >= %{version}-%{release} Recommends: rubygem(bigdecimal) >= %{bigdecimal_version}
# Build dependencies
~~~
I think this is probably good idea to include the `ruby-{default,bundled}-gems` when `ruby` package installed no matter if it helps to this specific case. Because this will provide more upstream like experience.
In my limited testing, this could help to address the issue, despite weak dependencies not being installed in the build root. Going to give it a try in Copr.
Vít
Regards, Mamoru
Vít