Skip to content

Try to find out why hspec-discover and cabal-install often don't play nice with each other when inside a Nix shell.

Notifications You must be signed in to change notification settings

kenranunderscore/hspec-discover-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hspec-discover doesn't work in some Nix shells

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.haskellPackages set, which is done via an overlay.
  • The shell.nix calls pkgs.haskellPackages.shellFor and requests a development shell for the package(s).
  • nix-build ./nix/pkgs.nix -A haskellPackages.hspec-discover-repro works.
  • nix-shell --run "cabal test" fails because the solver seemingly cannot find a plan that includes the test suite. It doesn't work even though hspec-discover is in the PATH inside the Nix shell.
  • nix-shell -p cabal-install ghc --run "cabal test" works, though, if cabal-install is allowed to use Hackage (for instance by doing a cabal update beforehand).
  • nix-shell altShell.nix --run "cabal test" uses myPackage.env, but doesn't work either.

What to do?

  • 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 using build-tool-depends.
  • ?

I don't know of any passable workaround yet.

Links

There seem to be some related issues, albeit with the haskell.nix infrastructure which I haven't used yet.

About

Try to find out why hspec-discover and cabal-install often don't play nice with each other when inside a Nix shell.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published