Skip to content

Get rid of the default GHC and default haskellPackages #729

Closed
@michaelpj

Description

@michaelpj

Having a default GHC/haskellPackages (anywhere) is IMO a trap:

  • It makes it easy to do things that don't actually match the compiler version that people are using.
  • It makes updating risky: if we change the defaults and you're relying on them in any way then you'll get big changes even if nothing changes in your project. We should really insist the user controls this.
    • If we update the default compiler version that could easily break people's build in a slightly non-obvious way.
    • If we update the (random) stackage snapshot that haskellPackages come from then all sorts of things might change.
    • So we have to be overly careful updating these because we might cause arbitrary breakage to users.

Now, arguably it makes getting started easier, but I don't buy this. Even if you're setting up a cabal project (for Stack projects we get the version from the snapshot, which is fine), you know what compiler version you use and it's not too onerous to specify it.

I don't object to us having some defaults for e.g. our tests, but I don't think we should expose them.

Quick survey of where these things are used (I renamed them and then went through fixing all the places that were needed to eval ci.nix.):

  • defaultCompilerNixName
    • This only really affects the defaults for callCabalToNix.
    • That's used in mkCacheLine. I think this is a bug: we're in the context of a project so we should be using the project's ghc.
    • It also potentially pops up in lots of cabalProjects/hackage-packages: I don't know how far this penetrates but it worries me.
  • haskellPackages
    • Used for the bootPackages for ghc101. I think this might be a bug, or at least it's pretty suspicious (do we really want this to change based on the stackage snapshot for haskellPackages??).
    • Used for our default hpack: this is something we might have to have a default version for, but I think we should just do that explicitly with a hackage-package for hpack specifically so we control it carefully. Or maybe we can just add it to pkg-def-extras or something?

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