diff -Nru launchpad-buildd-132~162~ubuntu12.04.1/debian/bzr-builder.manifest launchpad-buildd-133~164~ubuntu12.04.1/debian/bzr-builder.manifest --- launchpad-buildd-132~162~ubuntu12.04.1/debian/bzr-builder.manifest 2015-07-15 11:16:25.000000000 +0000 +++ launchpad-buildd-133~164~ubuntu12.04.1/debian/bzr-builder.manifest 2015-07-16 13:16:36.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}~162 -lp:launchpad-buildd revid:cjwatson@canonical.com-20150715110934-wtkicv46dnkefp12 +# bzr-builder format 0.3 deb-version {debupstream}~164 +lp:launchpad-buildd revid:cjwatson@canonical.com-20150716130335-l89w5itjou90xspj diff -Nru launchpad-buildd-132~162~ubuntu12.04.1/debian/changelog launchpad-buildd-133~164~ubuntu12.04.1/debian/changelog --- launchpad-buildd-132~162~ubuntu12.04.1/debian/changelog 2015-07-15 11:16:25.000000000 +0000 +++ launchpad-buildd-133~164~ubuntu12.04.1/debian/changelog 2015-07-16 13:16:36.000000000 +0000 @@ -1,8 +1,18 @@ -launchpad-buildd (132~162~ubuntu12.04.1) precise; urgency=low +launchpad-buildd (133~164~ubuntu12.04.1) precise; urgency=low * Auto build. - -- Launchpad Package Builder Wed, 15 Jul 2015 11:16:25 +0000 + -- Launchpad Package Builder Thu, 16 Jul 2015 13:16:36 +0000 + +launchpad-buildd (133) UNRELEASED; urgency=medium + + * Liberalise dep-wait matching regexes slightly so that they match + multi-line output properly, as in the case where multiple + build-dependencies are uninstallable. + * If there is a mix of definite and dubious dep-wait output, then analyse + the situation rather than trusting just the definite information. + + -- Colin Watson Thu, 16 Jul 2015 14:00:16 +0100 launchpad-buildd (132) trusty; urgency=medium diff -Nru launchpad-buildd-132~162~ubuntu12.04.1/lpbuildd/binarypackage.py launchpad-buildd-133~164~ubuntu12.04.1/lpbuildd/binarypackage.py --- launchpad-buildd-132~162~ubuntu12.04.1/lpbuildd/binarypackage.py 2015-07-15 11:16:25.000000000 +0000 +++ launchpad-buildd-133~164~ubuntu12.04.1/lpbuildd/binarypackage.py 2015-07-16 13:16:35.000000000 +0000 @@ -49,16 +49,16 @@ GIVENBACK = [ ("^E: There are problems and -y was used without --force-yes"), ] - DEPFAIL = { - 'The following packages have unmet dependencies:\n' - '.*: Depends: (?P

[^ ]*( \([^)]*\))?) (%s)\n' - % '|'.join(APT_MISSING_DEP_PATTERNS): "\g

", - } MAYBEDEPFAIL = [ 'The following packages have unmet dependencies:\n' - '.*: Depends: [^ ]*( \([^)]*\))? (%s)\n' + '.* Depends: [^ ]*( \([^)]*\))? (%s)\n' % '|'.join(APT_DUBIOUS_DEP_PATTERNS), ] + DEPFAIL = { + 'The following packages have unmet dependencies:\n' + '.* Depends: (?P

[^ ]*( \([^)]*\))?) (%s)\n' + % '|'.join(APT_MISSING_DEP_PATTERNS): "\g

", + } class BinaryPackageBuildState(DebianBuildState): @@ -272,10 +272,10 @@ pass tail = log.read(4096) if re.search("^Fail-Stage: install-deps$", tail, re.M): - for rx in BuildLogRegexes.DEPFAIL: - log_patterns.append([rx, re.M]) for rx in BuildLogRegexes.MAYBEDEPFAIL: - log_patterns.append([rx, re.M]) + log_patterns.append([rx, re.M | re.S]) + for rx in BuildLogRegexes.DEPFAIL: + log_patterns.append([rx, re.M | re.S]) missing_dep = None if log_patterns: @@ -284,9 +284,6 @@ # It was givenback, but we can't see a valid reason. # Assume it failed. success = SBuildExitCodes.FAILED - elif rx in BuildLogRegexes.DEPFAIL: - # A depwait match forces depwait. - missing_dep = mo.expand(BuildLogRegexes.DEPFAIL[rx]) elif rx in BuildLogRegexes.MAYBEDEPFAIL: # These matches need further analysis. dscpath = os.path.join( @@ -296,6 +293,9 @@ self.getAvailablePackages()) if missing_dep is None: success = SBuildExitCodes.FAILED + elif rx in BuildLogRegexes.DEPFAIL: + # A depwait match forces depwait. + missing_dep = mo.expand(BuildLogRegexes.DEPFAIL[rx]) else: # Otherwise it was a givenback pattern, so leave it # in givenback. diff -Nru launchpad-buildd-132~162~ubuntu12.04.1/lpbuildd/tests/test_binarypackage.py launchpad-buildd-133~164~ubuntu12.04.1/lpbuildd/tests/test_binarypackage.py --- launchpad-buildd-132~162~ubuntu12.04.1/lpbuildd/tests/test_binarypackage.py 2015-07-15 11:16:25.000000000 +0000 +++ launchpad-buildd-133~164~ubuntu12.04.1/lpbuildd/tests/test_binarypackage.py 2015-07-16 13:16:35.000000000 +0000 @@ -517,6 +517,44 @@ self.assertFalse(self.slave.wasCalled('buildFail')) self.assertEqual([(("ebadver (>= 2)",), {})], self.slave.depFail.calls) + def test_uninstallable_deps_analysis_mixed_depfail(self): + # If there is a mix of definite and dubious dep-wait output, then + # the build manager analyses the situation rather than trusting just + # the definite information. + write_file( + os.path.join(self.buildmanager._cachepath, "123"), + dedent("""\ + Package: foo + Version: 1 + Build-Depends: ebadver (>= 2), uninstallable + """)) + self.startBuild(dscname="123") + write_file( + os.path.join(self.buildmanager._cachepath, 'buildlog'), + "The following packages have unmet dependencies:\n" + + (" sbuild-build-depends-hello-dummy : Depends: ebadver (>= 2) " + "but it is not going to be installed\n") + + (" Depends: uninstallable " + "but it is not installable\n") + + "E: Unable to correct problems, you have held broken packages.\n" + + ("a" * 4096) + "\n" + + "Fail-Stage: install-deps\n") + apt_lists = os.path.join(self.chrootdir, "var", "lib", "apt", "lists") + os.makedirs(apt_lists) + write_file( + os.path.join(apt_lists, "archive_Packages"), + dedent("""\ + Package: ebadver + Version: 1 + + Package: uninstallable + Version: 1 + """)) + self.assertScansSanely(SBuildExitCodes.GIVENBACK) + self.assertUnmountsSanely() + self.assertFalse(self.slave.wasCalled('buildFail')) + self.assertEqual([(("ebadver (>= 2)",), {})], self.slave.depFail.calls) + def test_depfail_with_unknown_error_converted_to_packagefail(self): # The build manager converts a DEPFAIL to a PACKAGEFAIL if the # missing dependency can't be determined from the log.