[Haskell-cafe] Offline compilation with Stack/Cabal
Herbert Valerio Riedel
hvriedel at gmail.com
Thu Nov 24 21:48:38 UTC 2016
On 2016-11-24 at 07:57:57 +0100, Jan von Löwenstein wrote:
> Consider the following use case:
> I have to ship a Haskell application as source, bundled with its
> dependencies and a script that can produce the binary on a machine without
> internet connectivity.
This situation is not that uncommon; one example is when you have
build-bots which a more or less cut off from the internet (such as
Ubuntu's launchpad buildfarm)
> Is that possible with Stack or Cabal?
> Any pointers would be much appreciated.
> Ideally I would like to build each dependency package individually. That
> way I could cache results per Haskell package and don't need to rebuild
> dependencies until they actually change.
This sounds like something I'd use cabal's filesystem-local repository
feature for, and it should be possible to specify such local
repositories in your `cabal.config` or `cabal.project` files to
produce a self-contained source distribution.
If you're interested in pursuing this approach or have any questions
about it, let me know!
More information about the Haskell-Cafe