Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
base: d975d877d096
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: 19e09114ba30
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 16, 2019

  1. generic Haskell builder: don't copy packages from GHC

    In order to build the package databases that we will use when compiling
    a Haskell package, we iterate over the relevant dependencies, and if
    they contain a package db, we copy its contents over.
    
    So far so good, except when one of those dependencies is GHC. This
    doesn't happen ordinarily, but it will happen when we construct the
    package database for compiling `Setup.hs`.  This is compiled for the
    build architecture, so we get the build deps, including both the native
    and the cross GHC (if there is one).
    
    In this case, we end up copying the packages from the GHC's package
    database. This is at best unnecessary, since we will get those packages
    from the GHC when we compile with it.
    
    At worst, however, this is semantically questionable. We can end up
    having multiple copies of e.g. Cabal with the same version, but
    (potentially) different contents. At the moment, GHC will expose one of
    these at semi-random depending on which one it looks at "first".
    However, there is a MR open [in
    GHC](https://gitlab.haskell.org/ghc/ghc/merge_requests/545) which as a
    side effect will instead expose both, leading to ambiguous module
    warnings (which is not unreasonable, since it *is* ambiguous).
    
    So what can we do about it? The simplest solution is just to not copy
    the package databases from GHC. GHC is special in this regard, so I
    think it's okay to treat it specially.
    
    This PR should have no effect on anything now, but will prevent any
    breakage when/if the GHC patch lands.
    
    Closes #57706.
    michaelpj authored and peti committed Mar 16, 2019
    Copy the full SHA
    19e0911 View commit details
    Browse the repository at this point in the history