From ad3c3146f0e10fcd331a1c8bba29e710f4417c99 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sun, 3 Mar 2024 12:34:29 -0800 Subject: [PATCH] Fix snap build --- .snapsquid.conf | 14 -------------- snap/snapcraft.yaml | 18 +++++++++--------- 2 files changed, 9 insertions(+), 23 deletions(-) delete mode 100644 .snapsquid.conf diff --git a/.snapsquid.conf b/.snapsquid.conf deleted file mode 100644 index 205c1a6d8..000000000 --- a/.snapsquid.conf +++ /dev/null @@ -1,14 +0,0 @@ -# In 2015, cabal-install had a http bug triggered when proxies didn't keep -# the connection open. This version made it into Ubuntu Xenial as used by -# Snapcraft. In June 2018, Snapcraft's proxy started triggering this bug. -# -# https://bugs.launchpad.net/launchpad-buildd/+bug/1797809 -# -# Workaround: add more proxy - -visible_hostname localhost -http_port 8888 -cache_peer 10.10.10.1 parent 8222 0 no-query default -cache_peer_domain localhost !.internal -http_access allow all - diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index e14b85473..f294c4ead 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -23,7 +23,7 @@ description: | # snap connect shellcheck:removable-media version: git -base: core18 +base: core20 grade: stable confinement: strict @@ -40,16 +40,16 @@ parts: source: . build-packages: - cabal-install - - squid + stage-packages: + - libatomic1 override-build: | - # See comments in .snapsquid.conf - [ "$http_proxy" ] && { - squid3 -f .snapsquid.conf - export http_proxy="http://localhost:8888" - sleep 3 - } + # Give ourselves enough memory to build + dd if=/dev/zero of=/tmp/swap bs=1M count=2000 + mkswap /tmp/swap + swapon /tmp/swap + cabal sandbox init - cabal update || cat /var/log/squid/* + cabal update cabal install -j install -d $SNAPCRAFT_PART_INSTALL/usr/bin