creswick / cabal-dev

A wrapper program around cabal and cabal-install that maintains sandboxed build environments.
BSD 3-Clause "New" or "Revised" License
150 stars 24 forks source link

cabal-dev complaining about missing directory #98

Open ijmorlan opened 11 years ago

ijmorlan commented 11 years ago

"cabal-dev install" is complaining about a missing directory - see below for the exact error message.

The background is I had trouble with a module that cabal-dev couldn't build, and I removed the directory on the thought that some part of the build might not be getting fully re-built (in particular, to take into account the effects of a change in $PATH).

I wasn't too surprised when this caused trouble with using cabal-dev in the original project. But now, I can create a completely brand-new project, which does not mention the problem directory anywhere, and cabal-dev still complains.

I also can't find a reference to the problem directory in any of /Library/Haskell/ or ~/Library/Haskell/ or ~/.cabal. So I'm having trouble understanding even how cabal-dev decides that it needs to see the directory. This is on Mac OS X 10.6.8 in case it's helpful.

16:32 ijmorlan@27imac.local$ yesod init
Welcome to the Yesod scaffolder.
I'm going to be creating a skeleton Yesod project for you.

What is your name? We're going to put this in the cabal and LICENSE files.

Your name: Test
Welcome Test.
What do you want to call your project? We'll use this for the cabal name.

Project name: test-project
Yesod uses Persistent for its (you guessed it) persistence layer.
This tool will build in either SQLite or PostgreSQL or MongoDB support for you.
We recommend starting with SQLite: it has no dependencies.

    s     = sqlite
    p     = postgresql
    mongo = mongodb
    mysql = MySQL

So, what'll it be? s
That's it! I'm creating your files now...
Generating deploy/Procfile
[....]
Take part in the community: http://yesodweb.com/page/community

Start your project:

   cd test-project && cabal install && yesod devel

or if you use cabal-dev:

   cd test-project && cabal-dev install && yesod --dev devel

16:32 ijmorlan@27imac.local$ cd test-project/
/Users/ijmorlan/test/test-project
16:33 ijmorlan@27imac.local$ cabal-dev install
Resolving dependencies...
cabal: /var/folders/Lh/LhVs9ls4Hme1jR+t1DJbm++++TQ/-Tmp-/SHA-1.6.1-57950: does not exist
16:33 ijmorlan@27imac.local$ 
dagit commented 11 years ago

Any chance you've hit this bug cabal bug? https://github.com/haskell/cabal/issues/1160

That bug has been fixed but I don't know if it made it into a cabal release yet: https://github.com/haskell/cabal/pull/1161

ijmorlan commented 11 years ago

On Tue, 5 Mar 2013, Jason Dagit wrote:

Any chance you've hit this bug cabal bug? haskell/cabal#1160

Conceivable. However, in that bug it appears cabal is re-arranging a path and then looking for the re-arranged path which doesn't exist and never did.

In my case, the path it is looking for is a path that actually did exist until I deleted it. What's strange is that I would have expected a cabal-dev invocation to be pretty well independent of any invocation using a different sandbox directory.

A problem with cabal is a possibility. What confuses me is that the path in question looks to me like something that is automatically created by an underlying system - probably an OS service - for temp files. It doesn't look like the kind of path one would expect to persist.

Ok, I've re-booted my iMac and now cabal-dev is working. The exact same path under /var/folders seems to be in use by the the cabal-dev process.

I didn't think to check /tmp before, which I think is cleared out by reboot.

Thanks in any case for taking a look at this. At this point I doubt it's worth spending much more time on it, unless there is something obvious about how it decides what paths to look at.