Bug 1284684
Summary: | ruby-libs should not hard-code Fedora build flags | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | François Kooman <fkooman> |
Component: | ruby | Assignee: | Jeroen van Meeuwen <vanmeeuwen+fedora> |
Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | cfergeau, fweimer, hhorak, jaruga, mhroncok, misc, mtasaka, mtasaka, postmodern.mod3, s, stealthcipher, tagoh, vanmeeuwen+fedora, vondruch |
Target Milestone: | --- | Keywords: | Tracking |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
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: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1218294, 1543394 | ||
Bug Blocks: | 1432191, 1539083, 1905222 |
Description
François Kooman
2015-11-23 22:01:07 UTC
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. This seems to be similar to Python bug 1217376 and there is also some subsequent bug 1218294 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. This was not resolved yet if I am not mistaken. *** Bug 1401266 has been marked as a duplicate of this bug. *** 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. 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. (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. This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle. Changing version to '26'. 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'. (In reply to Vít Ondruch from comment #8) > (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. The current advice of the Red Hat toolchain team is to keep distribution build flags and toolchain default flags separate. This is why running “gcc” gives you the upstream defaults, and not the flags we use to compile Fedora packages. For consistency, Ruby (and other compilation support tools) follow this pattern: Use distribution flags when building for Fedora, but use upstream flags when the user compiles packages (i.e., what Ruby uses, probably something involving -O2). Our build flags are fully ABI-compatible with each other, so mismatches will not cause any problems at the C/C++/ABI level. Time to discuss this upstream. *** Bug 1551081 has been marked as a duplicate of this bug. *** My proof of concept: https://src.fedoraproject.org/rpms/ruby/pull-request/110 *** Bug 2142119 has been marked as a duplicate of this bug. *** |