input-output-hk/haskell.nix

When a package depends only on `base` and `template-haskell`, `template-haskell` is not present in the shell

Closed this issue · 1 comments

Describe the bug

I just created a new library with a cabal file, and listed base and template-haskell as dependencies, with no other dependencies. Upon entering a nix-shell, template-haskell was not present, and cabal repl failed as a result. After adding a non-built-in package to my package's build-depends, template-haskell was in the shell, and everything worked.

Steps To Reproduce

Create a minimal cabal package listing only base and template-haskell as dependencies. Enter a standard haskell.nix shell. Run ghc-pkg and observe that template-haskell is not present.

Expected behavior

template-haskell should be present in the nix shell.

Additional context

default.nix:

let haskell-nix = import ./dep/haskell.nix {};
    pkgs = import haskell-nix.sources.nixpkgs haskell-nix.nixpkgsArgs;
in pkgs.haskell-nix.project {
  src = pkgs.haskell-nix.haskellLib.cleanGit {
    name = "haskell-nix-project";
    src = ./.;
  };

  compiler-nix-name = "ghc982";
}

shell.nix:

(import ./default.nix).shellFor {
  tools = {
    cabal = "latest";
    haskell-language-server = "latest";
  };
}

haskell.nix revision: a8026bd

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.