Bug 1284684 - ruby-devel missing redhat-rpm-config dependency
ruby-devel missing redhat-rpm-config dependency
Status: NEW
Product: Fedora
Classification: Fedora
Component: ruby (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jeroen van Meeuwen
Fedora Extras Quality Assurance
: Tracking
: 1401266 (view as bug list)
Depends On: 1218294
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-23 17:01 EST by François Kooman
Modified: 2017-11-17 11:31 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description François Kooman 2015-11-23 17:01:07 EST
Description of problem:

RROR: Failed to build gem native extension.

gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory

Version-Release number of selected component (if applicable):

ruby-devel-2.2.3-44.fc23.x86_64

How reproducible:

always

Steps to Reproduce:
1. forget to install redhat-rpm-config
2. try to build gem native extension
3. fail with gcc error above

Actual results:

error...

Expected results:

no error.

Additional info:

dnf -y install redhat-rpm-config fixes it, it should be a dependency of something I guess...
Comment 1 Josef Stribny 2015-11-24 04:41:59 EST
I already documented this here:
https://developer.fedoraproject.org/tech/languages/ruby/gems-installation.html

Anyway, I agree that this dependency is necessary and should be stated.
Comment 2 Vít Ondruch 2015-11-24 06:45:19 EST
This seems to be similar to Python bug 1217376 and there is also some subsequent bug 1218294
Comment 3 Fedora End Of Life 2016-11-24 08:40:23 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 4 Vít Ondruch 2016-11-25 10:34:20 EST
This was not resolved yet if I am not mistaken.
Comment 5 Vít Ondruch 2016-12-05 04:55:11 EST
*** Bug 1401266 has been marked as a duplicate of this bug. ***
Comment 6 Mamoru TASAKA 2016-12-07 18:39:27 EST
Well, if I am not mistaken, the real problem here is that rpm's %optflags is always embedded into Fedora's ruby config file, that is 

/usr/lib64/ruby/rbconfig.rb:167:  CONFIG["CXXFLAGS"] = "-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic"
/usr/lib64/ruby/rbconfig.rb:171:  CONFIG["CFLAGS"] = "-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic -fPIC"

on x86_64, for example.

Although I am not sure this is already discussed somewhere or not, basically I think changing the default CFLAGS of "system" ruby like this way is undesirable and installed "rbconfig.rb" should have some "minimal" CFLAGS / CXXFLAGS.
( for example, just like CONFIG["CFLAGS"] = "-fPIC" )

Only when we build Fedora gems or so (on koji), we should change CFLAGS / CXXFLAGS explicitly afterwards using %optflags.

Note that Qt people now actually do this way, see:
https://bugzilla.redhat.com/show_bug.cgi?id=1279265
and
https://lists.fedoraproject.org/archives/list/devel%40lists.fedoraproject.org/message/6TLCJFMMVPYHJKDL4XZYUEO66GYM64I7/
i.e. they explicitly remove Fedora %optflags from installed qmake related files.
Comment 7 Mamoru TASAKA 2016-12-07 18:45:08 EST
Note that doing the way in my comment 6 may have to change %gem_install in some way, however I think changing CFLAGS only when we use %gem_install is desirable.
Comment 8 Vít Ondruch 2016-12-08 06:15:09 EST
(In reply to Mamoru TASAKA from comment #6)
> Well, if I am not mistaken, the real problem here is that rpm's %optflags is
> always embedded into Fedora's ruby config file, that is 
> 
> /usr/lib64/ruby/rbconfig.rb:167:  CONFIG["CXXFLAGS"] = "-O2 -g -pipe -Wall
> -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches
> -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic"
> /usr/lib64/ruby/rbconfig.rb:171:  CONFIG["CFLAGS"] = "-O2 -g -pipe -Wall
> -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches
> -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic -fPIC"
> 
> on x86_64, for example.

The question is what is the role of these values in rbconfig.rb. Is it just recorded configuration of Ruby itself? Is it to use the same configuration for the Ruby dependencies? I'd say both is true and I don't see any reason, why the gem should use different configuration options then Ruby itself. But if different configuration for Ruby and gems is desirable, I'd like to see this modified upstream.

> Although I am not sure this is already discussed somewhere or not

I am not aware of any broader discussion...

> I think changing the default CFLAGS of "system" ruby like this way is
> undesirable and installed "rbconfig.rb" should have some "minimal" CFLAGS /
> CXXFLAGS.
> ( for example, just like CONFIG["CFLAGS"] = "-fPIC" )
> 
> Only when we build Fedora gems or so (on koji), we should change CFLAGS /
> CXXFLAGS explicitly afterwards using %optflags.
> 
> Note that Qt people now actually do this way, see:

QT guys decided one way, Python guys (bug 1218294) seems to be in favor of other way. Personally, I side with Python guys.
Comment 9 Fedora End Of Life 2017-02-28 04:50:48 EST
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.
Comment 10 Ryan 2017-07-13 01:03:13 EDT
This is currently affecting clean installs of Fedora 26 Workstation. I just installed a test vm using the default live DVD and performed 'dnf install ruby'. After doing this, I performed a 'gem update' and immediately received a build error stating that firstly it was missing JSON support, and (after installing this) also that it required 'development tools to be installed' which turned out to be 'redhat-rpm-config'.

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