Bug 554854

Summary: %{_isa} requires are propagated to source RPMs
Product: [Fedora] Fedora Reporter: Bill Nottingham <notting>
Component: rpmAssignee: Fedora Packaging Toolset Team <packaging-team>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 19CC: dcantrell, fedoraproject, ffesti, gentoo.integer, gholms, james.antill, jan.kratochvil, matt, pknirsch, pmatilai, redhat-bugzilla, rvokal, sagarun, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-21 19:16:05 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:    
Bug Blocks: 664427, 771938, 1131164    

Description Bill Nottingham 2010-01-12 20:07:59 UTC
Description of problem:

Take a source rpm that happens to have been assembled in a 
ppc32 build root:

[notting@nostromo: ~]$ rpm -qpR rpm-4.8.0-4.el6.src.rpm 
db4-devel(ppc-32)  
fakechroot  
redhat-rpm-config  
gawk  
elfutils-devel(ppc-32) >= 0.112
elfutils-libelf-devel(ppc-32)  
readline-devel(ppc-32)  
zlib-devel(ppc-32)  
nss-devel(ppc-32)  
popt-devel(ppc-32) >= 1.10.2
file-devel(ppc-32)  
gettext-devel(ppc-32)  
libselinux-devel(ppc-32)  
ncurses-devel(ppc-32)  
bzip2-devel(ppc-32) >= 0.9.0c-2
python-devel(ppc-32) >= 2.6
lua-devel(ppc-32) >= 5.1
libcap-devel(ppc-32)  
libacl-devel(ppc-32)  
xz-devel(ppc-32) >= 4.999.8
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1

That looks... wrong.

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

whatever's being used to build these. Presumably 4.8.x.

Comment 1 Robert Scheck 2010-01-12 20:12:06 UTC
Yes, that looks wrong to me, too. IMHO an architecture (the architecture the
source package has been built on) should never get listed as a requirement of
a *.src.rpm.

Comment 2 seth vidal 2010-01-12 20:25:17 UTC
you know - it kinda feels like this should be expanded out from the spec file at build time of the pkg not build time of the srpm - but I know what that would involve. :(

Comment 3 Panu Matilainen 2010-01-13 13:13:11 UTC
src.rpm headers have always been architecture specific, nothing new here. Its just that using %{_isa} in BuildRequires just makes it more visible than before. 

There's nothing (well, except possible distro-specific packaging policies) stopping people from using something like (just an artificial example):
   BuildRequires: %{_libdir}/tclConfig.sh
..which would end up in src.rpm requires as /usr/lib/tclConfig.sh or /usr/lib64/
tclConfig.sh depending on which architecture the src.rpm happened to be created on. Or conditional buildrequires like
   %ifarch %{x86}
   BuildRequires: foo
   %endif

And sure, this conflicts with how people would like to (and do) distribute src.rpms.

Various options include
1) Have mock pass '--define "_isa %{nil}"' to rpmbuild when generating the src.rpm (cures the symptom in this bug but not the disease)
2) Ban arch-specific constructs in BuildRequires by packaging policy
3) Stop distributing src.rpms and point people to dist-cvs instead, this would put an end to the pretense that src.rpm's are arch-independent when they are not...

