← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~tushar5526/launchpad-buildd:install-a-demo-snap-in-livefs-to-workaround-udev-issues into launchpad-buildd:master

 

Tushar Gupta has proposed merging ~tushar5526/launchpad-buildd:install-a-demo-snap-in-livefs-to-workaround-udev-issues into launchpad-buildd:master.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~tushar5526/launchpad-buildd/+git/launchpad-buildd/+merge/480219
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~tushar5526/launchpad-buildd:install-a-demo-snap-in-livefs-to-workaround-udev-issues into launchpad-buildd:master.
diff --git a/lpbuildd/target/build_livefs.py b/lpbuildd/target/build_livefs.py
index 6affa95..13b382e 100644
--- a/lpbuildd/target/build_livefs.py
+++ b/lpbuildd/target/build_livefs.py
@@ -138,6 +138,21 @@ class BuildLiveFS(SnapStoreOperationMixin, Operation):
                 ]
             )
 
+        # XXX 2025-01-27 tushar5526: This is a temporary fix to work around
+        # https://bugs.launchpad.net/snapd/+bug/1731519.
+        # Explicitly install a "hello" snap in livefs builds
+        # to workaround the snapd bug where installing a snap
+        # on the first attempt fails due to udev issues. This
+        # fix should be REMOVED after the new release of snapd
+        # in early march.
+        self.backend.run(
+            [
+                "snap",
+                "install",
+                "hello",
+            ]
+        )
+
     def build(self):
         if self.args.locale is not None:
             self.run_build_command(
diff --git a/lpbuildd/target/tests/test_build_livefs.py b/lpbuildd/target/tests/test_build_livefs.py
index 46b1f14..df59255 100644
--- a/lpbuildd/target/tests/test_build_livefs.py
+++ b/lpbuildd/target/tests/test_build_livefs.py
@@ -18,6 +18,7 @@ from lpbuildd.target.tests.matchers import (
     RanAptGet,
     RanBuildCommand,
     RanCommand,
+    RanSnap,
 )
 from lpbuildd.tests.fakebuilder import FakeMethod
 
@@ -38,7 +39,8 @@ class TestBuildLiveFS(TestCase):
             MatchesListwise(
                 [
                     RanAptGet("install", "livecd-rootfs"),
-                ]
+                    RanSnap("install", "hello"),
+                ],
             ),
         )
 
@@ -63,6 +65,7 @@ class TestBuildLiveFS(TestCase):
                         "install",
                         "ubuntu-defaults-builder",
                     ),
+                    RanSnap("install", "hello"),
                 ]
             ),
         )
@@ -110,6 +113,7 @@ class TestBuildLiveFS(TestCase):
                     RanCommand(
                         ["snap", "set", "core", "proxy.store=store-id"]
                     ),
+                    RanSnap("install", "hello"),
                 ]
             ),
         )