← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad-buildd:charmcraft-classic into launchpad-buildd:master

 

Colin Watson has proposed merging ~cjwatson/launchpad-buildd:charmcraft-classic into launchpad-buildd:master.

Commit message:
Install charmcraft with --classic

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad-buildd/+git/launchpad-buildd/+merge/405749

The revision in the candidate channel requires this, and it's accepted but ignored with the current stable revision.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad-buildd:charmcraft-classic into launchpad-buildd:master.
diff --git a/debian/changelog b/debian/changelog
index 0dcf32e..2c14e1e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ launchpad-buildd (198) UNRELEASED; urgency=medium
 
   * Run charmcraft in verbose mode.
   * Honour proxy arguments when building charms.
+  * Install charmcraft with --classic.
 
  -- Colin Watson <cjwatson@xxxxxxxxxx>  Fri, 09 Jul 2021 14:08:58 +0100
 
diff --git a/lpbuildd/target/build_charm.py b/lpbuildd/target/build_charm.py
index 7610a8b..3550117 100644
--- a/lpbuildd/target/build_charm.py
+++ b/lpbuildd/target/build_charm.py
@@ -91,11 +91,11 @@ class BuildCharm(SnapBuildProxyOperationMixin, VCSOperationMixin,
                      snap_name])
         if "charmcraft" in self.args.channels:
             self.backend.run(
-                ["snap", "install",
+                ["snap", "install", "--classic",
                  "--channel=%s" % self.args.channels["charmcraft"],
                  "charmcraft"])
         else:
-            self.backend.run(["snap", "install", "charmcraft"])
+            self.backend.run(["snap", "install", "--classic", "charmcraft"])
         # The charmcraft snap can't see /build, so we have to do our work under
         # /home/buildd instead.  Make sure it exists.
         self.backend.run(["mkdir", "-p", "/home/buildd"])
diff --git a/lpbuildd/target/tests/test_build_charm.py b/lpbuildd/target/tests/test_build_charm.py
index 8be840e..dc0dad6 100644
--- a/lpbuildd/target/tests/test_build_charm.py
+++ b/lpbuildd/target/tests/test_build_charm.py
@@ -120,7 +120,7 @@ class TestBuildCharm(TestCase):
             RanAptGet("install", "bzr"),
             RanSnap("install", "--channel=candidate", "core"),
             RanSnap("install", "--channel=beta", "core18"),
-            RanSnap("install", "--channel=edge", "charmcraft"),
+            RanSnap("install", "--classic", "--channel=edge", "charmcraft"),
             RanCommand(["mkdir", "-p", "/home/buildd"]),
             ]))
 
@@ -134,7 +134,7 @@ class TestBuildCharm(TestCase):
         build_charm.install()
         self.assertThat(build_charm.backend.run.calls, MatchesListwise([
             RanAptGet("install", "bzr"),
-            RanCommand(["snap", "install", "charmcraft"]),
+            RanSnap("install", "--classic", "charmcraft"),
             RanCommand(["mkdir", "-p", "/home/buildd"]),
             ]))
 
@@ -148,7 +148,7 @@ class TestBuildCharm(TestCase):
         build_charm.install()
         self.assertThat(build_charm.backend.run.calls, MatchesListwise([
             RanAptGet("install", "git"),
-            RanCommand(["snap", "install", "charmcraft"]),
+            RanSnap("install", "--classic", "charmcraft"),
             RanCommand(["mkdir", "-p", "/home/buildd"]),
             ]))
 
@@ -182,7 +182,7 @@ class TestBuildCharm(TestCase):
             RanCommand(
                 ["snap", "ack", "/dev/stdin"], input_text=store_assertion),
             RanCommand(["snap", "set", "core", "proxy.store=store-id"]),
-            RanSnap("install", "charmcraft"),
+            RanSnap("install", "--classic", "charmcraft"),
             RanCommand(["mkdir", "-p", "/home/buildd"]),
             ]))
 
@@ -204,7 +204,7 @@ class TestBuildCharm(TestCase):
         build_charm.install()
         self.assertThat(build_charm.backend.run.calls, MatchesListwise([
             RanAptGet("install", "python3", "socat", "git"),
-            RanSnap("install", "charmcraft"),
+            RanSnap("install", "--classic", "charmcraft"),
             RanCommand(["mkdir", "-p", "/home/buildd"]),
             ]))
         self.assertEqual(