Skip to content

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

Closed
@ocharles

Description

@ocharles

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions