Merge lp:~abentley/launchpad/no-chroot-builder into lp:launchpad

Proposed by Aaron Bentley on 2010-08-25
Status: Merged
Approved by: Paul Hummer on 2010-08-25
Approved revision: no longer in the source branch.
Merged at revision: 11587
Proposed branch: lp:~abentley/launchpad/no-chroot-builder
Merge into: lp:launchpad
Diff against target: 86 lines (+18/-20)
2 files modified
lib/canonical/buildd/buildrecipe (+17/-19)
lib/canonical/buildd/debian/control (+1/-1)
To merge this branch: bzr merge lp:~abentley/launchpad/no-chroot-builder
Reviewer Review Type Date Requested Status
Paul Hummer (community) 2010-08-25 Approve on 2010-08-25
Review via email: mp+33674@code.launchpad.net

Description of the Change

= Summary =
Fix bug #599100: Recipe builds should have debianized tree built previous to
building the source package

== Proposed fix ==
Build the tree using bzr from outside the chroot, so that only the host OS
needs to support bzr-builder.

== Pre-implementation notes ==
Discussed with thumper, rockstar

== Implementation details ==
Since bzr-builder is now run in the host environment, launchpad-buildd now
depends on bzr-builder.

== Tests ==
Only interactive tests are possible for this code.

== Demo and Q/A ==
Create a source package recipe build targetting Jaunty. It should succeed.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/canonical/buildd/buildrecipe
  lib/canonical/buildd/debian/control

./lib/canonical/buildd/debian/control
      11: Line exceeds 78 characters.

To post a comment you must log in.
Paul Hummer (rockstar) wrote :

Wow, that patch is surprisingly small for what it does.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/buildd/buildrecipe'
2--- lib/canonical/buildd/buildrecipe 2010-08-25 20:04:40 +0000
3+++ lib/canonical/buildd/buildrecipe 2010-09-17 14:36:01 +0000
4@@ -55,8 +55,8 @@
5 """
6 # XXX: AaronBentley 2010-07-07 bug=602463: pbuilder uses aptitude but
7 # does not depend on it.
8- return self.chroot(['apt-get', 'install', '-y', 'pbuilder',
9- 'bzr-builder', 'sudo', 'aptitude'])
10+ return self.chroot([
11+ 'apt-get', 'install', '-y', 'pbuilder', 'aptitude'])
12
13 def buildTree(self):
14 """Build the recipe into a source tree.
15@@ -65,11 +65,8 @@
16 :return: a retcode from `bzr dailydeb`.
17 """
18 assert not os.path.exists(self.tree_path)
19- recipe_path_relative = os.path.join(self.work_dir_relative, 'recipe')
20- self.tree_path_relative = os.path.join(self.work_dir_relative, 'tree')
21- manifest_path_relative = os.path.join(
22- self.tree_path_relative, 'manifest')
23- recipe_path = os.path.join(self.chroot_path, recipe_path_relative[1:])
24+ recipe_path = os.path.join(self.work_dir, 'recipe')
25+ manifest_path = os.path.join(self.tree_path, 'manifest')
26 recipe_file = open(recipe_path, 'rb')
27 try:
28 recipe = recipe_file.read()
29@@ -82,20 +79,21 @@
30
31 print 'Building recipe:'
32 print recipe
33- retcode = self.chroot([
34- 'sudo', '-i', '-u', self.username, 'DEBEMAIL=%s' % self.author_email,
35- 'DEBFULLNAME=%s' % self.author_name.encode('utf-8'),
36- 'BZR_EMAIL=%s' % bzr_email, 'bzr',
37- 'dailydeb', '--no-build', recipe_path_relative,
38- self.tree_path_relative, '--manifest', manifest_path_relative,
39- '--append-version', '~%s1' % self.distroseries_name],
40- echo=True)
41+ sys.stdout.flush()
42+ env = {
43+ 'DEBEMAIL': self.author_email,
44+ 'DEBFULLNAME': self.author_name.encode('utf-8'),
45+ 'BZR_EMAIL': bzr_email}
46+ retcode = call([
47+ 'bzr', 'dailydeb', '--no-build', recipe_path,
48+ self.tree_path, '--manifest', manifest_path,
49+ '--append-version', '~%s1' % self.distroseries_name], env=env)
50 if retcode != 0:
51 return retcode
52 (source,) = [name for name in os.listdir(self.tree_path)
53 if name != 'manifest']
54- self.source_dir_relative = os.path.join(self.tree_path_relative,
55- source)
56+ self.source_dir_relative = os.path.join(
57+ self.work_dir_relative, 'tree', source)
58 return retcode
59
60 def getPackageName(self):
61@@ -163,10 +161,10 @@
62
63 if __name__ == '__main__':
64 builder = RecipeBuilder(*sys.argv[1:])
65+ if builder.buildTree() != 0:
66+ sys.exit(RETCODE_FAILURE_BUILD_TREE)
67 if builder.install() != 0:
68 sys.exit(RETCODE_FAILURE_INSTALL)
69- if builder.buildTree() != 0:
70- sys.exit(RETCODE_FAILURE_BUILD_TREE)
71 if builder.installBuildDeps() != 0:
72 sys.exit(RETCODE_FAILURE_INSTALL_BUILD_DEPS)
73 if builder.buildSourcePackage() != 0:
74
75=== modified file 'lib/canonical/buildd/debian/control'
76--- lib/canonical/buildd/debian/control 2010-07-22 16:15:58 +0000
77+++ lib/canonical/buildd/debian/control 2010-09-17 14:36:01 +0000
78@@ -8,7 +8,7 @@
79 Package: launchpad-buildd
80 Section: misc
81 Architecture: all
82-Depends: python-twisted-core, python-twisted-web, debootstrap, dpkg-dev, linux32, file, bzip2, sudo, ntpdate, adduser, apt-transport-https, lsb-release, apache2, ${misc:Depends}
83+Depends: python-twisted-core, python-twisted-web, debootstrap, dpkg-dev, linux32, file, bzip2, sudo, ntpdate, adduser, apt-transport-https, lsb-release, apache2, bzr-builder, ${misc:Depends}
84 Description: Launchpad buildd slave
85 This is the launchpad buildd slave package. It contains everything needed to
86 get a launchpad buildd going apart from the database manipulation required to