Merge lp:~cjwatson/launchpad-buildd/fix-sudo-config into lp:launchpad-buildd

Proposed by Colin Watson
Status: Merged
Merged at revision: 158
Proposed branch: lp:~cjwatson/launchpad-buildd/fix-sudo-config
Merge into: lp:launchpad-buildd
Diff against target: 52 lines (+14/-1)
4 files modified
debian/changelog (+4/-0)
debian/rules (+2/-1)
sbuildrc (+4/-0)
sudo-wrapper (+4/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad-buildd/fix-sudo-config
Reviewer Review Type Date Requested Status
Adam Conrad (community) Approve
Review via email: mp+263845@code.launchpad.net

Commit message

Make sbuild use "sudo -E" rather than just sudo. It will still filter the environment itself, but this means that variables such as DEB_BUILD_OPTIONS will be passed through given our standard buildd sudoers configuration.

Description of the change

Adam Conrad noticed that launchpad-buildd wasn't setting DEB_BUILD_OPTIONS any more, so we aren't getting parallel builds in all cases where we should. To fix this, we need to make sbuild use "sudo -E" rather than just sudo. It will still filter the environment itself, but this means that variables such as DEB_BUILD_OPTIONS will be passed through given our standard buildd sudoers configuration.

To post a comment you must log in.
Revision history for this message
Adam Conrad (adconrad) wrote :

If it works, LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-07-04 14:29:24 +0000
3+++ debian/changelog 2015-07-05 12:45:43 +0000
4@@ -5,6 +5,10 @@
5 * buildrecipe: Pass --only-source to "apt-get build-dep" to force it to
6 use the source package we care about rather than trying to map through
7 binary package names.
8+ * Make sbuild use "sudo -E" rather than just sudo. It will still filter
9+ the environment itself, but this means that variables such as
10+ DEB_BUILD_OPTIONS will be passed through given our standard buildd
11+ sudoers configuration.
12
13 -- Colin Watson <cjwatson@ubuntu.com> Tue, 30 Jun 2015 13:09:34 +0100
14
15
16=== modified file 'debian/rules'
17--- debian/rules 2015-05-11 14:37:01 +0000
18+++ debian/rules 2015-07-05 12:45:43 +0000
19@@ -18,7 +18,8 @@
20
21 slavebins = unpack-chroot mount-chroot update-debian-chroot sbuild-package \
22 scan-for-processes umount-chroot remove-build override-sources-list \
23- buildrecipe generate-translation-templates slave-prep buildlivefs
24+ buildrecipe generate-translation-templates slave-prep buildlivefs \
25+ sudo-wrapper
26
27 BUILDDUID=65500
28 BUILDDGID=65500
29
30=== modified file 'sbuildrc'
31--- sbuildrc 2015-05-22 10:03:13 +0000
32+++ sbuildrc 2015-07-05 12:45:43 +0000
33@@ -28,6 +28,10 @@
34 '^SHELL$',
35 '^LANG$'];
36
37+# We need to use "sudo -E" so that the above environment variables are
38+# allowed through.
39+$sudo = "/usr/share/launchpad-buildd/slavebin/sudo-wrapper";
40+
41 # After that time (in minutes) of inactivity a build is terminated.
42 # Activity
43 # is measured by output to the log file.
44
45=== added file 'sudo-wrapper'
46--- sudo-wrapper 1970-01-01 00:00:00 +0000
47+++ sudo-wrapper 2015-07-05 12:45:43 +0000
48@@ -0,0 +1,4 @@
49+#! /bin/sh
50+set -e
51+
52+exec sudo -E "$@"

Subscribers

People subscribed via source and target branches

to all changes: