← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Andy Whitcroft has proposed merging ~apw/launchpad-buildd/+git/my:handle-build-depends-arch into launchpad-buildd:master.

Commit message:
Include Build-Depends-Arch when considering direct dependancies

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


Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1988999 in launchpad-buildd: "direct dependancies on Depends-Arch: are not correctly identified as depwait"
  https://bugs.launchpad.net/launchpad-buildd/+bug/1988999

For more details, see:
https://code.launchpad.net/~apw/launchpad-buildd/+git/my/+merge/429574
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~apw/launchpad-buildd/+git/my:handle-build-depends-arch into launchpad-buildd:master.
diff --git a/lpbuildd/binarypackage.py b/lpbuildd/binarypackage.py
index 96685c5..c3fef09 100644
--- a/lpbuildd/binarypackage.py
+++ b/lpbuildd/binarypackage.py
@@ -250,7 +250,7 @@ class BinaryPackageBuildManager(DebianBuildManager):
         deps = []
         with open(dscpath, "rb") as dscfile:
             dsc = Dsc(dscfile)
-            fields = ["Build-Depends"]
+            fields = ["Build-Depends", "Build-Depends-Arch"]
             if arch_indep:
                 fields.append("Build-Depends-Indep")
             for field in fields:
diff --git a/lpbuildd/tests/test_binarypackage.py b/lpbuildd/tests/test_binarypackage.py
index 9e3e155..71982d4 100644
--- a/lpbuildd/tests/test_binarypackage.py
+++ b/lpbuildd/tests/test_binarypackage.py
@@ -418,6 +418,7 @@ class TestBinaryPackageBuildManagerIteration(TestCase):
             dedent("""\
                 Package: foo
                 Build-Depends: debhelper (>= 9~), bar | baz
+                Build-Depends-Arch: qux
                 Build-Depends-Indep: texlive-base
                 """))
         self.assertThat(
@@ -432,6 +433,9 @@ class TestBinaryPackageBuildManagerIteration(TestCase):
                 MatchesListwise([
                     ContainsDict({"name": Equals("bar"), "version": Is(None)}),
                     ContainsDict({"name": Equals("baz"), "version": Is(None)}),
+                    ]),
+                MatchesListwise([
+                    ContainsDict({"name": Equals("qux"), "version": Is(None)}),
                     ])]))
 
     def test_getBuildDepends_arch_indep(self):

Follow ups