hawk
hawk copied to clipboard
hawk: multiple package-db's found in sandbox ~/.cabal
After cabal install haskell-awk
on my machine running ghc-7.10.3, when I try to run hawk -m head
on some output I get:
hawk: multiple package-db's found in sandbox /home/petersen/.cabal
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
hawk works okay for me through stack exec hawk
.
Since hawk expressions can use functions from various libraries, Hawk needs a package database containing those libraries. To find the folder containing the package database, we use a heuristic based on the location of the hawk
executable, and depending on whether you run it as hawk
or stack exec hawk
, this location is different. It looks like you have installed packages in your ~/.cabal
using more than one version of ghc, so you have more than one package database in there, and so hawk doesn't know which one to use.
If you're no longer using your other version of ghc, I recommend deleting the old package databases. If you regularly use more than one version of ghc, then I recommend installing hawk in a sandbox, which will use its own package database.
Thanks for the explanation.
Is it possible for hawk to know what version of ghc it was built with and just chose the pkg db?
Hmm... yes, I think this would work!