Reimplement shadowing on a per database basis.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Tue, 27 Oct 2015 21:47:33 +0000 (14:47 -0700)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Fri, 30 Oct 2015 22:14:05 +0000 (15:14 -0700)
commit39b71e81ec1044518f065d0055676d713521e483
tree2ebf64b72c4f81138a07199571b21bd3ec6dd7c5
parent91c6b1f54aea658b0056caec45655475897f1972
Reimplement shadowing on a per database basis.

Summary:
This commit reimplements shadowing on package databases by doing
the shadowing calculation on a per-database basis: specifically,
if a later package database shadows a package from the earlier
databases, we first remove that package (and its transitive
dependencies) before merging the databases together.

This should also fix bootstrapping GHC HEAD with HEAD.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: ggreif, bgamari, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1385
compiler/main/DynFlags.hs
compiler/main/Packages.hs
testsuite/tests/cabal/Makefile
testsuite/tests/cabal/shadow.stderr
testsuite/tests/cabal/shadow.stdout