Snapcraft build servers: name or service not found

I’m trying to package a Haskell application as a snap. I’ve managed to get it working locally using snapcraft cleanbuild, but it fails on the builders of snapcraft.io. The main issue is that I need access to hackage.haskell.org to fetch the dependencies of my application, but the container is unable to access it:

cabal: '/usr/bin/wget' exited with an error:
--2018-08-31 11:49:01-- http://hackage.haskell.org/root.json
Resolving hackage.haskell.org (hackage.haskell.org)... failed: Name or service not known.
wget: unable to resolve host address ‘hackage.haskell.org’

“The Internet” only seems to be accessible through an HTTP proxy running on 10.10.10.1:8222. One should be careful not to reset environment variables somehow (in my case thanks to chroot), as instances of wget will try to access services directly. For cabal, the solution is to use:

http_proxy=10.10.10.1:8222 cabal --http-transport=wget new-update

(I’m documenting this issue so others might find it later.)

1 Like