Open
Description
Steps to reproduce:
Given a .cabal
file and some dummy module:
cabal-version: 3.14
name: hello
version: 0.0.0
build-type: Simple
library
default-language: Haskell2010
build-depends: base == 4.*, base-compat
hs-source-dirs: src
exposed-modules: Run
-- src/Run.hs
module Run where
main :: IO ()
main = putStrLn "Hello, World!"
Running cabal exec -- cabal install --lib ...
produces a corrupted package environment:
$ rm -rf ~/.local/state/cabal/store/
$ rm -rf env && cabal exec -- cabal install -z --lib silently --package-env ./env
$ GHC_ENVIRONMENT=./env ghci
Loaded package environment from ./env
GHCi, version 9.10.1: https://www.haskell.org/ghc/ :? for help
<command line>: libHShello-0.0.0-inplace-ghc9.10.1.so: cannot open shared object file: No such file or directory
This of itself would not really be an issue. What is an issue however, is that it also corrupts the cabal store and that successive runs of the same command without cabal exec
will reproduce the broken package environment:
$ rm -rf env && cabal install -z --lib silently --package-env ./env
$ GHC_ENVIRONMENT=./env ghci
Loaded package environment from ./env
GHCi, version 9.10.1: https://www.haskell.org/ghc/ :? for help
<command line>: libHShello-0.0.0-inplace-ghc9.10.1.so: cannot open shared object file: No such file or directory
System information
cabal-install-3.14.2.0