Skip to content

How to ignore test dependencies from local package dependencies in shellFor? #2403

Closed
@dten

Description

@dten

I'm using a stack project and shellFor and I've been struggling to target recent nightly snapshots.

I'm using persistent-postgresql which has a test component that depends on persistent-test which has dropped out of stackage and they don't plan on getting it back in. persistent-postgresql is in the nightly and I can successfully build and test my own package.

However, when using shellFor I end up with it refusing to build because of the transitive test dependencies.

I've tried various things such as setting doChecks = false, or using dontCheck to no avail. packages = ps: []; let the shell load but I assume misses the point. Given that, I thought packages = ps: builtins.attrValues (pkgs.haskell-nix.haskellLib.selectProjectPackages ps); would help but it results in the same error.

Thanks for any assistance you can offer.

error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       … while evaluating derivation 'ghc-shell-for-packages'
         whose name attribute is located at /nix/store/g1wkcpwadmnn20lwbik5kfwnvfrc6ahi-source/pkgs/stdenv/generic/make-derivation.nix:716:13

       … while evaluating attribute 'CABAL_CONFIG' of derivation 'ghc-shell-for-packages'
         at /nix/store/hhmh6a99xh0r6wkphbpbvrn1iazg4nzz-source/builder/shell-for.nix:210:5:
          209|   } // lib.optionalAttrs exactDeps {
          210|     CABAL_CONFIG = "${ghcEnv.drv}/configFiles/cabal.config";
             |     ^
          211|   })

       … while evaluating the option `packages.persistent-postgresql.components.tests.test.depends':

       … while evaluating definitions from `/nix/store/hhmh6a99xh0r6wkphbpbvrn1iazg4nzz-source/modules/plan.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: The Haskell package set does not contain the package: persistent-test (build dependency).
       If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.

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