
The way that Cabal's CI does it is that it uses new-build, and places .cabal/store and some related directories in the cache. Here's the snippet: cache: directories: - $HOME/.cabal/packages - $HOME/.cabal/store - $HOME/.cabal/bin # We remove the index because it churns quite a bit and we don't want # to pay the cost of repeatedly caching it even though we don't care # about most changing packages. before_cache: - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index* Full yaml: https://github.com/haskell/cabal/blob/master/.travis.yml Edward Excerpts from David Feuer's message of 2016-09-02 12:04:40 -0400:
Last I spoke to Herbert, he didn't think the caching stuff was likely to be feasible for containers, because of its unusual place in the ecosystem. There may be some way around it though.
On Fri, Sep 2, 2016 at 11:57 AM, Mikhail Glushenkov
wrote: Hi,
On 2 September 2016 at 16:55, David Feuer
wrote: Indeed, that fixed the problem. Unfortunately, now I have a different problem. The CI build with benchmarks takes *much* longer than the one without (I think this is mostly because of the time required to install Criterion's dependencies).
Try enabling caching on Travis:
https://docs.travis-ci.com/user/caching/#Arbitrary-directories https://github.com/haskell/cabal/blob/master/.travis.yml#L86