On Sun, Mar 29, 2015 at 4:00 PM, Ricardo Wurmus <[email protected]> wrote: > > Ludovic Courtès writes: > >> Isn’t there any environment variable akin to LD_LIBRARY_PATH or >> GUILE_LOAD_PATH? That would greatly simplify things. > > There is the GHC_PACKAGE_PATH environment variable which is supposed to > be a colon-separated list of package databases. > > See section 4.9.5.1 in the latest GHC user guide. > https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/packages.html
There are a couple of considerations about this: * All Hackage packages are based on Cabal, not the GHC specific tools. If GHC_PACKAGE_PATH is set, running the configure phase "runhaskell Setup.hs configure" will stop with a message saying that Cabal is not compatible with the use of this variable. NixOS does the same: in the build phase they explicitly unset GHC_PACKAGE_PATH and build a temporary database: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/generic-builder.nix * AFAIU the directories listed in GHC_PACKAGE_PATH must still include a database cache named 'package.cache' (section 4.9.5 of the GHC manual). Therefore, the fix file name would clash in profiles and prevent the use of libraries in profiles. Having never used nixpkgs, I'm not sure how they handle the database in profiles. Would you have a pointer to a "standard" mechanism (like how they handle 'dir' files, icon caches, ...). Regards, Fede
