← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad-buildd:require-lxd-snap into launchpad-buildd:master

 

Colin Watson has proposed merging ~cjwatson/launchpad-buildd:require-lxd-snap into launchpad-buildd:master.

Commit message:
Require the LXD snap to be installed

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

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

I don't love this since it's less declarative, but the lxd package no longer exists in jammy, so we can't depend on it normally any more.  The base OpenStack images where we typically install launchpad-buildd have the lxd snap pre-installed, so this shouldn't cause any practical inconvenience there.

This does mean that it's no longer possible to install launchpad-buildd in a chroot, but it wouldn't have worked there for most purposes anyway.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad-buildd:require-lxd-snap into launchpad-buildd:master.
diff --git a/debian/changelog b/debian/changelog
index 41fce54..0ce11f2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 launchpad-buildd (224) UNRELEASED; urgency=medium
 
   * Allow configuring builders to use a different ClamAV database URL.
+  * Require the LXD snap to be installed, rather than depending on the lxd
+    package (which no longer exists in jammy).
 
  -- Colin Watson <cjwatson@xxxxxxxxxx>  Wed, 26 Oct 2022 08:55:39 +0200
 
diff --git a/debian/control b/debian/control
index b881694..b92d6b2 100644
--- a/debian/control
+++ b/debian/control
@@ -49,7 +49,6 @@ Depends: adduser,
          gpg,
          lsb-release,
          lsof,
-         lxd,
          ntpdate,
          pristine-tar,
          python3,
diff --git a/debian/postinst b/debian/postinst
index 6e819f6..84f9a40 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -21,6 +21,11 @@ make_buildd()
 
 case "$1" in
     configure)
+	if [ ! -d /var/snap/lxd ]; then
+	    echo "LXD is not installed.  Run 'snap install lxd' and retry." >&2
+	    exit 1
+	fi
+
 	getent group buildd >/dev/null 2>&1 ||
                 addgroup --gid $BUILDDGID buildd