Closed abhin4v closed 2 years ago
Hi @abhin4v and thanks for opening the issue. I tried but could not reproduce it (which admittedly is a rather funny thing to write in a nix project). I'll look into this in more detail after the holidays. Thanks again for the report.
This is on OSX if that matters. I also tried this in an existing Haskell project in which I copied nixkell generated files to nixify it. The same issue happens there, cabal test
doesn't run but cabal v1-test
works fine.
FWIW, I have verified this behaviour on NixOS as well. Please note that I'm running the commands with no ~/.cabal
directory, as it should not be needed when I'm using nix.
FYI, this issue seems to be because of cabal not finding the hspec-discover executable. See https://github.com/kenranunderscore/hspec-discover-repro for reference. What worked for me was to remove hspec-discover and list the specs directly.
@abhin4v sorted it now, sorry it took so long. It was indeed using build-tool-depends
for hspec-discover
which I removed. hspec
seem to bring hspec-discover
as a transitive dependency even without it so no breakage as far as I can tell:
~/w/foo (master) $ rg hspec package.yaml
78: - hspec
~/w/foo (master) $ ghc-pkg list | rg hspec
hspec-2.7.10
hspec-core-2.7.10
(hspec-discover-2.7.10)
hspec-expectations-0.8.2
~/w/foo (master) $ type -p hspec-discover
/nix/store/lyaipip0mn5q8dbzfyd8dld7s0zxiy6g-aoc2021-env/bin/hspec-discover
Also added active-repositories: none
to cabal.project
to make sure it does not do any sneaky dependency management.
cabal test
command does not work with a fresh clone of the repo. However,cabal v1-test
does work:cabal build
works fine though.