Bug 676744

Summary: fedpkg in rawhide (F16) fails to download sources
Product: [Fedora] Fedora Reporter: Mattias Ellert <mattias.ellert>
Component: fedora-packagerAssignee: Dennis Gilmore <dennis>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: urgent    
Version: rawhideCC: dcantrell, dennis, rdieter, rhbugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-11 19:49:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Mattias Ellert 2011-02-11 00:56:41 UTC
Description of problem:
fedpkg in rawhide fails to download sources during koji build.

Version-Release number of selected component (if applicable):
0.5.5.0-1.fc16
  
Actual results:
Koji build fails - see:
https://koji.fedoraproject.org/koji/getfile?taskID=2831521&name=root.log

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

Expected results:
Building the exact same specfile works fine in F15, F14, F13, EL6 and EL5:
https://koji.fedoraproject.org/koji/getfile?taskID=2831523&name=root.log
https://koji.fedoraproject.org/koji/getfile?taskID=2831527&name=root.log
https://koji.fedoraproject.org/koji/getfile?taskID=2831529&name=root.log
https://koji.fedoraproject.org/koji/getfile?taskID=2831531&name=root.log
https://koji.fedoraproject.org/koji/getfile?taskID=2831533&name=root.log

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

Additional info:
The F16 version of fedpkg seems to be confused by this line in the specfile:

%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')}

This line is taken from the Ruby packaging guidelines:
http://fedoraproject.org/wiki/Packaging/Ruby#Ruby_packages_with_binary_content.2Fshared_libraries

Comment 1 Rex Dieter 2011-02-11 15:09:52 UTC
It works fine for other builds.

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")}

Comment 2 Jesse Keating 2011-02-11 19:49:36 UTC
fedpkg does now parse the spec in order to gain information such as the package name, so if your spec parsing fails in a minimal environment that's going to be a bad thing.  It was a bad thing already, now it's just explicitly bad :)

I would recommend you fix up the spec so that it'll parse (rpm -q --specfile foo.spec) in a minimal environment.

Comment 3 Mattias Ellert 2011-02-12 12:45:22 UTC
Did you change your minds about this? With 0.5.5.0-2.fc16 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

Comment 4 Jesse Keating 2011-02-12 21:18:51 UTC
Sortof.  I still say that if the spec doesn't parse and causes rpm -q to fail that fedpkg rightly fails.  However I discovered in my code that if rpm spits out anything to stderr we were considering that a failure, which wasn't right.  I've fixed that so that we can return clean if rpm returns clean.