From a5828a269e85e33262ed06c555e176a99b30b33c Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Thu, 18 Jun 2020 10:46:14 +0100 Subject: [PATCH] excusefinder: Support not having arch-all buildds On some distros (Ubuntu), arch:all packages are built along with one of the architectures. We shouldn't be listing 'all' as its own arch in this case. Instead we filter out the binaries except for on the 'all_buildarch'. --- britney.conf | 3 +++ britney.py | 2 ++ britney2/excusefinder.py | 16 ++++++++++++---- britney2/policies/autopkgtest.py | 3 ++- tests/test_policy.py | 1 + 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/britney.conf b/britney.conf index 163aff9..b984e0a 100644 --- a/britney.conf +++ b/britney.conf @@ -33,6 +33,9 @@ NOBREAKALL_ARCHES = i386 amd64 # primary architecture used for checking Build-Depends-Indep ALL_BUILDARCH = amd64 +# is arch-all built separately? i.e. can it fail independently of another arch? +HAS_ARCH_ALL_BUILDDS = yes + # if you're in this list, your packages may not stay in sync with the source OUTOFSYNC_ARCHES = diff --git a/britney.py b/britney.py index 51e4b23..25e7bba 100755 --- a/britney.py +++ b/britney.py @@ -518,6 +518,8 @@ class Britney(object): if not hasattr(self.options, 'adt_retry_url_mech'): self.options.adt_retry_url_mech = '' + self.options.has_arch_all_buildds = getattr(self.options, 'has_arch_all_buildds', 'yes') == 'yes' + self._policy_engine.add_policy(DependsPolicy(self.options, self.suite_info)) self._policy_engine.add_policy(RCBugPolicy(self.options, self.suite_info)) if getattr(self.options, 'piuparts_enable', 'yes') == 'yes': diff --git a/britney2/excusefinder.py b/britney2/excusefinder.py index 3a1144e..7371a89 100644 --- a/britney2/excusefinder.py +++ b/britney2/excusefinder.py @@ -327,7 +327,8 @@ class ExcuseFinder(object): # at this point, we check the status of the builds on all the supported architectures # to catch the out-of-date ones archs_to_consider = list(self.options.architectures) - archs_to_consider.append('all') + if self.options.has_arch_all_buildds: + archs_to_consider.append('all') for arch in archs_to_consider: oodbins = {} uptodatebins = False @@ -345,13 +346,20 @@ class ExcuseFinder(object): binary_u = all_binaries[pkg_id] pkgsv = binary_u.source_version - # arch:all packages are treated separately from arch:arch - if binary_u.architecture != arch: - continue + # arch:all packages are treated separately from arch:arch if + # they have their own buildds + if self.options.has_arch_all_buildds: + if binary_u.architecture != arch: + continue # TODO filter binaries based on checks below? excuse.add_package(pkg_id) + # If we don't have arch:all buildds, drop arch:all packages on + # the non-arch-all-buildd arch + if not self.options.has_arch_all_buildds and arch != self.options.all_buildarch and binary_u.architecture != arch: + continue + # if it wasn't built by the same source, it is out-of-date # if there is at least one binary on this arch which is # up-to-date, there is a build on this arch diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index 6cb37ae..63226f7 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -374,7 +374,8 @@ class AutopkgtestPolicy(BasePolicy): verdict = PolicyVerdict.REJECTED_TEMPORARILY excuse.add_verdict_info(verdict, "nothing built yet, autopkgtest delayed") - if 'all' in excuse.missing_builds: + if (self.options.has_arch_all_buildds and 'all' in excuse.missing_builds) or \ + (not self.options.has_arch_all_buildds and self.options.all_buildarch in excuse.missing_builds): self.logger.info('%s hasn''t been built for arch:all, skipping autopkgtest policy', source_name) verdict = PolicyVerdict.REJECTED_TEMPORARILY excuse.add_verdict_info(verdict, "arch:all not built yet, autopkgtest delayed") diff --git a/tests/test_policy.py b/tests/test_policy.py index 00af280..1952831 100644 --- a/tests/test_policy.py +++ b/tests/test_policy.py @@ -47,6 +47,7 @@ def initialize_policy(test_name, policy_class, *args, **kwargs): adt_regression_penalty=False, adt_retry_url_mech='run_id', fake_runtime=774000, + has_arch_all_buildds=True, **kwargs) suite_info = Suites( Suite(SuiteClass.TARGET_SUITE, target, os.path.join(test_dir, target), ''),