Skip to content
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

build-tool-depends entries don't get added to 'depends', and thus won't be in shellFor #95

Closed
ocharles opened this issue Sep 6, 2020 · 2 comments

Comments

@ocharles
Copy link

ocharles commented Sep 6, 2020

It seems that the correct way to use tasty-discover is to add it to a test-suites build-tool-depends section, rather than just build-depends. build-tool-depends guarantees that it's on $PATH at build time, which is needed for it to work as it's a GHC preprocessor. However, if we do this then it correctly builds as a component, but the derived shellFor doesn't include tasty-discover. Looking at the output of cabal-to-nix, we see:

      tests = {
        "tests" = {
          depends = [
            ...
            (hsPkgs."tasty" or (errorHandler.buildDepError "tasty"))
            (hsPkgs."tasty-hedgehog" or (errorHandler.buildDepError "tasty-hedgehog"))
            (hsPkgs."tasty-hspec" or (errorHandler.buildDepError "tasty-hspec"))
            ];
          build-tools = [
            (hsPkgs.buildPackages.tasty-discover or (pkgs.buildPackages.tasty-discover or (errorHandler.buildToolDepError "tasty-discover")))
            ];
          buildable = true;
          };
        };

Note that tasty-discover is not in depends. But in shellFor, we have:

  packageInputs = removeSelectedPackages (lib.concatMap (cfg: cfg.depends) selectedConfigs) ++ additionalPackages;

which only looks at depends.

@ocharles
Copy link
Author

ocharles commented Sep 6, 2020

Perhaps the other fix is for shellFor to also add build-tools?

@ocharles
Copy link
Author

ocharles commented Sep 6, 2020

Closing as I think input-output-hk/haskell.nix#839 is really where this issue belongs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant