Bug 850943

Summary: -e:1: Use RbConfig instead of obsolete and deprecated Config.
Product: [Fedora] Fedora Reporter: John Florian <john>
Component: rubyAssignee: Bohuslav "Slavek" Kabrda <bkabrda>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: bkabrda, ffesti, jeremy, jnovy, jzeleny, mmorsi, mtasaka, packaging-team, pknirsch, pmatilai, sergio, tagoh, vanmeeuwen+fedora, vondruch
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-24 15:16:50 UTC 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:
Attachments:
Description Flags
rpmbuild output showing reported error message none

Description John Florian 2012-08-22 20:21:30 UTC
Description of problem:
rpmbuild issues this error message twice (but otherwise seems unaffected) for each *.rb (Ruby) file it encounters while building a package. 

Version-Release number of selected component (if applicable):
rpm-build-4.9.1.3-7.fc17.x86_64

How reproducible:
always

Additional info:
I encounter this while packaging custom facter facts (written in Ruby).  This external bug report seems to explain the situation pretty well:

https://github.com/puppetlabs/facter/pull/123

Comment 1 Panu Matilainen 2012-08-23 05:16:02 UTC
That's ruby, not rpmbuild, complaining about the software you're packaging, and its up to upstream developers of that software to fix it.

Comment 2 John Florian 2012-08-23 14:44:15 UTC
Okay fair enough, but it is still an unresolved issue so I've corrected the component and reopened this report.

Comment 3 John Florian 2012-08-23 14:45:45 UTC
FWIW, this is with ruby-1.9.3.194-14.fc17.

Comment 4 Bohuslav "Slavek" Kabrda 2012-08-24 05:56:11 UTC
What do you mean by saying:
"rpmbuild issues this error message twice (but otherwise seems unaffected) for each *.rb (Ruby) file it encounters while building a package."?
Could you attach the rpmbuild output? Does this also happen in mock?

If I get it correctly, you get this when running the files from the package (e.g. in tests or so) - am I right here? If yes, this is not Ruby issue. The problem is that upstream uses obsolete Config instead of RbConfig. I don't really see anything we can do about that other than sending pull request fixing this.

Comment 5 John Florian 2012-08-24 14:35:28 UTC
Created attachment 606889 [details]
rpmbuild output showing reported error message

Comment 6 John Florian 2012-08-24 14:35:42 UTC
(In reply to comment #4)
> What do you mean by saying:
> "rpmbuild issues this error message twice (but otherwise seems unaffected)
> for each *.rb (Ruby) file it encounters while building a package."?
> Could you attach the rpmbuild output?

Done.

> Does this also happen in mock?
I don't use mock.  I've tried in the past to get it going, but the process was too cumbersome/slow compared to my custom build script which just makes a temporary tarball of a project and then calls this:

make_rpms() {
    announce "Building Binary- and Source-RPM"
    setarch $RPMBUILD_ARCH rpmbuild -ta --clean $RPMBUILD_OPTS $tarball
    return $?
}

where:

RPMBUILD_OPTS="--target i386"
RPMBUILD_ARCH="i386"

>
> If I get it correctly, you get this when running the files from the package
> (e.g. in tests or so) - am I right here?

No, which is why I originally pegged this to rpmbuild.  No where in my spec file do I run or cause Ruby to be run, directly at least.  I'd guess this happens somewhere in one of the /usr/lib/rpm/ scripts, but I don't see anything obvious there.

Comment 7 Vít Ondruch 2012-08-24 14:50:06 UTC
Could you please show us your .spec file as well?

Comment 8 Vít Ondruch 2012-08-24 14:50:51 UTC
Or SRPM would be even better.

Comment 9 John Florian 2012-08-24 15:02:52 UTC
Doh!  My humble appologies to all involved here.  My employer won't permit to share the complete sources, so I had intended to hack up something that I could share with the bare essence of the problem still present.  That's when I noticed the following at the top of my spec file:


%{!?ruby_sitelibdir: %define ruby_sitelibdir %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]')}


I probably needed such a custom %define as this dates back to the Fedora 10 days.  If anyone is aware of a premade %define that is preferred circa Fedora 17/18 I'd be very appreciative of the enlightenment.  Otherwise editing the one I have as suggested by the warning does eliminate the warnings.

Comment 10 John Florian 2012-08-24 15:16:50 UTC
On further review of http://fedoraproject.org/wiki/Packaging:Ruby I now see my original mistake was that I had failed to have this present in my spec:

BuildRequires:  ruby-devel

Again, my applogies to all and many thanks for the help.

Comment 11 Vít Ondruch 2012-08-24 15:36:18 UTC
Yes, that is the problem and solution. Actually if you are packaging gem, you may find useful rubygems-devel as well.

Comment 12 Sergio Basto 2013-11-30 22:57:34 UTC
as comment says: change Config by RbConfig


http://stackoverflow.com/questions/13693713/use-rbconfig-instead-of-obsolete-and-deprecated-config