From ca69a9ad6d3f5e411b5a2c83cc5872fc256442e8 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Wed, 2 Nov 2022 09:50:29 +0000 Subject: [PATCH 1/2] snap: Use metadata for dependencies Rather than hard-coding the package manager into the docker part, use the `build-packages` section to specify the parts package dependencies in a distro agnostic manner. Signed-off-by: James O. D. Hunt --- snap/snapcraft.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index a2fdcc0ba..cde181d33 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -88,12 +88,13 @@ parts: prime: - -* build-packages: + - ca-certificates - curl + - gnupg + - lsb-release override-build: | source "${SNAPCRAFT_PROJECT_DIR}/snap/local/snap-common.sh" - sudo apt-get -y update - sudo apt-get -y install ca-certificates curl gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg |\ sudo gpg --batch --yes --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg distro_codename=$(lsb_release -cs) From 990e6359b7144f19044be2729a693609df5c8ade Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Wed, 2 Nov 2022 09:53:05 +0000 Subject: [PATCH 2/2] snap: Unbreak docker install It appears that _either_ the GitHub workflow runners have changed their environment, or the Ubuntu archive has changed package dependencies, resulting in the following error when building the snap: ``` Installing build dependencies: bc bison build-essential cpio curl docker.io ... : The following packages have unmet dependencies: docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~) E: Unable to correct problems, you have held broken packages. ``` This PR uses the simplest solution: install the `containerd` and `runc` packages. However, we might want to investigate alternative solutions in the future given that the docker and containerd packages seem to have gone wild in the Ubuntu GitHub workflow runner environment. If you include the official docker repo (which the snap uses), a _subset_ of the related packages is now: - `containerd` - `containerd.io` - `docker-ce` - `docker.io` - `moby-containerd` - `moby-engine` - `moby-runc` - `runc` Fixes: #5545. Signed-off-by: James O. D. Hunt --- snap/snapcraft.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index cde181d33..2b68a7e87 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -89,9 +89,11 @@ parts: - -* build-packages: - ca-certificates + - containerd - curl - gnupg - lsb-release + - runc override-build: | source "${SNAPCRAFT_PROJECT_DIR}/snap/local/snap-common.sh"