Merge lp:~cjwatson/launchpad-buildd/snapcraft-build-env-host into lp:launchpad-buildd

Proposed by Colin Watson
Status: Merged
Merged at revision: 349
Proposed branch: lp:~cjwatson/launchpad-buildd/snapcraft-build-env-host
Merge into: lp:launchpad-buildd
Diff against target: 96 lines (+15/-3)
3 files modified
debian/changelog (+3/-0)
lpbuildd/target/build_snap.py (+2/-0)
lpbuildd/target/tests/test_build_snap.py (+10/-3)
To merge this branch: bzr merge lp:~cjwatson/launchpad-buildd/snapcraft-build-env-host
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+356506@code.launchpad.net

Commit message

Set SNAPCRAFT_BUILD_ENVIRONMENT=host when building snaps (LP: #1791201).

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

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 2018-10-09 11:54:04 +0000
3+++ debian/changelog 2018-10-11 09:00:09 +0000
4@@ -6,6 +6,9 @@
5 images as part of a single build, in order to be selective about what
6 builds to run.
7
8+ [ Colin Watson ]
9+ * Set SNAPCRAFT_BUILD_ENVIRONMENT=host when building snaps (LP: #1791201).
10+
11 -- Colin Watson <cjwatson@ubuntu.com> Tue, 09 Oct 2018 11:38:07 +0200
12
13 launchpad-buildd (164) xenial; urgency=medium
14
15=== modified file 'lpbuildd/target/build_snap.py'
16--- lpbuildd/target/build_snap.py 2018-07-30 10:09:14 +0000
17+++ lpbuildd/target/build_snap.py 2018-10-11 09:00:09 +0000
18@@ -184,6 +184,7 @@
19 # we'll need to make this optional in some way.
20 env["SNAPCRAFT_BUILD_INFO"] = "1"
21 env["SNAPCRAFT_IMAGE_INFO"] = self.image_info
22+ env["SNAPCRAFT_BUILD_ENVIRONMENT"] = "host"
23 if self.args.proxy_url:
24 env["http_proxy"] = self.args.proxy_url
25 env["https_proxy"] = self.args.proxy_url
26@@ -208,6 +209,7 @@
27 # we'll need to make this optional in some way.
28 env["SNAPCRAFT_BUILD_INFO"] = "1"
29 env["SNAPCRAFT_IMAGE_INFO"] = self.image_info
30+ env["SNAPCRAFT_BUILD_ENVIRONMENT"] = "host"
31 if self.args.proxy_url:
32 env["http_proxy"] = self.args.proxy_url
33 env["https_proxy"] = self.args.proxy_url
34
35=== modified file 'lpbuildd/target/tests/test_build_snap.py'
36--- lpbuildd/target/tests/test_build_snap.py 2018-07-30 10:09:14 +0000
37+++ lpbuildd/target/tests/test_build_snap.py 2018-10-11 09:00:09 +0000
38@@ -316,6 +316,7 @@
39 "SNAPCRAFT_SETUP_CORE": "1",
40 "SNAPCRAFT_BUILD_INFO": "1",
41 "SNAPCRAFT_IMAGE_INFO": "{}",
42+ "SNAPCRAFT_BUILD_ENVIRONMENT": "host",
43 }
44 self.assertThat(build_snap.backend.run.calls, MatchesListwise([
45 RanBuildCommand(
46@@ -338,6 +339,7 @@
47 "SNAPCRAFT_BUILD_INFO": "1",
48 "SNAPCRAFT_IMAGE_INFO": (
49 '{"build_url": "https://launchpad.example/build"}'),
50+ "SNAPCRAFT_BUILD_ENVIRONMENT": "host",
51 "http_proxy": "http://proxy.example:3128/",
52 "https_proxy": "http://proxy.example:3128/",
53 "GIT_PROXY_COMMAND": "/usr/local/bin/snap-git-proxy",
54@@ -360,6 +362,7 @@
55 "SNAPCRAFT_SETUP_CORE": "1",
56 "SNAPCRAFT_BUILD_INFO": "1",
57 "SNAPCRAFT_IMAGE_INFO": "{}",
58+ "SNAPCRAFT_BUILD_ENVIRONMENT": "host",
59 }
60 self.assertThat(build_snap.backend.run.calls, MatchesListwise([
61 RanBuildCommand(
62@@ -383,7 +386,8 @@
63 self.assertThat(build_snap.backend.run.calls, MatchesListwise([
64 RanBuildCommand(
65 ["snapcraft"], cwd="/build/test-snap",
66- SNAPCRAFT_BUILD_INFO="1", SNAPCRAFT_IMAGE_INFO="{}"),
67+ SNAPCRAFT_BUILD_INFO="1", SNAPCRAFT_IMAGE_INFO="{}",
68+ SNAPCRAFT_BUILD_ENVIRONMENT="host"),
69 ]))
70
71 def test_build_proxy(self):
72@@ -400,6 +404,7 @@
73 "SNAPCRAFT_BUILD_INFO": "1",
74 "SNAPCRAFT_IMAGE_INFO": (
75 '{"build_url": "https://launchpad.example/build"}'),
76+ "SNAPCRAFT_BUILD_ENVIRONMENT": "host",
77 "http_proxy": "http://proxy.example:3128/",
78 "https_proxy": "http://proxy.example:3128/",
79 "GIT_PROXY_COMMAND": "/usr/local/bin/snap-git-proxy",
80@@ -431,12 +436,14 @@
81 SNAPCRAFT_LOCAL_SOURCES="1", SNAPCRAFT_SETUP_CORE="1",
82 SNAPCRAFT_BUILD_INFO="1",
83 SNAPCRAFT_IMAGE_INFO=(
84- '{"build_url": "https://launchpad.example/build"}'))),
85+ '{"build_url": "https://launchpad.example/build"}'),
86+ SNAPCRAFT_BUILD_ENVIRONMENT="host")),
87 AnyMatch(RanBuildCommand(
88 ["snapcraft"], cwd="/build/test-snap",
89 SNAPCRAFT_BUILD_INFO="1",
90 SNAPCRAFT_IMAGE_INFO=(
91- '{"build_url": "https://launchpad.example/build"}'))),
92+ '{"build_url": "https://launchpad.example/build"}'),
93+ SNAPCRAFT_BUILD_ENVIRONMENT="host")),
94 ))
95
96 def test_run_install_fails(self):

Subscribers

People subscribed via source and target branches

to all changes: