Skip to content

cabal exec -- cabal install --lib ... corrupts the cabal store #10971

Open
@sol

Description

@sol

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy