RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1982410 - rubygem-rspec-support: FTBFS related to require 'rake/file_utils'
Summary: rubygem-rspec-support: FTBFS related to require 'rake/file_utils'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: rubygem-rspec-support
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: Pavel Valena
QA Contact: Jan Houska
URL:
Whiteboard:
Depends On:
Blocks: 1980998
TreeView+ depends on / blocked
 
Reported: 2021-07-14 19:12 UTC by Florian Weimer
Modified: 2021-12-07 21:54 UTC (History)
6 users (show)

Fixed In Version: rubygem-rspec-core-3.10.1-7.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-07 21:52:33 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
build.log (16.04 KB, text/plain)
2021-07-14 19:12 UTC, Florian Weimer
no flags Details

Description Florian Weimer 2021-07-14 19:12:03 UTC
Created attachment 1801625 [details]
build.log

A rebuild of rubygem-rspec-support-3.10.2-1.el9.1 fails with an error during the %check phase:

Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.yvfb9P
+ umask 022
+ cd /builddir/build/BUILD
+ cd rspec-support-3.10.2
+ LANG=C.UTF-8
+ FAILFILE=()
+ FAILTEST=()
+ (( i = 0 ))
+ (( i < 0 ))
+ ruby -rrubygems -Ilib/ -S rspec spec/
Simplecov could not be loaded
An error occurred while loading ./spec/rspec/support/spec/shell_out_spec.rb. - Did you mean?
                    rspec ./spec/rspec/support/spec/stderr_splitter_spec.rb
                    rspec ./spec/rspec/support/source/node_spec.rb
Failure/Error: require 'rake/file_utils'
LoadError:
  cannot load such file -- rake/file_utils
# ./spec/rspec/support/spec/shell_out_spec.rb:1:in `<top (required)>'
An error occurred while loading ./spec/rspec/support/warnings_spec.rb. - Did you mean?
                    rspec ./spec/rspec/support/differ_spec.rb
                    rspec ./spec/rspec/support_spec.rb
                    rspec ./spec/rspec/support/source_spec.rb
Failure/Error: require 'rake/file_utils'
LoadError:
  cannot load such file -- rake/file_utils

Comment 1 Pavel Valena 2021-07-14 20:12:36 UTC
`rubygem-rake` is missing in the buildroot.

It should've been required by rubygem-rspec-core, but it seems the runtime require is missing. Only difference I was able to found (in comparison to Fedora) is this:
https://gitlab.com/redhat/centos-stream/rpms/rubygem-rspec-core/-/commit/ae1a6bd84e49a2588bfcf06bb40aa450ff1f4280

Other possibile difference is in soft dependencies handling, as the rubygem-rspec-core spec file contains:
```
Recommends:	rubygem(rake)
```

I'd simply modify the runtime dependency from Recommends to Requires in the rubygem-rspec-core package, at least temporarily, as it achieves the exact desired state without any side-effects (it's not intended for other than buildroot use, AFAIK).

Merge Request: https://gitlab.com/redhat/centos-stream/rpms/rubygem-rspec-core/-/merge_requests/2

Comment 2 Florian Weimer 2021-07-14 20:16:45 UTC
mock doesn't install weak dependencies in my experience (at least in the configurations we use).

You could use this:

Recommends: rubygem(rake)
Requires: (rubygem(rake) if redhat-rpm-config)

here redhat-rpm-config serves as a marker package for “this is a buildroot-like environment”. This way, you can keep the dependency optional for other kinds of environments.

It's what we plan to use for glibc-gconv-extra, which has similar issues around the buildroot (should be uninstallable for end users, so weak dependency, but must be included in the buildroot).

Comment 3 Pavel Valena 2021-07-14 20:30:52 UTC
Thanks! Amended.

Comment 4 Pavel Valena 2021-07-15 14:54:16 UTC
(In reply to Florian Weimer from comment #2)
> mock doesn't install weak dependencies in my experience (at least in the
> configurations we use).
> 
> You could use this:
> 
> Recommends: rubygem(rake)
> Requires: (rubygem(rake) if redhat-rpm-config)

Actually, upon more investigation, it turns out the `Recommends` was only RHEL- change. Probably with the intention to drop it. Not sure how that would be possible with current build failures. Also it previously built ok, so it was most probably pulled into the buildroot along with other dependencies.

I'll revert the change.

Comment 6 Pavel Valena 2021-07-15 15:21:59 UTC
I've just stumbled upon this:

https://gitlab.com/redhat/centos-stream/rpms/rubygem-rake/
 - it is a 404


