#57 Ruby packaging guidelines needs updating due to changes in fedpkg 0.5.5.0
Closed: Invalid Opened by ellert.

With the new fedpkg the specfile needs to be parsable without errors ''before'' all the dependencies have been installed during a koji build.

The new fedpkg version is currently used in rawhide (f16) and is [https://admin.fedoraproject.org/updates/search/fedora-packager submitted to testing] in f13, f14, f15, epel5 and epel6.

A [https://koji.fedoraproject.org/koji/getfile?taskID=2831521&name=root.log recent rawhide (f16) build] in koji of a package with a spec file written according to the ruby guidelines fails with:
{{{
DEBUG util.py:281: Executing command: ['fedpkg', 'sources']
DEBUG util.py:247: Could not download sources: sh: ruby: command not found
DEBUG util.py:320: Child returncode was: 1
}}}
With earlier versions of fedpkg this package built fine:
{{{
DEBUG util.py:281: Executing command: ['fedpkg', 'sources']
DEBUG util.py:247: Downloading root-5.28.00.tar.gz
DEBUG util.py:320: Child returncode was: 0
}}}

The problem is the rules in the guidelines that contain {{{%(ruby ...)}}} without any protection for ruby not being available. There are three of them in the guidelines page:
{{{
%{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"] ')}
%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')}
%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
}}}

I first filed this problem as a [https://bugzilla.redhat.com/show_bug.cgi?id=676744 bug in the new fedpkg version]. The bug was closed NOTABUG explaining that the change was intentional. Quoting further from the reply in bugzilla:

Perhaps the ruby guidelines need updating (or fix whatever is supposed to provide ruby_sitearch). That macro should be made safer, in case ruby isn't present (like when srpm is being generated), change to something like:

{{{%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]' 2>/dev/null || echo "ruby_not_present")}}}


Maybe the fedpkg developers had a change of heart. With an even newer version of fedpkg it works again
{{{
DEBUG util.py:281: Executing command: ['fedpkg', 'sources']
DEBUG util.py:247: sh: ruby: command not found
DEBUG util.py:247: Downloading root-5.28.00.tar.gz
DEBUG util.py:320: Child returncode was: 0
}}}
Now I don't know what to think...

I'm going to close this as NOTABUG, reopen if needed.

Metadata