Closed
Description
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.
- e.g. Make it easier to cache eval-time dependencies. #728 (comment):
haskellNixRoots
is based on the default compiler not the one you used for your project. - I think this may actually lead to some bugs in haskell.nix (see below).
- e.g. Make it easier to cache eval-time dependencies. #728 (comment):
- 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
cabalProject
s/hackage-package
s: I don't know how far this penetrates but it worries me.
- This only really affects the defaults for
haskellPackages
- Used for the
bootPackages
forghc101
. 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 forhaskellPackages
??). - 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 ahackage-package
forhpack
specifically so we control it carefully. Or maybe we can just add it topkg-def-extras
or something?
- Used for the
Metadata
Metadata
Assignees
Labels
No labels