Bug 496816

Summary: bug in spec file cause wrong src.rpm
Product: Red Hat Enterprise Linux 5 Reporter: Levente Farkas <lfarkas>
Component: kernelAssignee: Jarod Wilson <jarod>
Status: CLOSED WONTFIX QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: low    
Version: 5.3CC: dzickus, jarod, qcai
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: 2015-01-08 16:53:19 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 Levente Farkas 2009-04-21 09:56:02 UTC
i started this long thread on centos-devel:
http://lists.centos.org/pipermail/centos-devel/2009-April/004385.html
the result turn out a kernel.spec file bug (and rpm problem). it turns out that this part of the spec:
-------------------------
%if %{with_headers}
BuildRequires: unifdef
%endif
-------------------------
should have to replace with
-------------------------
BuildRequires: unifdef
-------------------------
otherwise the resulting src.rpm depends on the build arch and no longer can be build in mock. see my other bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=496464
imho it's a small fix which not intrusive since only change the result src.rpm and everybody can have a benefit from it.

Comment 2 Don Zickus 2009-04-22 14:25:17 UTC
NACK on the change.  Having the %if provides clear separation for why the unifdef package is there.  Afaict there is nothing wrong with having it there.  In addition, we have built hundreds and perhaps thousands of kernel packages with that change in there (this was in 5.0) and this includes our partners, and no one has ever had a problem.  

Reading through the email threads seems to suggest this is a CentOS problem.  I don't see why RedHat should make this change.

If you can provide me a reliable test case (ie a specific arch and rpmbuild params) I will look into trying to duplicate and figure out what went wrong.  But so far evidence seems to suggest a misconfigured mock??

Also because the with_headers logic is slightly complicated in the kernel spec file, it might have been accidentally broken on the CentOS side.  If you attach the spec file that breaks to this bz, I will diff it with RedHat's version and review the changes to see what might have caused it.

Don't get me wrong, I am willing to help you guys, but I personally think you are trying to fix the symptom and not the problem.

-Don

ps - I don't know much about mock, so all I can do is look at things from a spec file perspective.

Comment 3 Levente Farkas 2009-04-22 14:53:22 UTC
probably you don't read through the thread:-) reconstruction is very simple just build a i386 kernel from spec file and _not_ from src.rpm (with eg. the latest kernel-2.6.18-128.1.6.el5) on i386 host eg with:
rpmbuild -ba --clean --target "noarch,i386,i686" -define "dist .el5" ~/rpm/SPECS/kernel-2.6.spec
and then on the resulting src.rpm run:
rpm -qp --requires kernel-2.6.18-128.1.6.el5.src.rpm | grep unifdef
if it give nothing (and will:-) than it's not working.

ps. anyway jeff johnson who probably now about rpm more then me acknowledge this rpm behavior in: 
http://lists.centos.org/pipermail/centos-devel/2009-April/004394.html
so one have to build the kernel on x86_64 (or ppc) and the resulting src.rpm will be good (that's what centos will do in the future), but in i386 not.

but this problem/artifacts can be solved in kernel spec ie. not put into BR into if or define with_headers other ways.

Comment 4 Don Zickus 2009-04-23 22:21:33 UTC
Interesting.  I can reproduce the problem on my end.  I do notice with your example above the src.rpm is created 3 times, one for each target.  If you put i386 as the last target it works out ok, because the last src.rpm created has the unifdef.

I'll try to think more about it tomorrow.  I understand why you came up with the patch above now.  

Cheers,
Don

Comment 5 Levente Farkas 2010-06-18 10:47:12 UTC
please close this bug as wontfix.

Comment 6 Levente Farkas 2010-10-29 20:01:25 UTC
ping

Comment 7 Jarod Wilson 2010-10-29 20:20:27 UTC
Eh. I'll go ahead and fix this. The real fix though, I believe, is to move the BR: up before where with_headers gets set to 0 within the spec. That way, its always a BR, unless someone does an 'rpmbuild -bb --without headers src.rpm'.

Comment 8 RHEL Program Management 2011-02-01 17:01:16 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 14 RHEL Program Management 2012-01-09 13:54:58 UTC
This request was evaluated by Red Hat Product Management for inclusion in Red Hat Enterprise Linux 5.8 and Red Hat does not plan to fix this issue the currently developed update.

Contact your manager or support representative in case you need to escalate this bug.