Search code examples
haskellcabal

ghc-pkg: cannot create: dist/dist-sandbox-XXXXXXXX/package.conf.inplace already exists


I've just upgraded to cabal 1.22.0.0. I created a brand new sandbox, and added a link to another local package like so:

cabal sandbox add-source /home/amy/néal/créatúr-wains

Then I tried to install the dependencies:

cabal install --dep

But when it got to the part where it tried to build my local package, I got an error:

Configuring creatur-wains-4.1.1...
Building creatur-wains-4.1.1...
ghc-pkg: cannot create: dist/dist-sandbox-5cb45741/package.conf.inplace already exists

I get the same result if I try to install that package using cabal install creatur-wains. I didn't have this problem with earlier versions of cabal. How can I fix this?


Solution

  • This is a known issuehttps://github.com/haskell/cabal/issues/2301. The workaround is:

    1. Go to the directory containing the local package (/home/amy/néal/créatúr-wains, in my case).
    2. Build the local package (cabal install).
    3. Return to the original directory. cabal install will now work.