I'm trying to run ghcid/ghci in a nix-shell, which always presents the problem of test dependencies being invisible. As a workaround I wanted to try and use a cabal flag that adds those same dependencies to the library. Now the problem is that I have to activate that flag for the ghci session.
My intuition was that I would have to enable the flag on the package I pass to nix-shell as dependency, like so:
curious, propagatedBuildInputs doesn't seem to contain the test deps here (I looked at them with builtins.trace). Do you define them something like this?
looks like there's some weirdness going on in ghc.shellFor that I'm unable to figure out.
Despite the test deps being present in buildInputs of the package derivation and shellFor forwarding those to mkDerivation, and appending the buildInputs manually passed to shellFor (where I also tried adding hedgehog explicitly), the test dep isn't visible to ghci.
However, replacing shellFor with mkDerivation and using your ghcWithPackages method seems to work just fine, so I guess I'll be using that for now :shrug:
I'm trying to run
ghcid
/ghci
in anix-shell
, which always presents the problem of test dependencies being invisible. As a workaround I wanted to try and use a cabal flag that adds those same dependencies to the library. Now the problem is that I have to activate that flag for the ghci session.My intuition was that I would have to enable the flag on the package I pass to
nix-shell
as dependency, like so:but that doesn't have the desired effect.
Anyone have an idea?
I usually do something along the lines of
It's the
propagatedBuildInputs
which brings the test depscurious,
propagatedBuildInputs
doesn't seem to contain the test deps here (I looked at them withbuiltins.trace
). Do you define them something like this?Yeah, although with cabal, but shouldn't make a difference
hmm I think I have
dontCheck
somewhere, maybe that thwarts my effortsSounds sensible enough
looks like there's some weirdness going on in
ghc.shellFor
that I'm unable to figure out.Despite the test deps being present in
buildInputs
of the package derivation andshellFor
forwarding those tomkDerivation
, and appending thebuildInputs
manually passed toshellFor
(where I also tried addinghedgehog
explicitly), the test dep isn't visible toghci
.However, replacing
shellFor
withmkDerivation
and using yourghcWithPackages
method seems to work just fine, so I guess I'll be using that for now :shrug:in any case, thanks :100: for your input!