Bug 850943 - -e:1: Use RbConfig instead of obsolete and deprecated Config.
-e:1: Use RbConfig instead of obsolete and deprecated Config.
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: ruby (Show other bugs)
17
Unspecified All
unspecified Severity medium
: ---
: ---
Assigned To: Bohuslav "Slavek" Kabrda
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-22 16:21 EDT by John Florian
Modified: 2013-11-30 17:57 EST (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-24 11:16:50 EDT
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)
rpmbuild output showing reported error message (8.07 KB, text/plain)
2012-08-24 10:35 EDT, John Florian
no flags Details

  None (edit)
Description John Florian 2012-08-22 16:21:30 EDT
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 01:16:02 EDT
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 10:44:15 EDT
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 10:45:45 EDT
FWIW, this is with ruby-1.9.3.194-14.fc17.
Comment 4 Bohuslav "Slavek" Kabrda 2012-08-24 01:56:11 EDT
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 10:35:28 EDT
Created attachment 606889 [details]
rpmbuild output showing reported error message
Comment 6 John Florian 2012-08-24 10:35:42 EDT
(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 10:50:06 EDT
Could you please show us your .spec file as well?
Comment 8 Vít Ondruch 2012-08-24 10:50:51 EDT
Or SRPM would be even better.
Comment 9 John Florian 2012-08-24 11:02:52 EDT
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 11:16:50 EDT
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 11:36:18 EDT
Yes, that is the problem and solution. Actually if you are packaging gem, you may find useful rubygems-devel as well.
Comment 12 Sergio Monteiro Basto 2013-11-30 17:57:34 EST
as comment says: change Config by RbConfig


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

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