Merge ~apw/launchpad-buildd/+git/my:handle-build-depends-arch into launchpad-buildd:master

Proposed by Andy Whitcroft
Status: Merged
Approved by: Colin Watson
Approved revision: a857f058afcff2b30e9a4ced67188decfbcb8e8e
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~apw/launchpad-buildd/+git/my:handle-build-depends-arch
Merge into: launchpad-buildd:master
Diff against target: 84 lines (+19/-4)
3 files modified
debian/changelog (+7/-0)
lpbuildd/binarypackage.py (+1/-1)
lpbuildd/tests/test_binarypackage.py (+11/-3)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+429574@code.launchpad.net

Commit message

Include Build-Depends-Arch when considering direct dependencies

When we consider if reported missing dependency is likely reliable we consider whether it is a direct dependency. Currently we check Build-Depends: and Build-Depends-Indep: for this. Direct dependencies on Build-Depends-Arch are not considered. Add these as well.

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

Could you add a debian/changelog entry for this?

Revision history for this message
Andy Whitcroft (apw) wrote :

Ok, hopefully that covers all of the review comments.

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
1diff --git a/debian/changelog b/debian/changelog
2index f1af9cc..f458954 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+launchpad-buildd (221 UNRELEASED; urgency=medium
7+
8+ * Include Build-Depends-Arch when considering direct dependancies
9+ (LP: #1988999)
10+
11+ -- Andy Whitcroft <apw@canonical.com> Wed, 07 Sep 2022 20:47:49 +0100
12+
13 launchpad-buildd (220) focal; urgency=medium
14
15 * Work around https://github.com/lxc/lxcfs/issues/553 by unmounting
16diff --git a/lpbuildd/binarypackage.py b/lpbuildd/binarypackage.py
17index 96685c5..c3fef09 100644
18--- a/lpbuildd/binarypackage.py
19+++ b/lpbuildd/binarypackage.py
20@@ -250,7 +250,7 @@ class BinaryPackageBuildManager(DebianBuildManager):
21 deps = []
22 with open(dscpath, "rb") as dscfile:
23 dsc = Dsc(dscfile)
24- fields = ["Build-Depends"]
25+ fields = ["Build-Depends", "Build-Depends-Arch"]
26 if arch_indep:
27 fields.append("Build-Depends-Indep")
28 for field in fields:
29diff --git a/lpbuildd/tests/test_binarypackage.py b/lpbuildd/tests/test_binarypackage.py
30index 9e3e155..9b1a0fa 100644
31--- a/lpbuildd/tests/test_binarypackage.py
32+++ b/lpbuildd/tests/test_binarypackage.py
33@@ -409,7 +409,7 @@ class TestBinaryPackageBuildManagerIteration(TestCase):
34 self.assertEqual(expected, self.buildmanager.getAvailablePackages())
35
36 def test_getBuildDepends_arch_dep(self):
37- # getBuildDepends returns only Build-Depends for
38+ # getBuildDepends returns Build-Depends and Build-Depends-Arch for
39 # architecture-dependent builds.
40 dscpath = os.path.join(
41 self.working_dir, "build-%s" % self.buildid, "foo.dsc")
42@@ -418,6 +418,7 @@ class TestBinaryPackageBuildManagerIteration(TestCase):
43 dedent("""\
44 Package: foo
45 Build-Depends: debhelper (>= 9~), bar | baz
46+ Build-Depends-Arch: qux
47 Build-Depends-Indep: texlive-base
48 """))
49 self.assertThat(
50@@ -432,11 +433,14 @@ class TestBinaryPackageBuildManagerIteration(TestCase):
51 MatchesListwise([
52 ContainsDict({"name": Equals("bar"), "version": Is(None)}),
53 ContainsDict({"name": Equals("baz"), "version": Is(None)}),
54+ ]),
55+ MatchesListwise([
56+ ContainsDict({"name": Equals("qux"), "version": Is(None)}),
57 ])]))
58
59 def test_getBuildDepends_arch_indep(self):
60- # getBuildDepends returns both Build-Depends and Build-Depends-Indep
61- # for architecture-independent builds.
62+ # getBuildDepends returns Build-Depends, Build-Depends-Arch, and
63+ # Build-Depends-Indep for architecture-independent builds.
64 dscpath = os.path.join(
65 self.working_dir, "build-%s" % self.buildid, "foo.dsc")
66 write_file(
67@@ -444,6 +448,7 @@ class TestBinaryPackageBuildManagerIteration(TestCase):
68 dedent("""\
69 Package: foo
70 Build-Depends: debhelper (>= 9~), bar | baz
71+ Build-Depends-Arch: qux
72 Build-Depends-Indep: texlive-base
73 """))
74 self.assertThat(
75@@ -460,6 +465,9 @@ class TestBinaryPackageBuildManagerIteration(TestCase):
76 ContainsDict({"name": Equals("baz"), "version": Is(None)}),
77 ]),
78 MatchesListwise([
79+ ContainsDict({"name": Equals("qux"), "version": Is(None)}),
80+ ]),
81+ MatchesListwise([
82 ContainsDict({
83 "name": Equals("texlive-base"),
84 "version": Is(None),

Subscribers

People subscribed via source and target branches