cabal
cabal copied to clipboard
scope:private executables broken with v2-install
Describe the bug
If I use a private executable with v1-install
(tested inside a v1-sandbox
) I get the behaviour I'm looking for:
- the private executable is only installed in the
libexec
dir - I can run the executable from another program in the package with the help of the
Paths_
module
With v2-install (on Linux):
-
cabal-install
installs a broken symlink ininstalldir
for the private executable - executables can have different component hashes. Using
getLibexecDir
from the public executable in the package doesn't give me the location of the others.
item 1. seems to be a bug.
I'm not sure about 2. How should I find a private executable if it's not a bug?
For reference, the code that doesn't work (from Main.hs
in the attached archive):
main = do
putStrLn "Hello, Haskell! (public)"
libexec <- getLibexecDir
callProcess (libexec </> "private") []
To Reproduce
$ cabal v2-install testprivate-0.1.0.0.tar.gz
Expected behavior
testprivate
is installed in installdir
. When run, it should the private executable. The expected output is:
Hello, Haskell! (public)
Hello, Haskell! (private)