Merge lp:click/devel into lp:click

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 596
Merged at revision: 466
Proposed branch: lp:click/devel
Merge into: lp:click
Diff against target: 141 lines (+46/-25)
4 files modified
click/chroot.py (+10/-6)
click/tests/integration/test_build_core_apps.py (+26/-18)
click/tests/test_chroot.py (+1/-1)
debian/changelog (+9/-0)
To merge this branch: bzr merge lp:click/devel
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+281392@code.launchpad.net

Commit message

Click 0.4.42: Fix autopkgtests on non-x86 architectures.

Description of the change

Click 0.4.42: Fix autopkgtests on non-x86 architectures.

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 'click/chroot.py'
2--- click/chroot.py 2015-10-15 11:47:35 +0000
3+++ click/chroot.py 2015-12-29 01:24:59 +0000
4@@ -481,7 +481,11 @@
5 """).format(build_pkgs=' '.join(build_pkgs)))
6 return finish_script
7
8- def _debootstrap(self, components, mount, archive):
9+ def _debootstrap(self, components, mount, archive_mirror, ports_mirror):
10+ if self.native_arch in primary_arches:
11+ mirror = archive_mirror
12+ else:
13+ mirror = ports_mirror
14 subprocess.check_call([
15 "debootstrap",
16 "--arch", self.native_arch,
17@@ -489,7 +493,7 @@
18 "--components=%s" % ','.join(components),
19 self.series,
20 mount,
21- archive
22+ mirror,
23 ])
24
25 @property
26@@ -560,15 +564,15 @@
27 os.makedirs(mount)
28
29 country_code = get_geoip_country_code_prefix()
30- archive = "http://%sarchive.ubuntu.com/ubuntu" % country_code
31+ archive_mirror = "http://%sarchive.ubuntu.com/ubuntu" % country_code
32 ports_mirror = "http://%sports.ubuntu.com/ubuntu-ports" % country_code
33 # this doesn't work because we are running this under sudo
34 if 'DEBOOTSTRAP_MIRROR' in os.environ:
35- archive = os.environ['DEBOOTSTRAP_MIRROR']
36- self._debootstrap(components, mount, archive)
37+ archive_mirror = os.environ['DEBOOTSTRAP_MIRROR']
38+ self._debootstrap(components, mount, archive_mirror, ports_mirror)
39 sources = generate_sources(self.series, self.native_arch,
40 self.target_arch,
41- archive, ports_mirror,
42+ archive_mirror, ports_mirror,
43 ' '.join(components))
44 with open("%s/etc/apt/sources.list" % mount, "w") as sources_list:
45 for line in sources:
46
47=== modified file 'click/tests/integration/test_build_core_apps.py'
48--- click/tests/integration/test_build_core_apps.py 2014-09-04 21:06:46 +0000
49+++ click/tests/integration/test_build_core_apps.py 2015-12-29 01:24:59 +0000
50@@ -20,6 +20,7 @@
51 import os
52 import shutil
53 import subprocess
54+import unittest
55
56 from six import with_metaclass
57
58@@ -45,6 +46,9 @@
59 CORE_APP_MAKE_CMD = [
60 "make", "DESTDIR=%s" % CLICK_TARGET_DIR, "install"]
61
62+# architectures with native- or cross-compiling support for armhf
63+ALLOW_ARCHITECTURES = ["amd64", "arm64", "armhf", "i386"]
64+
65
66 def find_manifest(start_dir):
67 """Find a click manifest.json{,.in} under the given directory"""
68@@ -104,21 +108,25 @@
69 self.assertEqual(len(glob("*.click")), 1)
70
71 def _testbuild_branch(self, branch):
72- # get and parse
73- branch_dir = branch[len("lp:"):]
74- build_dir = os.path.join(branch_dir, "build-tree")
75- if os.path.exists(branch_dir):
76- subprocess.check_call(["bzr", "pull"], cwd=branch_dir)
77- else:
78- subprocess.check_call(["bzr", "branch", branch])
79- manifest = find_manifest(branch_dir)
80- # build it
81- self._set_arch_and_framework_from_manifest(manifest)
82- if os.path.exists(build_dir):
83- shutil.rmtree(build_dir)
84- os.makedirs(build_dir)
85- with chdir(build_dir):
86- self._ensure_click_chroot()
87- self.configure()
88- self.make()
89- self.create_click()
90+ system_arch = subprocess.check_output(
91+ ["dpkg", "--print-architecture"], universal_newlines=True).strip()
92+ if system_arch not in ALLOW_ARCHITECTURES:
93+ unittest.skip("%s has no armhf build support" % system_arch)
94+ # get and parse
95+ branch_dir = branch[len("lp:"):]
96+ build_dir = os.path.join(branch_dir, "build-tree")
97+ if os.path.exists(branch_dir):
98+ subprocess.check_call(["bzr", "pull"], cwd=branch_dir)
99+ else:
100+ subprocess.check_call(["bzr", "branch", branch])
101+ manifest = find_manifest(branch_dir)
102+ # build it
103+ self._set_arch_and_framework_from_manifest(manifest)
104+ if os.path.exists(build_dir):
105+ shutil.rmtree(build_dir)
106+ os.makedirs(build_dir)
107+ with chdir(build_dir):
108+ self._ensure_click_chroot()
109+ self.configure()
110+ self.make()
111+ self.create_click()
112
113=== modified file 'click/tests/test_chroot.py'
114--- click/tests/test_chroot.py 2015-10-06 19:33:35 +0000
115+++ click/tests/test_chroot.py 2015-12-29 01:24:59 +0000
116@@ -49,7 +49,7 @@
117 self._maint_kwargs = kwargs
118 return 0
119
120- def _debootstrap(self, components, mount, archive_server):
121+ def _debootstrap(self, components, mount, archive_mirror, ports_mirror):
122 os.makedirs(os.path.join(mount, "etc", "apt"))
123 os.makedirs(os.path.join(mount, "usr", "sbin"))
124 os.makedirs(os.path.join(mount, "sbin"))
125
126=== modified file 'debian/changelog'
127--- debian/changelog 2015-12-11 01:31:29 +0000
128+++ debian/changelog 2015-12-29 01:24:59 +0000
129@@ -1,3 +1,12 @@
130+click (0.4.42) UNRELEASED; urgency=medium
131+
132+ * chroot: Point debootstrap at ports.ubuntu.com for non-primary
133+ architectures.
134+ * Skip build_core_apps integration tests on architectures that lack
135+ support for native- or cross-compiling for armhf.
136+
137+ -- Colin Watson <cjwatson@ubuntu.com> Tue, 29 Dec 2015 01:05:36 +0000
138+
139 click (0.4.41+16.04.20151211-0ubuntu1) xenial; urgency=medium
140
141 [ Colin Watson ]

Subscribers

People subscribed via source and target branches

to all changes: