[Haskell-beginners] Deploying a haskell application (not a webapp)
Alan Buxton
alanbuxton at gmail.com
Wed Dec 17 14:24:38 UTC 2014
Hi mateusz yes thanks for this. You've basically hit the nail on the head
with that summary "teach your program how to find them".
On 17 Dec 2014 14:17, "Mateusz Kowalczyk" <fuuzetsu at fuuzetsu.co.uk> wrote:
> On 12/16/2014 03:24 PM, Michael Orlitzky wrote:
> > On 12/16/2014 08:47 AM, Alan Buxton wrote:
> >> Hiya
> >>
> >>
> >>
> >> It turned out that my issue was to do with the data files. When
> >> compiling locally, cabal puts the files in /home/alan/.cabal/share and
> >> the compiled application expects to find the files there. So when I
> >> deploy my binary I have to also put some files into
> >> /home/alan/.cabal/share which feels wrong.
> >
> > If you list the data files in Cabal's "data-files" field, and you use
> > Cabal to build on the server, then you can ask Cabal where it put those
> > files at runtime:
> >
> >
> https://www.haskell.org/cabal/users-guide/developing-packages.html#accessing-data-files-from-package-code
> >
> > _______________________________________________
> > Beginners mailing list
> > Beginners at haskell.org
> > http://www.haskell.org/mailman/listinfo/beginners
> >
>
> Pretty sure the whole point of this thread is that the OP does not want
> to build on the server.
>
> Personally I have inlined some data files into the source directly at
> compile time with Template Haskell: no hassle at run-time about finding
> the files, no hassle with copying them over to the target machine… Of
> course this might not cut it if your files are huge or are meant to be
> more dynamic. If that's the case then you should copy the data files
> along with the binary and teach your program how to find them.
>
> --
> Mateusz K.
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20141217/522bb6ee/attachment.html>
More information about the Beginners
mailing list