Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hawk: multiple package-db's found in sandbox ~/.cabal #169

Open
juhp opened this issue Dec 9, 2016 · 3 comments
Open

hawk: multiple package-db's found in sandbox ~/.cabal #169

juhp opened this issue Dec 9, 2016 · 3 comments

Comments

@juhp
Copy link
Collaborator

juhp commented Dec 9, 2016

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.

@juhp juhp changed the title hawk: multiple package-db's found in sandbox /home/petersen/.cabal hawk: multiple package-db's found in sandbox ~/.cabal Dec 9, 2016
@gelisam
Copy link
Owner

gelisam commented Dec 9, 2016

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.

@juhp
Copy link
Collaborator Author

juhp commented Dec 9, 2016

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?

@gelisam
Copy link
Owner

gelisam commented Dec 9, 2016

Hmm... yes, I think this would work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants