Skip to content

Package cabal-doctest missing when calling plan-to-nix #390

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

Closed
nek0 opened this issue Jan 5, 2020 · 4 comments
Closed

Package cabal-doctest missing when calling plan-to-nix #390

nek0 opened this issue Jan 5, 2020 · 4 comments

Comments

@nek0
Copy link

nek0 commented Jan 5, 2020

HI,

When building an environment for a multi-package project I have to use plan-to-nix, according to the user handbook. When doing so, the package cabal-doctest seems not to be included into the package definitions of pkgs.nix and the build fails with:

error: Neither the Haskell package set or the Nixpkgs package set contain the package: cabal-doctest (build tool dependency).

If this is a system dependency:
You may need to augment the system package mapping in haskell.nix so that it can be found.

If this is a Haskell 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.

I'm not using stack, just plain cabal, to build my projects and I updated the package definitions.

Can somebody have a look into this matter, please?

@angerman
Copy link
Collaborator

angerman commented Jan 6, 2020

I believe this is related to #388. What I assume that is happening is that you have a build-type: Custom in your .cabal file and a Setup.hs that depends on cabal-doctest. However cabal-doctest is not(?) properly listed in the build-depends/setup-depends? And thus the plan doesn't contain cabal-doctest and subsequently when trying to build the custom Setup.hs we fail to find cabal-doctest for it.

@nek0
Copy link
Author

nek0 commented Jan 7, 2020

none of my projects uses build-type: Custom, so I don't know, where this comes from...

@dhess
Copy link
Contributor

dhess commented Feb 20, 2020

I had the same issue in my project and was able to work around it by adding this to my haskell-nix.cabalProject derivation, per #221:

  modules = [
    { reinstallableLibGhc = true; }
  ];

@hamishmack
Copy link
Collaborator

reinstallableLibGhc is now the default and I think cabal-doctest support works reasonably well now. See https://github.com/input-output-hk/haskell.nix/tree/master/test/cabal-doctests for an example.

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

4 participants