Behavior of GHC_PACKAGE_PATH

Harendra Kumar harendra.kumar at gmail.com
Tue Aug 16 11:08:33 UTC 2016


Hi,

As per the GHC manual (https://downloads.haskell.
org/~ghc/master/users-guide/packages.html#the-ghc-package-
path-environment-variable), packages which come earlier in the
GHC_PACKAGE_PATH supersede the ones which come later. But that does not
seem to be the case always.

I am dealing with a case where I have multiple versions of a package in
different databases. I am passing the list of package dbs via
GHC_PACKAGE_PATH and ghc is picking the one which comes later. I expect it
to pick the one which comes earlier in the path.

In one case the package being picked from a package db which comes later is
a newer version which makes me wonder if GHC always prefers a newer
version. In another case both the versions are same but still GHC is using
the one which come later in the package path. Are there any undocumented
factors into play here?

None of the packages is broken (as reported by ghc-pkg check).

See https://github.com/commercialhaskell/stack/issues/1957#issuecomment-
239655912 for more details on where it is coming from.

Thanks,
Harendra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/glasgow-haskell-users/attachments/20160816/034423a3/attachment.html>


More information about the Glasgow-haskell-users mailing list