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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With