[Haskell-beginners] Deploying a haskell application (not a webapp)

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Wed Dec 17 14:16:54 UTC 2014


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.


More information about the Beginners mailing list