From 34f582c81c0ae4868068b5efa3045f1c16f6ea91 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Wed, 18 Jun 2025 15:01:38 -0400 Subject: [PATCH] snap: don't abort on `swapon` failures This is needed when building snap on LXD containers. Signed-off-by: Simon Deziel --- snap/snapcraft.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 1e3bdcb..944115b 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -47,7 +47,10 @@ parts: fallocate -l 2G /tmp/swap chmod 0600 /tmp/swap mkswap /tmp/swap - swapon /tmp/swap + if ! swapon /tmp/swap; then + echo "Could not enable swap file, continuing anyway" + rm /tmp/swap + fi cabal update cabal install -j