-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shellFor doesn't work with hspec-discover test-suites #231
Comments
I have just run into this. Is there any known workaround? |
I tried adding
|
I've done a little more digging and it looks like cabal is trying to figure out how to resolve the exe component of |
Hmm I've just noticed that the |
Yeah exactly right @purefn - the progam is available on the The workaround is to set |
@rvl I tried that, but ran into issues with cabal coming up with its own plan. It wanted to use a different version of |
Yeah that is the downside. I found in my case that cabal's own plan was fairly similar to the Haskell.nix package set, and it only needed to download and build a handful of packages. |
I'm also affected by this. |
count me in, too. I've set |
I'm also affected by this. |
Worked around this by removing hspec-discover from the .cabal file and specifying an additional module: let pkgSet = pkgs.haskell-nix.mkStackPkgSet {
inherit stack-pkgs;
pkg-def-extras = [];
modules = [
{
# https://github.com/input-output-hk/haskell.nix/issues/231
packages.$pkg.components.tests.$pkg-tests.build-tools = [
pkgSet.config.hsPkgs.hspec-discover
];
}
];
};
in pkgSet.config.hsPkgs Tests run fine in nix-shell ( |
Dependencies provided by haskell.nix do not satisfy build-tool-depends within a nix-shell. We work around that by making tasty-discover a library dependency of chairman tests and rely on the explicit inclusion of the tasty-discover executable as a dependency in nix/haskell.nix. See input-output-hk/haskell.nix#231 We include tasty-discover as a library dependency of cardano-node-chairman because the explicit inclusion of tasty-discover puils it from buildPackages. If tasty-discover is not in build-tools-depends or build-depends, it will not be there at all. Ideally when IntersectMBO#231 is resolved we go back to specifying it in build-tool-depends, remove the explicit inclusion of the executable and everything just works.
We're also affected by this. Our workaround: remove |
It's not possible to convince anyone not already sold on Nix to get rid of hspec-discover, is there any other solution here besides
For my $work codebase, proper handling of |
The latest state of this issue seems to be: #1367 (comment) |
I don't agree: #839 (comment) |
The more general issue is here: #839 |
If the cabal package has a test-suite with
build-tools: hspec-discover
, then cabal will not work in the development shell:The tests component builds fine, because
hspec-discover
is provided in the PATH.But I think the
build-tools
which are haskell packages need to be added into the package database for shells.A disabled test case for this is added in #181.
The text was updated successfully, but these errors were encountered: