Merge lp:~wgrant/launchpad/nai-fallback into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 17879
Proposed branch: lp:~wgrant/launchpad/nai-fallback
Merge into: lp:launchpad
Diff against target: 46 lines (+10/-10)
2 files modified
lib/lp/soyuz/adapters/buildarch.py (+2/-4)
lib/lp/soyuz/adapters/tests/test_buildarch.py (+8/-6)
To merge this branch: bzr merge lp:~wgrant/launchpad/nai-fallback
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+281434@code.launchpad.net

Commit message

determine_architecture_to_build now falls back if nai is unavailable.

Description of the change

determine_architecture_to_build now falls back if nai is unavailable.

Some archives don't permit nominatedarchindep, and classically we haven't created arch-indep builds at all in those cases. But since the rework last year we fall back to one of the available architectures whenever "all" is not the only term, and now we fall back in that case as well. "all now behaves like "any all", just without the architecture-specific builds.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

This will cause many extra builds in arch-restricted copy archives.

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 'lib/lp/soyuz/adapters/buildarch.py'
2--- lib/lp/soyuz/adapters/buildarch.py 2015-02-11 09:51:48 +0000
3+++ lib/lp/soyuz/adapters/buildarch.py 2015-12-31 00:02:25 +0000
4@@ -65,15 +65,13 @@
5
6 # Use the indep hint list if it's set, otherwise fall back to the
7 # main architecture list. If that's not set either (ie. it's just
8- # "all"), default to nominatedarchindep.
9+ # "all"), allow any available arch to be chosen.
10 if indep_hint_list:
11 indep_archs, _ = resolve_arch_spec(indep_hint_list, need_archs)
12 elif not indep_only:
13 indep_archs = set(build_archs)
14- elif nominated_arch_indep in need_archs:
15- indep_archs = set([nominated_arch_indep])
16 else:
17- indep_archs = set()
18+ indep_archs = set(need_archs)
19
20 indep_arch = None
21 if need_arch_indep:
22
23=== modified file 'lib/lp/soyuz/adapters/tests/test_buildarch.py'
24--- lib/lp/soyuz/adapters/tests/test_buildarch.py 2015-02-11 13:40:01 +0000
25+++ lib/lp/soyuz/adapters/tests/test_buildarch.py 2015-12-31 00:02:25 +0000
26@@ -122,12 +122,14 @@
27 self.assertArchsForHint(
28 'any-any', {'armel': False, 'hppa': False, 'i386': True})
29
30- def test_no_all_builds_when_nominatedarchindep_not_permitted(self):
31- # Some archives (eg. armel rebuilds) don't want arch-indep
32- # builds. If the nominatedarchindep architecture (normally
33- # i386) is omitted, no builds will be created for arch-indep
34- # sources.
35- self.assertArchsForHint('all', {}, allowed_arch_tags=['hppa'])
36+ def test_disallowed_nominatedarchindep_falls_back(self):
37+ # Some archives don't allow nominatedarchindep builds. In that
38+ # case, one of the other architectures is chosen.
39+ self.assertArchsForHint(
40+ 'any all', {'hppa': True, 'armel': False},
41+ allowed_arch_tags=['hppa', 'armel'])
42+ self.assertArchsForHint(
43+ 'all', {'hppa': True}, allowed_arch_tags=['hppa', 'armel'])
44
45 def test_indep_hint_only(self):
46 # Some packages need to build arch-indep builds on a specific