Bug 708505

Summary: fails to build without downstream patches
Product: Red Hat Enterprise Linux 6 Reporter: Kamil Dudka <kdudka>
Component: virt-whatAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 6.1CC: jzheng, leiwang, pcao, qwan
Target Milestone: rcKeywords: EasyFix, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-what-1.11-1.1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 09:57:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
proposed fix none

Description Kamil Dudka 2011-05-27 20:33:51 UTC
Version-Release number of selected component (if applicable):
virt-what-1.3-4.4.el6


Steps to Reproduce:
1. rpmbuild --define '__patch /bin/true' --rebuild virt-what-1.3-4.4.el6.src.rpm

  
Actual results:
DEBUG: + chmod +x 'tests/test-*.sh' 'tests/*/sbin/*'
DEBUG: chmod: cannot access `tests/test-*.sh': No such file or directory
DEBUG: chmod: cannot access `tests/*/sbin/*': No such file or directory
DEBUG: RPM build errors:
DEBUG: error: Bad exit status from /var/tmp/rpm-tmp.rCtw9y (%prep)
DEBUG:     Bad exit status from /var/tmp/rpm-tmp.rCtw9y (%prep)


Additional info:
The proposed change is required for Coverity to scan defects in downstream
patches separately.

Comment 1 Kamil Dudka 2011-05-27 20:34:55 UTC
Created attachment 501384 [details]
proposed fix

Comment 3 Richard W.M. Jones 2011-05-31 08:02:43 UTC
(In reply to comment #1)
> Created attachment 501384 [details]
> proposed fix

I'm unhappy about this fix because those lines could
fail silently during a normal build which would
indicate a serious build/configuration problem.

Is it possible instead to have an RPM variable set
when coverity testing without patches is being done,
so that the code can be disabled conditionally?  eg:

 rpm --define '__patch /bin/true' --define '__coverity_no_patches 1' ...

Comment 4 Kamil Dudka 2011-05-31 08:13:18 UTC
(In reply to comment #3)
> Is it possible instead to have an RPM variable set
> when coverity testing without patches is being done,
> so that the code can be disabled conditionally?  eg:
> 
>  rpm --define '__patch /bin/true' --define '__coverity_no_patches 1' ...

Sure thing.  The '_with_vanilla 1' RPM macro definition seems to be a good candidate for that since it is already being used by kernel.spec and some other packages.  The only difference there is that it also excludes the patches when specified.

Comment 6 Richard W.M. Jones 2011-05-31 10:30:38 UTC
OK, dev-ack'd for 6.2.  I will add a bit of conditional
code to make sure it compiles when _with_vanilla is defined.

Comment 7 Richard W.M. Jones 2011-08-11 11:36:35 UTC
In fact the test in comment 0 just works fine with the
rebased package.

Comment 9 Jinxin Zheng 2011-09-01 08:33:37 UTC
I reproduced this on virt-what-1.3-4.4.el6.src.rpm, running:

rpmbuild --define '__patch /bin/true' --rebuild
virt-what-1.3-4.4.el6.src.rpm

the script fails to build.

Verfied on the virt-what-1.11-1.1.el6.src.rpm. The script succeeds to build and returns with exit status 0.

Comment 10 errata-xmlrpc 2011-12-06 09:57:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2011-1556.html