Module reexports, fixing #8407.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Fri, 4 Jul 2014 16:01:08 +0000 (17:01 +0100)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Sat, 26 Jul 2014 00:59:55 +0000 (17:59 -0700)
commit7f5c10864e7c26b90c7ff4ed09d00c8a09aa4349
tree45cc2f6c46f9cf583c8aeb7b324933d65586c1d5
parentdae46da7de4d8c7104aea1be48586336bbd486ca
Module reexports, fixing #8407.

The general approach is to add a new field to the package database,
reexported-modules, which considered by the module finder as possible
module declarations.  Unlike declaring stub module files, multiple
reexports of the same physical package at the same name do not
result in an ambiguous import.

Has submodule updates for Cabal and haddock.

NB: When a reexport renames a module, that renaming is *not* accessible
from inside the package.  This is not so much a deliberate design choice
as for implementation expediency (reexport resolution happens only when
a package is in the package database.)

TODO: Error handling when there are duplicate reexports/etc is not very
well tested.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Conflicts:
compiler/main/HscTypes.lhs
testsuite/.gitignore
utils/haddock
41 files changed:
compiler/main/DynFlags.hs
compiler/main/Finder.lhs
compiler/main/GHC.hs
compiler/main/HscTypes.lhs
compiler/main/PackageConfig.hs
compiler/main/Packages.lhs
ghc/InteractiveUI.hs
libraries/Cabal
libraries/bin-package-db/Distribution/InstalledPackageInfo/Binary.hs
testsuite/.gitignore
testsuite/tests/cabal/Makefile
testsuite/tests/cabal/all.T
testsuite/tests/cabal/cabal05/Makefile [new file with mode: 0644]
testsuite/tests/cabal/cabal05/Setup.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal05/all.T [new file with mode: 0644]
testsuite/tests/cabal/cabal05/p/LICENSE [new file with mode: 0644]
testsuite/tests/cabal/cabal05/p/P.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal05/p/P2.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal05/p/Setup.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal05/p/p.cabal [new file with mode: 0644]
testsuite/tests/cabal/cabal05/q/LICENSE [new file with mode: 0644]
testsuite/tests/cabal/cabal05/q/Q.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal05/q/Setup.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal05/q/q.cabal [new file with mode: 0644]
testsuite/tests/cabal/cabal05/r/LICENSE [new file with mode: 0644]
testsuite/tests/cabal/cabal05/r/R.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal05/r/Setup.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal05/r/r.cabal [new file with mode: 0644]
testsuite/tests/cabal/cabal05/s/LICENSE [new file with mode: 0644]
testsuite/tests/cabal/cabal05/s/S.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal05/s/Setup.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal05/s/s.cabal [new file with mode: 0644]
testsuite/tests/cabal/ghcpkg07.stdout [new file with mode: 0644]
testsuite/tests/cabal/recache_reexport_db/a.conf [new file with mode: 0644]
testsuite/tests/cabal/test7a.pkg [new file with mode: 0644]
testsuite/tests/cabal/test7b.pkg [new file with mode: 0644]
utils/ghc-cabal/ghc-cabal.cabal
utils/ghc-pkg/Main.hs
utils/ghc-pkg/ghc-pkg.cabal
utils/ghctags/ghctags.cabal
utils/haddock