Where does the `rubygem-rake` package come from?

Why is it available, without a repository, or a koji build?

https://kojihub.stream.rdu2.redhat.com/koji/search?match=glob&type=package&terms=rubygem-rake

Comment 7 Florian Weimer 2021-07-15 15:30:12 UTC
rubygem-rake is a subpackage of ruby:

$ dnf info info rubygem-rake
[…]
Name         : rubygem-rake
Version      : 13.0.3
Release      : 150.el9
Architecture : noarch
Size         : 91 k
Source       : ruby-3.0.1-150.el9.src.rpm
Repository   : build
Summary      : Ruby based make-like utility
URL          : https://www.ruby-lang.org/
License      : MIT
Description  : Rake is a Make-like program implemented in Ruby. Tasks and
             : dependencies are specified in standard Ruby syntax.

Comment 8 Pavel Valena 2021-07-16 09:35:34 UTC
(In reply to Florian Weimer from comment #7)
> rubygem-rake is a subpackage of ruby:
> 

You're right, my bad, I confused it with rack... sorry, I should've run the query.

Comment 9 Pavel Valena 2021-07-16 10:39:52 UTC
Should be fixed now, when built with: rubygem-rspec-core-3.10.1-7.el9

Comment 10 Pavel Valena 2021-07-20 16:12:19 UTC
Please note that the rubygem-rspec-core build is held on gating-yaml.validation (probably missing gating).

Comment 11 Vít Ondruch 2021-07-27 10:00:39 UTC
Previous version of rspec-core with runtime dependency on Rake was used when building the new version, therefore the rubygem-rake was pulled in. With updated version with the soft dependency, it cannot work anymore. Not easy to catch, sorry for the breakage.

Nevertheless, I still think the soft dependency is the right solution and the Rake should be specified explicitly when needed. I had an discussion about it with Fedora maintainer, but it could have been prior weak dependencies were available.

Comment 12 Pavel Valena 2021-07-27 10:16:47 UTC
(In reply to Vít Ondruch from comment #11)
> Previous version of rspec-core with runtime dependency on Rake was used when
> building the new version, therefore the rubygem-rake was pulled in. With
> updated version with the soft dependency, it cannot work anymore. Not easy
> to catch, sorry for the breakage.

It's required for multiple test suites, including the rspec-core one. As it's already included in Ruby, I opted for the easier solution, sorry. Alternative would be to have something like in Comment 2 (there's still time for a "fix").

> 
> Nevertheless, I still think the soft dependency is the right solution and
> the Rake should be specified explicitly when needed. I had an discussion
> about it with Fedora maintainer, but it could have been prior weak
> dependencies were available.

Yes, this is unfortunate. I still think it would be easier to test it in Fedora first, and merge into c9s subsequently, as it requires changes in multiple packages.

Comment 13 Florian Weimer 2021-07-27 10:20:52 UTC
(In reply to Pavel Valena from comment #12)
> Yes, this is unfortunate. I still think it would be easier to test it in
> Fedora first, and merge into c9s subsequently, as it requires changes in
> multiple packages.

I can validate changes on a CentOS Stream side tag over some weekend in August. The c9s builders have lots of spare capacity, and I have got scripts to submit builds. This is how I found this issue in the first place.

Rebuilding Fedora is much harder. It's both larger, and the builders tend to be much more loaded.

Eventually, I would like to see a program-level initiative to ensure that packages still build and pass gating, all the time, but it doesn't exist as of today. (Fedora is actually better in this regard, there is Koschei to find build problems.)

Comment 14 Vít Ondruch 2021-07-27 10:30:14 UTC
(In reply to Pavel Valena from comment #12)
> > Nevertheless, I still think the soft dependency is the right solution and
> > the Rake should be specified explicitly when needed. I had an discussion
> > about it with Fedora maintainer, but it could have been prior weak
> > dependencies were available.
> 
> Yes, this is unfortunate. I still think it would be easier to test it in
> Fedora first, and merge into c9s subsequently, as it requires changes in
> multiple packages.

I have opened this PR to narrow this in Fedora:

https://src.fedoraproject.org/rpms/rubygem-rspec-core/pull-request/4

There is probably no point to bother with this in RHEL9, so please keep the changes as they already are.

Comment 17 Pavel Valena 2021-07-30 10:19:21 UTC
Waived, as agreed on with PO and QE. As of current situation this BuildRoot package gating test would be of little value.


Note You need to log in before you can comment on or make changes to this bug.