At work we found out that
hspec-discover fails to
be executed when inside our nix-shell. The scenario is as follows:
- The project is fully nixified, that is, the package(s) is part of
the
pkgs.haskellPackagesset, which is done via an overlay. - The
shell.nixcallspkgs.haskellPackages.shellForand requests a development shell for the package(s). nix-build ./nix/pkgs.nix -A haskellPackages.hspec-discover-reproworks.nix-shell --run "cabal test"fails because the solver seemingly cannot find a plan that includes the test suite. It doesn't work even thoughhspec-discoveris in thePATHinside the Nix shell.nix-shell -p cabal-install ghc --run "cabal test"works, though, ifcabal-installis allowed to use Hackage (for instance by doing acabal updatebeforehand).nix-shell altShell.nix --run "cabal test"usesmyPackage.env, but doesn't work either.
- We could try to find out why the executable seemingly cannot be
found when inside the
shellFor-generated shell. That is, try to understand/follow the path resolution that happens when usingbuild-tool-depends. - ?
I don't know of any passable workaround yet.
There seem to be some related issues, albeit with the haskell.nix infrastructure which I haven't used yet.