Bug 771938

Summary: yum-builddep part: ppc-32 BuildDependencies crawling into remaining architectures
Product: Red Hat Enterprise Linux 6 Reporter: Jan Kratochvil <jan.kratochvil>
Component: yum-utilsAssignee: James Antill <james.antill>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: low    
Version: 6.0CC: jan.kratochvil, ksrot, mfranc, mvadkert, pknirsch, pmuller, sgraf
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 664427
: 1131164 (view as bug list) Environment:
Last Closed: 2013-04-09 21:35:35 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:
Bug Depends On: 554854, 664427    
Bug Blocks: 1131164    

Description Jan Kratochvil 2012-01-05 13:24:29 UTC
+++ This bug was initially created as a clone of Bug #664427 +++

Description of problem:
gdb.src.rpm want ppc-32 builddeps even on different architectures:

# uname -m
i686

Version-Release number of selected component (if applicable):
both 6.0 and 6.0.z candidate gdb:

gdb-7.1-29.el6_0.1.src.rpm
gdb-7.1-29.el6.src.rpm

How reproducible:
always

Steps to Reproduce:
1. yum-builddep gdb-7.1-29.el6_0.1.src.rpm

Actual results:
Getting requirements for gdb-7.1-29.el6_0.1.src
Error: No Package found for ncurses-devel(ppc-32)
or maybe no BuildRequires installed after the fix of Bug 664427.

Expected results:
Properly installed i686 BuildRequires packages.

--- Additional comment from jan.kratochvil on 2011-12-14 09:57:12 CET ---

(In reply to comment #12)
> but you can unpack the src.rpm and run 'yum-builddep gdb.spec' and have the
> buildrequires properly parsed for the architecture you're building on.

If I can do it then yum-builddep can do it. Software is here to save the human time.

Comment 1 James Antill 2012-01-09 19:27:26 UTC
1. There is no API to open the rpm and find the .spec file inside it. So yum+mock+koji+whatever would need to start running rpm cli commands to do this kind of thing.

2. The assumed model everywhere is that the srpm headers aren't arch specific (and don't need to be interpreted). Eg. rules about how we can't use %{_isa} in buildrequires etc. ... fixing this is probably "not easy".

Comment 2 Jan Kratochvil 2012-01-09 19:38:34 UTC
Please discuss it first with Panu Matilainen.  I have filed this Bug as I was told so in Bug 664427 Comment 14.

I do not mind in which component how it gets fixed, I am just a developer and I need rpms working.

Comment 3 Phil Knirsch 2012-02-23 16:38:40 UTC
Although the following page isn't an official part of the FPG yet, the draft specifies the problematic thing:

http://fedoraproject.org/wiki/PackagingDrafts/ArchSpecificRequires

in the following section:

In most cases, adding an arch specific dependency unnecessarily will not cause problems. There are a few, however, that MUST NOT be made arch specific:

    * A package has a Build-Requires on a specific arch. library (because rpmbuild evaluates the %{_isa} at .src.rpm buildtime, and not at .src.rpm => .arch.rpm build time).
    * Specifying an arch specific dependency on a package that is noarch. 

and notice the strong wording here with a "MUST NOT" use %{_isa} in a BuildRequires.

Thanks & regards, Phil

Comment 4 Jan Kratochvil 2012-02-23 17:40:43 UTC
The page is just WONTFIX of this Bug by other words.
I have added disagreement there to the last "Question" item.

Comment 5 James Antill 2012-03-02 22:00:33 UTC
 What Panu said is:

What we can do to migitate the issue is backporting the necessary python
bindings bits that makes it possible to use yum-builddep on specs directly.
Devel ack for *that*, and that alone.

...and then in https://bugzilla.redhat.com/show_bug.cgi?id=664427#c22 he said he's fixed it by changing rpm so that:

[root@localhost pmatilai]# yum-builddep -q libselinux.spec 
Getting requirements for libselinux.spec
 --> Already installed : python-devel-2.6.6-29.el6.x86_64

...so AIUI there's nothing to do in yum-utils. Note that this only works directly on specfiles, if you do "yum-builddep libselinux" it's not going to work (and can't).

Comment 6 Jan Kratochvil 2012-03-02 22:12:35 UTC
This should work for:
$ yum-builddep -q libselinux-X-Y.src.rpm

And it can work.  As one can do:
$ rpm2cpio libselinux-X-Y.src.rpm | cpio -i libselinux.spec
$ yum-builddep -q libselinux.spec

and if a user can do it then yum-builddep can also do it.

Comment 8 RHEL Program Management 2012-09-07 05:02:05 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 9 James Antill 2013-04-09 21:35:35 UTC
> and if a user can do it then yum-builddep can also do it.

While that's technically true, it's often not that easy to just do it.

Given how late it is in RHEL-6 I'm going to close this one. You can open a bug against RHEL-7, to add this feature but it isn't upstream yet and without a patch I wouldn't expect this to land in RHEL-7.