Merge lp:~wgrant/launchpad-buildd/bug-1460363 into lp:launchpad-buildd

Proposed by William Grant
Status: Merged
Merged at revision: 149
Proposed branch: lp:~wgrant/launchpad-buildd/bug-1460363
Merge into: lp:launchpad-buildd
Diff against target: 103 lines (+46/-11)
3 files modified
debian/changelog (+6/-0)
lpbuildd/binarypackage.py (+10/-1)
lpbuildd/tests/test_binarypackage.py (+30/-10)
To merge this branch: bzr merge lp:~wgrant/launchpad-buildd/bug-1460363
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+260666@code.launchpad.net

Commit message

Tighten apt depwait parsing to not return uninstallable deps as missing.

Description of the change

The new lpbuildd.binarypackage depwait regular expression counted errors like "but it is not going to be installed" as missing dependencies. But that error means the package exists but its deps aren't satisfiable, so retry-depwait retries the build in a loop.

This branch tightens the expression to match only patterns that indicate missing deps or bad versions.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-05-26 01:27:37 +0000
3+++ debian/changelog 2015-05-31 23:44:08 +0000
4@@ -1,3 +1,9 @@
5+launchpad-buildd (129) UNRELEASED; urgency=low
6+
7+ * Tighten apt depwait parsing to not return uninstallable deps as missing.
8+
9+ -- William Grant <wgrant@ubuntu.com> Mon, 01 Jun 2015 09:39:37 +1000
10+
11 launchpad-buildd (128) trusty; urgency=medium
12
13 [ Colin Watson ]
14
15=== modified file 'lpbuildd/binarypackage.py'
16--- lpbuildd/binarypackage.py 2015-05-12 02:03:53 +0000
17+++ lpbuildd/binarypackage.py 2015-05-31 23:44:08 +0000
18@@ -17,6 +17,14 @@
19 BUILDERFAIL = 4
20
21
22+APT_MISSING_DEP_PATTERNS = [
23+ 'but [^ ]* is to be installed',
24+ 'but [^ ]* is installed',
25+ 'but it is not installable',
26+ 'but it is a virtual package',
27+ ]
28+
29+
30 class BuildLogRegexes:
31 """Build log regexes for performing actions based on regexes, and extracting dependencies for auto dep-waits"""
32 GIVENBACK = [
33@@ -24,7 +32,8 @@
34 ]
35 DEPFAIL = {
36 'The following packages have unmet dependencies:\n'
37- '.*: Depends: (?P<p>[^ ]*( \([^)]*\))?)': "\g<p>",
38+ '.*: Depends: (?P<p>[^ ]*( \([^)]*\))?) (%s)\n'
39+ % '|'.join(APT_MISSING_DEP_PATTERNS): "\g<p>",
40 }
41
42
43
44=== modified file 'lpbuildd/tests/test_binarypackage.py'
45--- lpbuildd/tests/test_binarypackage.py 2015-05-11 10:45:32 +0000
46+++ lpbuildd/tests/test_binarypackage.py 2015-05-31 23:44:08 +0000
47@@ -250,26 +250,46 @@
48 self.assertUnmountsSanely()
49 self.assertTrue(self.slave.wasCalled('buildFail'))
50
51- def test_detects_depfail(self):
52- # The build manager detects dependency installation failures.
53+ def assertMatchesDepfail(self, error, dep):
54 self.startBuild()
55 write_file(
56 os.path.join(self.buildmanager._cachepath, 'buildlog'),
57 "The following packages have unmet dependencies:\n"
58- + " sbuild-build-depends-hello-dummy : Depends: enoent but it is "
59- + "not installable\n"
60+ + (" sbuild-build-depends-hello-dummy : Depends: %s\n" % error)
61 + "E: Unable to correct problems, you have held broken packages.\n"
62 + ("a" * 4096) + "\n"
63 + "Fail-Stage: install-deps\n")
64
65- # After building the package, reap processes.
66 self.assertScansSanely(SBuildExitCodes.GIVENBACK)
67- self.assertFalse(self.slave.wasCalled('buildFail'))
68- self.assertEqual([(("enoent",), {})], self.slave.depFail.calls)
69-
70- # Control returns to the DebianBuildManager in the UMOUNT state.
71 self.assertUnmountsSanely()
72- self.assertFalse(self.slave.wasCalled('buildFail'))
73+ if dep is not None:
74+ self.assertFalse(self.slave.wasCalled('buildFail'))
75+ self.assertEqual([((dep,), {})], self.slave.depFail.calls)
76+ else:
77+ self.assertFalse(self.slave.wasCalled('depFail'))
78+ self.assertTrue(self.slave.wasCalled('buildFail'))
79+
80+ def test_detects_depfail(self):
81+ # The build manager detects dependency installation failures.
82+ self.assertMatchesDepfail(
83+ "enoent but it is not installable", "enoent")
84+
85+ def test_detects_versioned_depfail(self):
86+ # The build manager detects dependency installation failures.
87+ self.assertMatchesDepfail(
88+ "ebadver (< 2.0) but 3.0 is to be installed", "ebadver (< 2.0)")
89+
90+ def test_detects_versioned_current_depfail(self):
91+ # The build manager detects dependency installation failures.
92+ self.assertMatchesDepfail(
93+ "ebadver (< 2.0) but 3.0 is installed", "ebadver (< 2.0)")
94+
95+ def test_uninstallable_deps_fail(self):
96+ # Uninstallable build dependencies are considered to be
97+ # failures, as we can't determine installability to
98+ # automatically retry.
99+ self.assertMatchesDepfail(
100+ "ebadver but it is not going to be installed", None)
101
102 def test_depfail_with_unknown_error_converted_to_packagefail(self):
103 # The build manager converts a DEPFAIL to a PACKAGEFAIL if the

Subscribers

People subscribed via source and target branches

to all changes: