[Nix-dev] Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with Cabal. Use the flag --package-db to specify a package database (it can be used multiple times)

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Sat Aug 23 00:08:17 CEST 2014


On 08/22/2014 11:02 PM, Mateusz Kowalczyk wrote:
> On 08/15/2014 05:22 AM, Mateusz Kowalczyk wrote:
>> Hi,
>>
>> I'd like to know the solution to the error message in the subject. I
>> have encountered it in the past if inside a Haskell project I did
>> something like
>>
>> nix-shell --pure
>> eval "$configurePhase" && eval "$buildPhase" && eval "$checkPhase"
>>
>> While this bothered me, the workaround was to exit and re-enter the
>> shell after buildPhase and run checkPhase then.
>>
>> But now I want to actually test a package that this happens in on my
>> local Hydra and when it goes to run the test-suite, I get precisely that
>> message.
>>
>> The package in question is Haddock here which is set to ‘doCheck =
>> false’ in nixpkgs even though I personally happen to know that the tests
>> do pass when actually ran. Not running the test-suite is obviously not
>> acceptable when you're the package maintainer…
>>
>> Any ideas?
>>
> 
> I find that if I unset GHC_PACKAGE_PATH after ‘eval "$buildPhase"’ then
> the tests will run. While one can arrange this with some hooks on
> per-package basis, I'd be interested to hear if why we're setting
> GHC_PACKAGE_PATH after during the buildPhase to begin with. Perhaps the
> default could be that it is not set or if cabal does that, that we unset
> it. It seems that if this was useful then we would set it at the point
> build starts (before configure or after). AFAIK any packages that make
> use of GHC_PACKAGE_PATH just call out to ghc-pkg anyway and put together
> a GHC_PACKAGE_PATH from scratch.
> 
> Can we just unset/never set GHC_PACKAGE_PATH by default?
> 

Issue at https://github.com/NixOS/nixpkgs/issues/3721 .

-- 
Mateusz K.


More information about the nix-dev mailing list