简体   繁体   中英

Cabal: executable data-files

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM