Skip to content

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

Closed
@ryantrinkle

Description

@ryantrinkle

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions