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
=== modified file 'debian/changelog'
--- debian/changelog 2018-10-09 11:54:04 +0000
+++ debian/changelog 2018-10-11 09:00:09 +0000
@@ -6,6 +6,9 @@
6 images as part of a single build, in order to be selective about what6 images as part of a single build, in order to be selective about what
7 builds to run.7 builds to run.
88
9 [ Colin Watson ]
10 * Set SNAPCRAFT_BUILD_ENVIRONMENT=host when building snaps (LP: #1791201).
11
9 -- Colin Watson <cjwatson@ubuntu.com> Tue, 09 Oct 2018 11:38:07 +020012 -- Colin Watson <cjwatson@ubuntu.com> Tue, 09 Oct 2018 11:38:07 +0200
1013
11launchpad-buildd (164) xenial; urgency=medium14launchpad-buildd (164) xenial; urgency=medium
1215
=== modified file 'lpbuildd/target/build_snap.py'
--- lpbuildd/target/build_snap.py 2018-07-30 10:09:14 +0000
+++ lpbuildd/target/build_snap.py 2018-10-11 09:00:09 +0000
@@ -184,6 +184,7 @@
184 # we'll need to make this optional in some way.184 # we'll need to make this optional in some way.
185 env["SNAPCRAFT_BUILD_INFO"] = "1"185 env["SNAPCRAFT_BUILD_INFO"] = "1"
186 env["SNAPCRAFT_IMAGE_INFO"] = self.image_info186 env["SNAPCRAFT_IMAGE_INFO"] = self.image_info
187 env["SNAPCRAFT_BUILD_ENVIRONMENT"] = "host"
187 if self.args.proxy_url:188 if self.args.proxy_url:
188 env["http_proxy"] = self.args.proxy_url189 env["http_proxy"] = self.args.proxy_url
189 env["https_proxy"] = self.args.proxy_url190 env["https_proxy"] = self.args.proxy_url
@@ -208,6 +209,7 @@
208 # we'll need to make this optional in some way.209 # we'll need to make this optional in some way.
209 env["SNAPCRAFT_BUILD_INFO"] = "1"210 env["SNAPCRAFT_BUILD_INFO"] = "1"
210 env["SNAPCRAFT_IMAGE_INFO"] = self.image_info211 env["SNAPCRAFT_IMAGE_INFO"] = self.image_info
212 env["SNAPCRAFT_BUILD_ENVIRONMENT"] = "host"
211 if self.args.proxy_url:213 if self.args.proxy_url:
212 env["http_proxy"] = self.args.proxy_url214 env["http_proxy"] = self.args.proxy_url
213 env["https_proxy"] = self.args.proxy_url215 env["https_proxy"] = self.args.proxy_url
214216
=== modified file 'lpbuildd/target/tests/test_build_snap.py'
--- lpbuildd/target/tests/test_build_snap.py 2018-07-30 10:09:14 +0000
+++ lpbuildd/target/tests/test_build_snap.py 2018-10-11 09:00:09 +0000
@@ -316,6 +316,7 @@
316 "SNAPCRAFT_SETUP_CORE": "1",316 "SNAPCRAFT_SETUP_CORE": "1",
317 "SNAPCRAFT_BUILD_INFO": "1",317 "SNAPCRAFT_BUILD_INFO": "1",
318 "SNAPCRAFT_IMAGE_INFO": "{}",318 "SNAPCRAFT_IMAGE_INFO": "{}",
319 "SNAPCRAFT_BUILD_ENVIRONMENT": "host",
319 }320 }
320 self.assertThat(build_snap.backend.run.calls, MatchesListwise([321 self.assertThat(build_snap.backend.run.calls, MatchesListwise([
321 RanBuildCommand(322 RanBuildCommand(
@@ -338,6 +339,7 @@
338 "SNAPCRAFT_BUILD_INFO": "1",339 "SNAPCRAFT_BUILD_INFO": "1",
339 "SNAPCRAFT_IMAGE_INFO": (340 "SNAPCRAFT_IMAGE_INFO": (
340 '{"build_url": "https://launchpad.example/build"}'),341 '{"build_url": "https://launchpad.example/build"}'),
342 "SNAPCRAFT_BUILD_ENVIRONMENT": "host",
341 "http_proxy": "http://proxy.example:3128/",343 "http_proxy": "http://proxy.example:3128/",
342 "https_proxy": "http://proxy.example:3128/",344 "https_proxy": "http://proxy.example:3128/",
343 "GIT_PROXY_COMMAND": "/usr/local/bin/snap-git-proxy",345 "GIT_PROXY_COMMAND": "/usr/local/bin/snap-git-proxy",
@@ -360,6 +362,7 @@
360 "SNAPCRAFT_SETUP_CORE": "1",362 "SNAPCRAFT_SETUP_CORE": "1",
361 "SNAPCRAFT_BUILD_INFO": "1",363 "SNAPCRAFT_BUILD_INFO": "1",
362 "SNAPCRAFT_IMAGE_INFO": "{}",364 "SNAPCRAFT_IMAGE_INFO": "{}",
365 "SNAPCRAFT_BUILD_ENVIRONMENT": "host",
363 }366 }
364 self.assertThat(build_snap.backend.run.calls, MatchesListwise([367 self.assertThat(build_snap.backend.run.calls, MatchesListwise([
365 RanBuildCommand(368 RanBuildCommand(
@@ -383,7 +386,8 @@
383 self.assertThat(build_snap.backend.run.calls, MatchesListwise([386 self.assertThat(build_snap.backend.run.calls, MatchesListwise([
384 RanBuildCommand(387 RanBuildCommand(
385 ["snapcraft"], cwd="/build/test-snap",388 ["snapcraft"], cwd="/build/test-snap",
386 SNAPCRAFT_BUILD_INFO="1", SNAPCRAFT_IMAGE_INFO="{}"),389 SNAPCRAFT_BUILD_INFO="1", SNAPCRAFT_IMAGE_INFO="{}",
390 SNAPCRAFT_BUILD_ENVIRONMENT="host"),
387 ]))391 ]))
388392
389 def test_build_proxy(self):393 def test_build_proxy(self):
@@ -400,6 +404,7 @@
400 "SNAPCRAFT_BUILD_INFO": "1",404 "SNAPCRAFT_BUILD_INFO": "1",
401 "SNAPCRAFT_IMAGE_INFO": (405 "SNAPCRAFT_IMAGE_INFO": (
402 '{"build_url": "https://launchpad.example/build"}'),406 '{"build_url": "https://launchpad.example/build"}'),
407 "SNAPCRAFT_BUILD_ENVIRONMENT": "host",
403 "http_proxy": "http://proxy.example:3128/",408 "http_proxy": "http://proxy.example:3128/",
404 "https_proxy": "http://proxy.example:3128/",409 "https_proxy": "http://proxy.example:3128/",
405 "GIT_PROXY_COMMAND": "/usr/local/bin/snap-git-proxy",410 "GIT_PROXY_COMMAND": "/usr/local/bin/snap-git-proxy",
@@ -431,12 +436,14 @@
431 SNAPCRAFT_LOCAL_SOURCES="1", SNAPCRAFT_SETUP_CORE="1",436 SNAPCRAFT_LOCAL_SOURCES="1", SNAPCRAFT_SETUP_CORE="1",
432 SNAPCRAFT_BUILD_INFO="1",437 SNAPCRAFT_BUILD_INFO="1",
433 SNAPCRAFT_IMAGE_INFO=(438 SNAPCRAFT_IMAGE_INFO=(
434 '{"build_url": "https://launchpad.example/build"}'))),439 '{"build_url": "https://launchpad.example/build"}'),
440 SNAPCRAFT_BUILD_ENVIRONMENT="host")),
435 AnyMatch(RanBuildCommand(441 AnyMatch(RanBuildCommand(
436 ["snapcraft"], cwd="/build/test-snap",442 ["snapcraft"], cwd="/build/test-snap",
437 SNAPCRAFT_BUILD_INFO="1",443 SNAPCRAFT_BUILD_INFO="1",
438 SNAPCRAFT_IMAGE_INFO=(444 SNAPCRAFT_IMAGE_INFO=(
439 '{"build_url": "https://launchpad.example/build"}'))),445 '{"build_url": "https://launchpad.example/build"}'),
446 SNAPCRAFT_BUILD_ENVIRONMENT="host")),
440 ))447 ))
441448
442 def test_run_install_fails(self):449 def test_run_install_fails(self):

Subscribers

People subscribed via source and target branches

to all changes: