Bug 709043 - yum-builddep doesn't check the return code from doUtilBuildTransaction ... mock failures
Summary: yum-builddep doesn't check the return code from doUtilBuildTransaction ... mo...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: yum-utils
Version: 6.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact: Karel Srot
URL:
Whiteboard:
Depends On:
Blocks: 743047
TreeView+ depends on / blocked
 
Reported: 2011-05-30 13:14 UTC by Levente Farkas
Modified: 2014-01-21 06:23 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 17:35:18 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1703 0 normal SHIPPED_LIVE yum-utils bug fix and enhancement update 2011-12-06 01:02:31 UTC

Description Levente Farkas 2011-05-30 13:14:41 UTC
in the last few days i build a lots of packages and it seems mock getting worse. now even if the root stage failed it goes further to the build stage eg:
---------------------------------------------
DEBUG backend.py:739:  ['/usr/bin/yum-builddep', '--installroot', '/var/lib/mock/abc-6-x86_64/root/', '/var/lib/mock/abc-6-x86_64/root///builddir/build/SRPMS/mingw32-w32api-3.17-1.el6.src.rpm']
DEBUG util.py:284:  Executing command: ['/usr/bin/yum-builddep', '--installroot', '/var/lib/mock/abc-6-x86_64/root/', '/var/lib/mock/abc-6-x86_64/root///builddir/build/SRPMS/mingw32-w32api-3.17-1.el6
.src.rpm']
DEBUG util.py:250:  Getting requirements for mingw32-w32api-3.17-1.el6.src
DEBUG util.py:250:   --> mingw32-filesystem-69-2.el6.noarch
DEBUG util.py:250:   --> mingw32-binutils-2.21-2.el6.x86_64
DEBUG util.py:250:   --> mingw32-gcc-4.4.2-3.el6.1.x86_64
DEBUG util.py:250:   --> mingw32-runtime-3.18-1.el6.1.noarch
DEBUG util.py:250:  Error: Package: mingw32-pthreads-2.8.0-15.20110511cvs.fc16.noarch (mingw)
DEBUG util.py:250:             Requires: mingw32(libstdc++-6.dll)
DEBUG util.py:250:   You could try using --skip-broken to work around the problem
DEBUG util.py:250:   You could try running: rpm -Va --nofiles --nodigest
DEBUG util.py:250:  No uninstalled build requires
DEBUG util.py:323:  Child returncode was: 0
---------------------------------------------
as you can see it states Child returncode was: 0
and of course in this case build will fail since many BR missing!

the same thing happened with me a lots of packages and it cause a lots of headache for me:-(((

Comment 1 Levente Farkas 2011-06-01 06:49:20 UTC
what's more it's more serious since sometimes the whole build process runs without installing the BRs which create a totally broken results...

Comment 2 Giam Teck Choon 2011-06-07 12:15:16 UTC
I hit different error and created a patch to mock-1.1.10 which add an option to pass options to yum-builddep in mock via mock cfg file.  Can anyone review the attached patch which I used to build packages in mock-1.1.10 with this attached patched applied without problem?

--------------------8<----------------8<--------------------8<------------

From: Giam Teck Choon <choon>

This patch add support for passing options to yum-buildep via mock cfg
config_opts['yum_builddep_opts'] option. i.e.:

config_opts['yum_builddep_opts'] = '--nogpgcheck'

Without this patch, mock -r whatever-mock.cfg --installdeps
/path/to/whatever.src.rpm will result in the following error:

ERROR: Command failed: 
# /usr/bin/yum-builddep --installroot /var/lib/mock/config_opts['root']/root/ /path/to/whatever.src.rpm
warning: rpmts_HdrFromFdno: Header V4 RSA/SHA1 Signature, key ID e0da8890: NOKEY
Error: Could not open /path/to/whatever.src.rpm .
Try running yum-builddep with the --nogpgcheck option.
There was a problem getting the build deps, exiting:
  Could not open local rpm file: /path/to/whatever.src.rpm: RPM Error opening Package


diff -urN a/py/mock/backend.py b/py/mock/backend.py
--- a/py/mock/backend.py	2011-06-03 01:35:26.000000000 +0800
+++ b/py/mock/backend.py	2011-06-03 03:12:05.000000000 +0800
@@ -75,6 +75,7 @@
             self.chroot_setup_cmd = self.chroot_setup_cmd.split()
         self.yum_path = '/usr/bin/yum'
         self.yum_builddep_path = '/usr/bin/yum-builddep'
+        self.yum_builddep_opts = config['yum_builddep_opts']
         self.macros = config['macros']
         self.more_buildreqs = config['more_buildreqs']
         self.cache_topdir = config['cache_topdir']
@@ -732,6 +733,9 @@
         if cmd[0] == "builddep":
             yumcmd[0] = self.yum_builddep_path
             cmdix = 1
+       	    if self.yum_builddep_opts:
+                for eachopt in self.yum_builddep_opts.split():
+                    yumcmd.insert(1, '%s' % eachopt)
         yumcmd.extend(('--installroot', self.makeChrootPath()))
         if not self.online:
             yumcmd.append("-C")
diff -urN a/py/mock.py b/py/mock.py
--- a/py/mock.py	2011-06-03 01:35:26.000000000 +0800
+++ b/py/mock.py	2011-06-03 03:10:01.000000000 +0800
@@ -328,6 +328,7 @@
     config_opts['target_arch'] = 'i386'
     config_opts['rpmbuild_arch'] = None # <-- None means set automatically from target_arch
     config_opts['yum.conf'] = ''
+    config_opts['yum_builddep_opts'] = ''
     config_opts['more_buildreqs'] = {}
     config_opts['files'] = {}
     config_opts['macros'] = {

Comment 3 Levente Farkas 2011-06-07 12:28:34 UTC
how this related to my original report?
anyway may be this bug should have to reassign to yum?

Comment 4 Giam Teck Choon 2011-06-07 12:40:52 UTC
Ops... sorry.  I should have create a new bug report.  I mean this patch add option for you to pass to yum-builddep in mock.  Like if you want --skip-broken then you can use the following in mock cfg:

config_opts['yum_builddep_opts'] = '--skip-broken'

Comment 5 Levente Farkas 2011-06-07 12:50:53 UTC
no i wouldn't like t add --skip-broken i like that mock stop in case it's not able to install all deps.
but now it seems yum-builddep return with 0 even if it's not able to install all deps. which case mock goes further.

Comment 6 Giam Teck Choon 2011-06-07 13:24:51 UTC
Normally when you get your initial reported error about --skip-broken when using yum or yum-builddep, mostly I guess the repos. has some issues during the time you run yum or yum-builddeps... ... sorry for these additional posts... I will create a new bug report and leave this.  Once again, sorry.

Comment 7 Levente Farkas 2011-06-22 19:29:30 UTC
this problem is still exist and imho another serious one.

Comment 8 Clark Williams 2011-06-24 14:09:28 UTC

*** This bug has been marked as a duplicate of bug 716267 ***

Comment 9 Levente Farkas 2011-08-10 21:48:45 UTC
reopen it. since even it a duplicate of #716267 that is a fedora bug and can't be fix/build rhel-6 packages.

Comment 11 James Antill 2011-08-17 14:41:06 UTC
 This is a simple patch, and is in Fedora 15.

Comment 15 errata-xmlrpc 2011-12-06 17:35:18 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/RHBA-2011-1703.html


Note You need to log in before you can comment on or make changes to this bug.