Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

cabal-dev ghci broken in 0.9 #39

gracjan opened this Issue Sep 27, 2011 · 18 comments


None yet
6 participants

gracjan commented Sep 27, 2011

After cabal-dev install-deps in 0.8 cabal-dev ghci worked properly, in 0.9 it is broken. It says:

pwd:proj gracjan$ cabal-dev ghci
cabal-dev: user error (cabal: ghc-pkg: /Users/gracjan/proj/cabal-dev/packages-6.12.3.conf:
openFile: does not exist (No such file or directory)

Proper directory listed should be:


Note 'Code' part.


creswick commented Sep 29, 2011

This sounds suspiciously like some unexpected aspect of your environment is tweaking paths, but I'm at a bit of a loss as to what.

Could you reproduce this and include the output of pwd, and check to see if there are any symlinks between your location and the filesystem root?

cabal-dev ghci produces:
cabal-dev: user error (cabal: Run the 'configure' command first)
with cabal-dev-0.9 on archlinux, ghc-7.2.1

PS I have no symlinks in ~/.


creswick commented Oct 17, 2011

Have you moved the project directory and/or cabal-dev sandbox to a new location on the filesystem? (possibly by creating the Code directory?)

Can you reproduce this if you move / delete the sandbox?

Tried moving ~/cabal-dev to ~/Code/cabal-dev => same usr error.


creswick commented Oct 19, 2011

I'm sorry, my question was a bit ambiguous.

I think the problem is that the path without the Code was backed into some artifacts in the sandbox during the build -- we know that this sort of thing does happen with cabal, but I've been unable to reproduce your exact error message.

One way to test this is to remove the sandbox and rebuild everything with cabal-dev:

  • Delete the sandbox (or, if you want to save the existing sandbox for later analysis/use, copy it somewhere outside of your build tree, or rename it.)
  • $ cabal-dev install
  • $ cabal-dev ghci
  • then see what happens.

If that still causes the error you're seeing, then we'll have a concrete scenario to work from. It's not clear that your existing sandbox isn't corrupted or fixed to a specific (different) path right now, and that uncertainty makes it hard for us to debug. The steps above will separate out some things that could be causing the problem, in a way that will give us a better chance at reproducing the specific issue you're running into.


Moved ~/Code/cabal-dev.
cd Code
I'm afraid cabal-dev install produces "cabal: ghc=pkg: 3: unrecognised field or section "
It does however create a new sandbox.
cabal-dev ghci produces ""cabal-dev user error (cabal: No cabal file found. Please create a package description file .cabal

To detect any of my cabal-dev pkgs I had to set GHC_PACKAGE_PATH as per ghc docs. However there's a hackage trac ticket #335 suggesting deprecating this envvar in favour of --package-db. I haven;t tried it as I haven't guessed the needed syntax :)
Thanks for the help...

gracjan commented Oct 22, 2011

Note: I tried to reproduce my error in some sensible way and failed to extract a test case out of it. Will try harder later!


creswick commented Oct 22, 2011

Ok - keep us posted!


creswick commented Feb 7, 2012

gracjan - have you been able to reproduce this? (If not, I'd like to close this bug report)

gracjan commented Feb 8, 2012

Close it as I have no idea what is going on. I hope it will just go away.


creswick commented Feb 8, 2012

I'd like to figure out what's going on, if you're still having issues.

If you are still having problems, could you send:

  • the output of running the problematic cabal-dev commands with --verbose=3
  • if using ghc6, the package-<version>.conf from the cabal-dev sandbox?

jimstutt commented Feb 8, 2012

Only just got notified of you Oct 19th post. Unfortunately I ditched ghc-7.2.1 after multiple failures so can't even try to reproduce the problem. Perhaps it was limited to ghc-7.2.1? Can close for me.

dowski commented Feb 28, 2012

Just updated to 0.9.1. I'm having an issue similar to the one the OP described.

$ cabal-dev ghci
cabal-dev: user error (cabal: Cannot find the program 'ghc' at 'fake-ghc-cabal-dev' or on the path

creswick commented Feb 29, 2012

@dowski Could you post how you got to a freshly build environment? I think the problem is related to how the sandbox is built (I got your follow-up with the $ cabal-dev -v3 ghci, but I'm not sure why it's not showing up on github).

Seeing this now, FYI. Going to update my whole operating system so will check back in a bit with more detail if the problem persists.

Here is my cabal-dev ghci --verbose=3 output
dependencies installed with -prof for PostTest package (not in hackage, just my stuff)

cabal-dev 0.9.1
built with Cabal 1.14.0
searching for cabal in path.
found cabal at /home/razor/.cabal/bin/cabal
/home/razor/.cabal/bin/cabal is version 0.14.0
Using cabal-install 0.14.0 at FoundOnSystem {locationPath =
No sandbox specified. Using cabal-dev
Using cabal-dev as the relative cabal-dev sandbox
Using /home/razor/teststorage/cabal-dev as the cabal-dev sandbox
Creating local repo /home/razor/teststorage/cabal-dev/packages
searching for ghc-pkg in path.
found ghc-pkg at /usr/bin/ghc-pkg
/usr/bin/ghc-pkg is version 7.4.2
Using ghc-pkg 7.4.2
Complete arguments to cabal-install:
searching for ghc in path.
found ghc at /usr/bin/ghc
/usr/bin/ghc is version 7.4.2

on the commandline:
    Warning: -O conflicts with --interactive; -O ignored.
GHCi, version 7.4.2: http://www.haskell.org/ghc/  :? for help
Glasgow Haskell Compiler, Version 7.4.2, stage 2 booted by GHC version 7.4.1
Using binary package database: /usr/lib64/ghc-7.4.2/package.conf.d/package.cache
Using binary package database: /home/razor/teststorage/cabal-dev/packages-7.4.2.conf/package.cache
Using package config file: dist/package.conf.inplace
wired-in package ghc-prim mapped to ghc-prim-
wired-in package integer-gmp mapped to integer-gmp-
wired-in package base mapped to base-
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags: -fscc-profiling -static
*** Deleting temp files:
*** Deleting temp dirs:
ghc: --interactive can't be used with -prof or -unreg.
Usage: For basic information, try the `--help' option.
/usr/bin/ghc returned ExitFailure 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment