Bug 589931

Summary: yum-builddep fails to resolve some BuildRequires if "hidden" by %global
Product: Red Hat Enterprise Linux 6 Reporter: Michal Nowak <mnowak>
Component: yum-utilsAssignee: James Antill <james.antill>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: ohudlick
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-07 13:52:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Nowak 2010-05-07 10:29:07 UTC
Description of problem:

I have here systemtap-1.2-1.el6.src.rpm which I'd like to rebuild. Some BRs are missing so I run `yum-builddep systemtap-1.2-1.el6.src.rpm` it resolves them and installs. Then I try to rebuild package `rpmbuild --rebuild systemtap-1.2-1.el6.src.rpm` but it fails:

[root@auto-i386-001 ~]# rpmbuild --rebuild systemtap-1.2-1.el6.src.rpm 
Installing systemtap-1.2-1.el6.src.rpm
[...]
error: Failed build dependencies:
	crash-devel is needed by systemtap-1.2-1.el6.i686

systemtap spec file looks like this:

%ifarch ppc
# crash is not being built on rhel6 beta on ppc
%{!?with_crash: %global with_crash 0}
%else
%{!?with_crash: %global with_crash 1}
%endif

[...]

%if %{with_crash}
BuildRequires: crash-devel zlib-devel
%endif

[...]

%if %{with_crash}
Requires: crash
%endif

etc.


It seems that yum-builddep fails to resolve BuildRequire if it is "hidden" by %global definition.

Version-Release number of selected component (if applicable):

yum-3.2.27-4.el6.noarch
yum-utils-1.1.26-7.el6.noarch
systemtap-1.2-1.el6.i686

How reproducible:

always. all archs.

Expected results:

crash-devel resolved & installed as others BRs.

Comment 1 RHEL Program Management 2010-05-07 11:31:22 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 2 seth vidal 2010-05-07 13:06:04 UTC
can you run:

rpm -qpR systemtap-1.2-1.el6.src.rpm

I suspect the buildreq is not listed there, either.

yum-builddep cannot read the spec file and parse the deps that show up there. It only gets the buildreqs from the requires in the src rpm header.

Comment 3 James Antill 2010-05-07 13:52:20 UTC
Specifically, this is the same "bug" as using %{_isa} in BuildRequires ... they are then "fixed" at the point rpmbuild creates the .src.rpm, so you either need to create a .src.rpm for each arch. ... or do something else.

Comment 4 Michal Nowak 2010-05-07 13:55:15 UTC
I can see. Thanks for clarification.