Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cabal: executable data-files

Tags:

haskell

cabal

I want to include an executable file in the cabal data-files section to execute it as a subprocess in my Haskell program.

The file's there, getDataFileName works for it, but it lacks the executable bit and so trying to run it with System.Process.createProcess fails with permission denied.

Is there a way for cabal to preserve the execution permission of the file? Is there another clean way to solve this?

like image 873
yairchu Avatar asked Oct 18 '22 14:10

yairchu


1 Answers

As summarized in some discussion on cabal patches, the current (underdocumented) state of play is that one should use both a copy and an install hook, since one or the other will get executed.

Edit: After some digging, there's an old ticket on libexec support in cabal, which would be a very nice solution if it were implemented.

like image 51
sclv Avatar answered Oct 21 '22 06:10

sclv