Merge lp:~jml/pkgme/rollback-r121 into lp:pkgme

Proposed by Jonathan Lange
Status: Merged
Approved by: James Westby
Approved revision: 122
Merged at revision: 122
Proposed branch: lp:~jml/pkgme/rollback-r121
Merge into: lp:pkgme
Diff against target: 155 lines (+4/-75)
6 files modified
pkgme/bin/main.py (+1/-5)
pkgme/debuild.py (+0/-28)
pkgme/package_files.py (+1/-1)
pkgme/tests/test_debuild.py (+0/-38)
pkgme/tests/test_package_files.py (+1/-1)
pkgme/tests/test_script.py (+1/-2)
To merge this branch: bzr merge lp:~jml/pkgme/rollback-r121
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+115981@code.launchpad.net

Commit message

Rollback r121, as it is breaking nagios checks on staging

Description of the change

Our staging end-to-end checks are failing with the following error (lightly formatted by me)

liam@emim:/etc/nagios/nrpe.d$ /usr/local/lib/nagios/plugins/check_pkgme_e2e.sh /srv/pkgme-service-staging.canonical.com/staging/pkgme-service /srv/pkgme-service-staging.canonical.com/var/nagios/pkgme-e2e.out
Check failed in 8.129219: Failed to build package:
    debuild --no-lintian -S -uc -us failed with returncode 29. Output:
   | sh: 1: gcc: not found
   | dpkg-architecture: warning: Couldn't determine gcc system type, falling back to default (native compilation)
   | dpkg-buildpackage -rfakeroot -d -us -uc -S
   | dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
   | dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): -D_FORTIFY_SOURCE=2
   | dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
   | dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
   | dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): -Wl,-Bsymbolic-functions -Wl,-z,relro
   | dpkg-buildpackage: source package jabberwocky
   | dpkg-buildpackage: source version 0
   | dpkg-buildpackage: source changed by pkgme-service bot <email address hidden>
   | sh: 1: gcc: not found
   | dpkg-architecture: warning: Couldn't determine gcc system type, falling back to default (native compilation)
   | dpkg-source --before-build jabberwocky
   | fakeroot debian/rules clean
   | dh clean
   | dh_testdir
   | dh_auto_clean
   | sh: 1: gcc: not found
   | dpkg-architecture: warning: Couldn't determine gcc system type, falling back to default (native compilation)
   | dh_clean
   | dpkg-source -b jabberwocky
   | dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../jabberwocky_0.orig.tar.{bz2,gz,lzma,xz}
   | dpkg-buildpackage: error: dpkg-source -b jabberwocky gave error exit status 255
   | debuild: fatal error at line 1350:
   | dpkg-buildpackage -rfakeroot -d -us -uc -S failed

   Other data: {u'dependencies': [], u'packaged_app_url': None, u'pkgme_distro_arch_series': [], u'pkgme_extra_data': {u'executable': None}}

This branch rolls back the latest changes to pkgme in the hope that it will fix this error.

jml

To post a comment you must log in.
Revision history for this message
James Westby (james-w) :
review: Approve
Revision history for this message
James Westby (james-w) wrote :

pkgme-service doesn't use the functions to build a package, just the ones to
write the packaging, then it builds the package itself.

Therefore I think this needs to be landed with a change to pkgme-service
to also call the new build_orig_tar_gz function.

Thanks,

James

Revision history for this message
Jonathan Lange (jml) wrote :

Oh, also, to make sure this can't happen again, either:
  a) add an acceptance test, somewhere
  b) do the Continuous Deployment stuff James & I have planned.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pkgme/bin/main.py'
