summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVidar Holen <spam@vidarholen.net>2018-10-24 20:33:52 -0700
committerVidar Holen <spam@vidarholen.net>2018-10-24 21:33:42 -0700
commit359b1467a29895747adb55d053d0785782547a89 (patch)
tree924bf1954052acc31ef5c8864afd83a2629db7e7
parentdf0a0d41fa2e7a00b3229a48a10a84d1565bdd2b (diff)
Work around snap's old cabal + new snapcraft proxy.
-rw-r--r--.snapsquid.conf14
-rw-r--r--snap/snapcraft.yaml9
2 files changed, 22 insertions, 1 deletions
diff --git a/.snapsquid.conf b/.snapsquid.conf
new file mode 100644
index 0000000..205c1a6
--- /dev/null
+++ b/.snapsquid.conf
@@ -0,0 +1,14 @@
+# 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 b7f0e96..9c50293 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -37,9 +37,16 @@ parts:
source: ./
build-packages:
- cabal-install
+ - squid3
build: |
+ # See comments in .snapsquid.conf
+ [ "$http_proxy" ] && {
+ squid3 -f .snapsquid.conf
+ export http_proxy="http://localhost:8888"
+ sleep 3
+ }
cabal sandbox init
- cabal update
+ cabal update || cat /var/log/squid/*
cabal install -j
install: |
install -d $SNAPCRAFT_PART_INSTALL/usr/bin