Comment 4 Bill Nottingham 2010-01-13 15:37:43 UTC
(In reply to comment #3)
> src.rpm headers have always been architecture specific, nothing new here. Its
> just that using %{_isa} in BuildRequires just makes it more visible than
> before. 
> 
> There's nothing (well, except possible distro-specific packaging policies)
> stopping people from using something like (just an artificial example):
>    BuildRequires: %{_libdir}/tclConfig.sh
> ..which would end up in src.rpm requires as /usr/lib/tclConfig.sh or
> /usr/lib64/
> tclConfig.sh depending on which architecture the src.rpm happened to be created
> on. Or conditional buildrequires like
>    %ifarch %{x86}
>    BuildRequires: foo
>    %endif

Yes, but all except the last are pointless unless they're evaluated at *build* time, not SRPM creation time.

Really, if you're adding %{_isa} to build requires, it's not that you actually care at all what the value of %{_isa} is; you just care it's the same for all the packages you're attaching it to. Hence, setting the value in the source rpm seems wrong.

Comment 5 Panu Matilainen 2010-01-18 10:28:07 UTC
Getting rid of %{_isa} in src.rpm might be possible by adding a separate spec parse round with %{_isa} defined to %{nil}, but there's no way to generically fix this: you dont care what the value of eg %{_libdir} is either until at build-time, but nevertheless its value at the time of src.rpm generation ends up in src.rpm dependencies and there's no correct arch-independent substitute for it. Requires of a src.rpm can be unresolvable on a different architecture than was used to generate the src.rpm and there's no helping it, except by packaging policy.

I'll remove the %{_isa} from BuildRequires of rpm.spec, there's not much else to be done about it.

Comment 6 Panu Matilainen 2010-01-18 10:53:27 UTC
Mm... ok there are over 50 packages using %{_isa} in buildrequires so removing from rpm.spec alone wont do any good.

Again, a possible workaround for the %{_isa} case is to have mock generate the src.rpm with --define "_isa %{nil}" but there's no generic way to eliminate arch-dependent pieces ending up in src.rpms. Of course this way its possible to have build-requires depsolve succeed but actual build still fail due to missing buildrequires. Which is probably better than not being able to depsolve them at all, but somewhat ugly.

Comment 7 Bill Nottingham 2010-01-18 17:17:06 UTC
Jesse - would it be possible to set that in the mock config?

Comment 8 Jesse Keating 2010-01-18 19:47:44 UTC
It should be possible, but it would take patching koji too I think, since koji writes out the mock config files.

Panu, can you come up with any scenario where isa in BuildRequires is actually useful?  I'm having a hard time coming up with one.  Unlike the other macros in srpms that are arch dependent, most of those don't wind up in BuildRequires, which is the one thing we really care about in srpms (and spec files).

Comment 9 James Antill 2010-01-18 20:20:24 UTC
For a mock build, isa is probably not useful. But for people who still use just rpmbuild, and multilib, it's easy to get screwed without isa in BuildRequires (or at least it'd seem that you'd want it, if you didn't check what actually happened).

Comment 10 Panu Matilainen 2010-01-19 07:40:45 UTC
Yup, the main case for isa in BuildRequires is getting sensible behavior when doing rpmbuild for a secondary arch, eg:
[pmatilai@dhcp102 SPECS]$ uname -m
x86_64
[pmatilai@dhcp102 SPECS]$ rpmbuild -bb --target i686 rpm.spec
Building target platforms: i686
Building for target i686
error: Failed build dependencies:
	db4-devel(x86-32) is needed by rpm-4.8.0-2.fc12.i686
	elfutils-devel(x86-32) >= 0.112 is needed by rpm-4.8.0-2.fc12.i686
	elfutils-libelf-devel(x86-32) is needed by rpm-4.8.0-2.fc12.i686
	readline-devel(x86-32) is needed by rpm-4.8.0-2.fc12.i686
        ...

Without isa, you'd get varying errors in the middle of the build despite rpm seeming happy about buildrequires.

Of course whether %{_isa} is in src.rpm or not, this doesn't work with something like yum-builddep - as has been noted here the only meaningful place to figure buildrequires is at build, not src.rpm generation time. I wasn't joking about dropping distribution of source rpms and pointing people to dist-cvs instead.

Oh and adding an API to rpm-python for resolving build-requires from a spec wouldn't be hard at all, it's just not there yet.

Comment 11 Bill Nottingham 2010-01-19 15:25:27 UTC
dist-cvs/dist-git is a non-starter; attempting to distribute source that way fails various GPL provisions.

Comment 12 James Antill 2010-01-19 15:47:41 UTC
> Of course whether %{_isa} is in src.rpm or not, this doesn't work with
> something like yum-builddep

 Well if you "fix" rpmbuild, then I'm pretty sure we can change yum-builddep to work too.

Comment 13 Bug Zapper 2010-03-15 13:52:47 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 14 Jesse Keating 2011-03-05 18:58:39 UTC
this has not been "fixed" yet.  Retagging with rawhide.

Comment 15 Matt McCutchen 2011-08-28 21:33:31 UTC
IMO, putting arch-specific build requirements on the SRPM is broken design.  And starting in F15, yum-builddep works on spec files (bug 379181).  So I propose to have mock run yum-builddep on the spec file (bug 733949) and then remove the build requirements from SRPMs entirely (bug 733954).

If the RPM team supports the above, I suggest duping this bug to bug 733954.

Comment 16 Fedora Admin XMLRPC Client 2012-04-13 23:09:47 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 17 Fedora Admin XMLRPC Client 2012-04-13 23:12:24 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 18 Fedora End Of Life 2013-04-03 18:54:29 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 19 Kanstantsin Shautsou 2014-01-20 18:32:52 UTC
Any news? Last package in repository with isa deps.

Comment 21 Tom "spot" Callaway 2014-04-21 19:16:05 UTC
Fixed in rawhide (rpm-4.11.2-10.fc21).