2--- pkgme/bin/main.py 2012-07-19 18:24:55 +0000
3+++ pkgme/bin/main.py 2012-07-20 13:18:21 +0000
4@@ -11,10 +11,7 @@
5 get_backend_selector,
6 get_default_loader,
7 )
8-from pkgme.debuild import (
9- build_orig_tar_gz,
10- build_source_package,
11- )
12+from pkgme.debuild import build_source_package
13 from pkgme.upload import (
14 InvalidPPAName,
15 parse_ppa_name,
16@@ -138,7 +135,6 @@
17 sign = None
18 else:
19 sign = not options.nosign
20- build_orig_tar_gz(target_dir)
21 build_package(
22 target_dir, interactive=interactive, ppa=options.ppa,
23 sign=sign)
24
25=== modified file 'pkgme/debuild.py'
26--- pkgme/debuild.py 2012-07-20 05:24:05 +0000
27+++ pkgme/debuild.py 2012-07-20 13:18:21 +0000
28@@ -1,8 +1,6 @@
29 import os
30 import re
31
32-from debian.changelog import Changelog
33-
34 from pkgme.run_script import run_subprocess
35
36
37@@ -16,35 +14,9 @@
38
39
40 def build_source_package(directory, sign=True):
41- """Build a source package using debuild"""
42 cmd = ['debuild', '--no-lintian', '-S']
43 if not sign:
44 cmd.extend(['-uc', '-us'])
45 output = run_subprocess(cmd, cwd=directory)
46 changes_file = find_changes_file(output)
47 return os.path.abspath(os.path.join(directory, changes_file))
48-
49-
50-def build_orig_tar_gz(target_dir):
51- """Build a pkgname_version.orig.tar.gz from the target_dir
52-
53- Note that this will expect a debian/ directory in the target_dir
54- to gather pkgname/version but it will (of course) exclude debian/
55- from the resulting .orig.tar.gz
56- """
57- changelog = Changelog(
58- open(os.path.join(target_dir, "debian", "changelog")))
59- pkgname = changelog.get_package()
60- version = changelog.get_version()
61- target_file = os.path.join(
62- target_dir, "..", "%s_%s.orig.tar.gz" % (pkgname, version))
63- cmd = ["tar",
64- "-c",
65- "-z",
66- "--exclude", "debian",
67- "--transform", "s,.,%s-%s," % (pkgname, version),
68- "-f", target_file,
69- ".",
70- ]
71- run_subprocess(cmd, cwd=target_dir)
72- return target_file
73
74=== modified file 'pkgme/package_files.py'
75--- pkgme/package_files.py 2012-07-20 05:28:38 +0000
76+++ pkgme/package_files.py 2012-07-20 13:18:21 +0000
77@@ -249,7 +249,7 @@
78 filename = "source/format"
79
80 def get_contents(self):
81- return "3.0 (quilt)\n"
82+ return "1.0\n"
83
84
85 default_package_file_group.add_file_cls(SourceFormat)
86
87=== removed file 'pkgme/tests/test_debuild.py'
88--- pkgme/tests/test_debuild.py 2012-07-20 05:24:05 +0000
89+++ pkgme/tests/test_debuild.py 1970-01-01 00:00:00 +0000
90@@ -1,38 +0,0 @@
91-import os
92-import tarfile
93-
94-from testtools import TestCase
95-
96-from pkgme.debuild import build_orig_tar_gz
97-from pkgme.testing import (
98- TempdirFixture,
99- )
100-
101-class DebuildTestCase(TestCase):
102-
103- def test_build_orig_tar_gz(self):
104- tempdir = self.useFixture(TempdirFixture())
105- pkgdir = os.path.join(tempdir.path, "testpkg")
106- # setup fake env
107- os.makedirs(os.path.join(pkgdir, "debian"))
108- changelog_path = os.path.join(pkgdir, "debian", "changelog")
109- with open(changelog_path, "w") as f:
110- f.write("""
111-testpkg (0.1) unstable; urgency=low
112-
113- * some changes
114-
115- -- Some Guy <foo@example.com> Thu, 19 Apr 2012 10:53:30 +0200
116-""")
117- with open(os.path.join(pkgdir, "canary"), "w") as f:
118- f.write("pieep")
119- # build it
120- result_path = build_orig_tar_gz(pkgdir)
121- # verify
122- self.assertEqual(
123- "testpkg_0.1.orig.tar.gz", os.path.basename(result_path))
124- with tarfile.open(result_path) as f:
125- self.assertEqual(
126- ["testpkg-0.1", "testpkg-0.1/canary"],
127- [m.name for m in f.getmembers()])
128-
129
130=== modified file 'pkgme/tests/test_package_files.py'
131--- pkgme/tests/test_package_files.py 2012-07-20 05:28:38 +0000
132+++ pkgme/tests/test_package_files.py 2012-07-20 13:18:21 +0000
133@@ -444,7 +444,7 @@
134
135 def test_contents(self):
136 package_file = self.get_object()
137- self.assertEqual("3.0 (quilt)\n", package_file.get_contents())
138+ self.assertEqual("1.0\n", package_file.get_contents())
139
140 def test_overwrite(self):
141 package_file = self.get_object()
142
143=== modified file 'pkgme/tests/test_script.py'
144--- pkgme/tests/test_script.py 2012-07-20 05:28:38 +0000
145+++ pkgme/tests/test_script.py 2012-07-20 13:18:21 +0000
146@@ -73,8 +73,7 @@
147 self.create_marker_file(tempdir, prefix="foo")
148 self.run_script(tempdir.abspath('foo'))
149 self.assertThat(tempdir.path, DirContains(
150- ["foo_0.0.0.orig.tar.gz",
151- "foo_0.0.0.debian.tar.gz",
152+ ["foo_0.0.0.tar.gz",
153 "foo_0.0.0.dsc",
154 "foo_0.0.0_source.build",
155 "foo_0.0.0_source.changes",

Subscribers

People subscribed via source and target branches