haskell/cabal

Unable to build packages added via 'cabal sandbox add-source': dist/dist-sandbox-2c3ad105/package.conf.inplace already exists

DougBurke opened this issue · 6 comments

Background: I tried out the ghc 7.10 RC and was seeing some strange issues, which I took to be due to differences between cabal-install and the Cabal libraries in the RC. So I installed both Cabal and cabal-install using ghc 7.8.4 from GitHub (commit id is below), and am seeing some strange behavior with using the sandbox add-source option with ghc-7.8.4.

I have a package for which I have

% cabal sandbox init
% cabal sandbox add-source ../HaSparql-Client
% cabal sandbox add-source ../twitter-types
% cabal install --only-dependencies --enable-tests

and everything installs except for the two packages that I used add-source for. Here's the failure message (when I try to install one of them directly):

% cabal install hasparql-client
Resolving dependencies...
Notice: installing into a sandbox located at
/home/dburke/code/astrosearch/.cabal-sandbox
Configuring hasparql-client-0.5...
Building hasparql-client-0.5...
Failed to install hasparql-client-0.5
Build log ( /home/dburke/code/astrosearch/.cabal-sandbox/logs/hasparql-client-0.5.log ):
Configuring hasparql-client-0.5...
Building hasparql-client-0.5...
ghc-pkg: cannot create: dist/dist-sandbox-2c3ad105/package.conf.inplace already exists
cabal: Error: some packages failed to install:
hasparql-client-0.5 failed during the building phase. The exception was:
ExitFailure 1

So, it fell over because package.conf.inplace already existed. However, this is in part of the sandbox install, so it's not obvious to me that I can fix this. Note that the twitter-types package showed the same error.

Just to check, I tried building the package itself (I have done this before, but wanted to check with the new cabal installation), and it worked. Surprisingly enough, it also meant that the cabal install command in my original package now works: that is

<in my package directory>
% cabal add-source ../foo
% cabal install foo
# fails
% cd ../foo
% cabal sandbox init
% cabal sandbox install --only-dependencies
% cabal build
... this works
% cd ../my-package
% cabal install foo
# now works

Here's some system info:

% ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4
% cabal --version
cabal-install version 1.22.0.0
using version 1.22.0.0 of the Cabal library

which was installed from commit 4ff05c0

Hello @DougBurke , can compile and run this version of Cabal: https://github.com/ezyang/cabal/compare/cabal-packagedb and see if this fixes your issue?

Unfortunately I am unable to replicate the original problem; I don't know what I've done to my system between now and then that could have changed things (or perhaps I forgot some tweak that I made then).

Let me know if you'd like me to try harder to re-create the issue.

I'm having the same issue after upgrading to cabal 1.22.0.0 and ghc 7.8.4, and working with a brand new sandbox. Ed, when I click on your link (https://github.com/ezyang/cabal/compare/cabal-packagedb) I see the message "There isn't anything to compare.". If you want me to try another repo, let me know.

It got merged, though it doesn't look like the PR got closed? We haven't done a new release yet, so for the fixed version install something from Cabal HEAD.

I've started seeing this problem recently. I'll install cabal head and report the results.

sandbox functionality is removed.