Red Hat Bugzilla – Bug 496816
bug in spec file cause wrong src.rpm
Last modified: 2015-01-08 11:53:19 EST
i started this long thread on centos-devel:
the result turn out a kernel.spec file bug (and rpm problem). it turns out that this part of the spec:
should have to replace with
otherwise the resulting src.rpm depends on the build arch and no longer can be build in mock. see my other bug report:
imho it's a small fix which not intrusive since only change the result src.rpm and everybody can have a benefit from it.
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.
ps - I don't know much about mock, so all I can do is look at things from a spec file perspective.
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:
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.
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.
please close this bug as wontfix.
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'.
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
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.