Strictly speaking, the second option (specifying the sandbox as the user db) is a more correct match with what cabal-install does.

On Friday, August 4, 2017, Emil Axelsson <78emil@gmail.com> wrote:
Den 2017-08-04 kl. 19:33, skrev Daniel Trstenjak:

Hi Emil,

On Fri, Aug 04, 2017 at 07:10:09PM +0300, Emil Axelsson wrote:
Ah, I see. I still don't understand what went wrong in this particular case,
but at least it makes sense that there's a difference between `-package-db`
and `cabal exec`.

can you please test if `cabal-cargs` behaves in the same way as `cabal exec`
if you add a `-no-user-package-db` or/and replace `-packabe-db` by `-user-package-db`.

Yes! `-no-user-package-db` does the trick.

I have to admit I had forgotten completely about the user DB. When running `cabal sandbox hc-pkg list` I only see the global one and the one in the sandbox. But `ghc-pkg` shows the user DB and indeed it contains `hashable-1.2.6.1` which was causing me trouble.

Cool, problem solved.

Would it make sense then for `cabal-cargs` to always emit `-no-user-package-db` when it discovers a sandbox?

Cheers

/ Emil

Greetings,
Daniel
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.


--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net