cabal-dev icon indicating copy to clipboard operation
cabal-dev copied to clipboard

cabal-dev ghci broken in 0.9

Open gracjan opened this issue 13 years ago • 18 comments

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:

/Users/gracjan/Code/proj/cabal-dev/packages-6.12.3.conf

Note 'Code' part.

gracjan avatar Sep 27 '11 16:09 gracjan

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?

creswick avatar Sep 29 '11 23:09 creswick

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 hth

jimstutt avatar Oct 17 '11 02:10 jimstutt

PS I have no symlinks in ~/.

jimstutt avatar Oct 17 '11 02:10 jimstutt

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?

creswick avatar Oct 17 '11 04:10 creswick

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

jimstutt avatar Oct 19 '11 16:10 jimstutt

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.

Thanks!

creswick avatar Oct 19 '11 22:10 creswick

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 hth

jimstutt avatar Oct 20 '11 09:10 jimstutt

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...

jimstutt avatar Oct 20 '11 09:10 jimstutt

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!

gracjan avatar Oct 22 '11 09:10 gracjan

Ok - keep us posted!

creswick avatar Oct 22 '11 16:10 creswick

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

creswick avatar Feb 07 '12 23:02 creswick

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

gracjan avatar Feb 08 '12 06:02 gracjan

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?

creswick avatar Feb 08 '12 16:02 creswick

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.

jimstutt avatar Feb 08 '12 17:02 jimstutt

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
)

dowski avatar Feb 28 '12 20:02 dowski

@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).

creswick avatar Feb 29 '12 17:02 creswick

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.

killerswan avatar Mar 19 '12 02:03 killerswan

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",["--numeric-version"])
/home/razor/.cabal/bin/cabal is version 0.14.0
Using cabal-install 0.14.0 at FoundOnSystem {locationPath =
"/home/razor/.cabal/bin/cabal"}
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",["--version"])
/usr/bin/ghc-pkg is version 7.4.2
Using ghc-pkg 7.4.2
("/home/razor/.cabal/bin/cabal",["--version"])
Complete arguments to cabal-install:
["--config-file=/home/razor/teststorage/cabal-dev/cabal.config","build","--verbose=3"]
("/home/razor/.cabal/bin/cabal",["--config-file=/home/razor/teststorage/cabal-dev/cabal.config","build","--verbose=3","--with-ghc=fake-ghc-cabal-dev"])
searching for ghc in path.
found ghc at /usr/bin/ghc
("/usr/bin/ghc",["--numeric-version"])
/usr/bin/ghc is version 7.4.2
("/usr/bin/ghc",["--interactive","-o","dist/build/PostTest/PostTest","-v","-hide-all-packages","-fbuilding-cabal-package","-no-user-package-conf","-package-conf","/home/razor/teststorage/cabal-dev/packages-7.4.2.conf","-package-conf","dist/package.conf.inplace","-i","-idist/build/PostTest/PostTest-tmp","-i.","-idist/build/autogen","-Idist/build/autogen","-Idist/build/PostTest/PostTest-tmp","-optP-include","-optPdist/build/autogen/cabal_macros.h","-odir","dist/build/PostTest/PostTest-tmp","-hidir","dist/build/PostTest/PostTest-tmp","-stubdir","dist/build/PostTest/PostTest-tmp","-package-id","base-4.5.1.0-6e4c9bdc36eeb9121f27ccbbcb62e3f3","-package-id","deepseq-1.3.0.0-c26e15897417ecd448742528253d68f6","-package-id","monad-control-0.3.1.4-83560fedcd54bda582bc1867a61c5f8a","-package-id","mtl-2.1.2-02e701f9b1590ee88a0b5b0bd5d93a29","-package-id","postgresql-simple-0.2.4.1-bfaa85df0b0baaf7906c16a11e5a00cd","-package-id","random-1.0.1.1-a214067181e8a7676a1be5e452419444","-package-id","safe-0.3.3-2e88224aa98500bc4dcbbdfb58ba6a17","-package-id","text-0.11.2.3-db61832d0c4660614c4ceff234ed4abb","-package-id","time-1.4-d61e2caaa0486655b4e141dc277ed49f","-package-id","transformers-0.3.0.0-8e66ecc7d4dae2b07b2b5406908c70e4","-O","-main-is","PostTest","-rtsopts","-XHaskell98","./PostTest.hs","-prof","-hisuf","p_hi","-osuf","p_o"])

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-0.2.0.0-7d3c2c69a5e8257a04b2c679c40e2fa7
wired-in package integer-gmp mapped to integer-gmp-0.4.0.0-af3a28fdc4138858e0c7c5ecc2a64f43
wired-in package base mapped to base-4.5.1.0-6e4c9bdc36eeb9121f27ccbbcb62e3f3
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.7.0.0-2bd128e15c2d50997ec26a1eaf8b23bf
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags: -fscc-profiling -static
*** Deleting temp files:
Deleting: 
*** Deleting temp dirs:
Deleting: 
ghc: --interactive can't be used with -prof or -unreg.
Usage: For basic information, try the `--help' option.
/usr/bin/ghc returned ExitFailure 1

s9gf4ult avatar Dec 13 '12 04:12 s9gf4ult