Package keys (for linking/type equality) separated from package IDs.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Fri, 18 Jul 2014 13:48:47 +0000 (14:48 +0100)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Tue, 5 Aug 2014 09:08:02 +0000 (10:08 +0100)
commit66218d15b7c27a4a38992003bd761f60bae84b1f
tree2537bf88de77a1a7f98204c498b0f623308d3cb6
parentedff1efa74edcfa9db0010ae92e1e159ecb60b7e
Package keys (for linking/type equality) separated from package IDs.

This patch set makes us no longer assume that a package key is a human
readable string, leaving Cabal free to "do whatever it wants" to allocate
keys; we'll look up the PackageId in the database to display to the user.
This also means we have a new level of qualifier decisions to make at the
package level, and rewriting some Safe Haskell error reporting code to DTRT.

Additionally, we adjust the build system to use a new ghc-cabal output
Make variable PACKAGE_KEY to determine library names and other things,
rather than concatenating PACKAGE/VERSION as before.

Adds a new `-this-package-key` flag to subsume the old, erroneously named
`-package-name` flag, and `-package-key` to select packages by package key.

RFC: The md5 hashes are pretty tough on the eye, as far as the file
system is concerned :(

ToDo: safePkg01 test had its output updated, but the fix is not really right:
the rest of the dependencies are truncated due to the fact the we're only
grepping a single line, but ghc-pkg is wrapping its output.

ToDo: In a later commit, update all submodules to stop using -package-name
and use -this-package-key.  For now, we don't do it to avoid submodule
explosion.

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

Reviewers: simonpj, simonmar, hvr, austin

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D80
74 files changed:
compiler/basicTypes/Module.lhs
compiler/ghc.cabal.in
compiler/ghc.mk
compiler/ghci/Linker.lhs
compiler/iface/LoadIface.lhs
compiler/llvmGen/LlvmCodeGen/Base.hs
compiler/main/DynFlags.hs
compiler/main/Finder.lhs
compiler/main/HscMain.hs
compiler/main/HscTypes.lhs
compiler/main/PackageConfig.hs
compiler/main/Packages.lhs
compiler/main/Packages.lhs-boot
compiler/utils/Outputable.lhs
docs/users_guide/flags.xml
docs/users_guide/packages.xml
ghc.mk
ghc/InteractiveUI.hs
libraries/Cabal
libraries/base/base.cabal
libraries/bin-package-db/Distribution/InstalledPackageInfo/Binary.hs
libraries/ghc-prim/ghc-prim.cabal
libraries/integer-gmp/integer-gmp.cabal
libraries/integer-simple/integer-simple.cabal
libraries/template-haskell/template-haskell.cabal
rts/ghc.mk
rts/package.conf.in
rules/build-package-way.mk
rules/build-prog.mk
rules/distdir-way-opts.mk
testsuite/.gitignore
testsuite/tests/cabal/T1750A.pkg
testsuite/tests/cabal/T1750B.pkg
testsuite/tests/cabal/cabal06/Makefile [new file with mode: 0644]
testsuite/tests/cabal/cabal06/Setup.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal06/all.T [new file with mode: 0644]
testsuite/tests/cabal/cabal06/cabal06.stderr [new file with mode: 0644]
testsuite/tests/cabal/cabal06/cabal06.stdout [new file with mode: 0644]
testsuite/tests/cabal/cabal06/p-1.0/LICENSE [new file with mode: 0644]
testsuite/tests/cabal/cabal06/p-1.0/P.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal06/p-1.0/p.cabal [new file with mode: 0644]
testsuite/tests/cabal/cabal06/p-1.1/LICENSE [new file with mode: 0644]
testsuite/tests/cabal/cabal06/p-1.1/P.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal06/p-1.1/p.cabal [new file with mode: 0644]
testsuite/tests/cabal/cabal06/q/LICENSE [new file with mode: 0644]
testsuite/tests/cabal/cabal06/q/Q.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal06/q/q-1.0.conf [new file with mode: 0644]
testsuite/tests/cabal/cabal06/q/q.cabal [new file with mode: 0644]
testsuite/tests/cabal/cabal06/r/LICENSE [new file with mode: 0644]
testsuite/tests/cabal/cabal06/r/Main.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal06/r/r.cabal [new file with mode: 0644]
testsuite/tests/cabal/ghcpkg01.stdout
testsuite/tests/cabal/shadow1.pkg
testsuite/tests/cabal/shadow2.pkg
testsuite/tests/cabal/shadow3.pkg
testsuite/tests/cabal/test.pkg
testsuite/tests/cabal/test2.pkg
testsuite/tests/cabal/test3.pkg
testsuite/tests/cabal/test4.pkg
testsuite/tests/cabal/test5.pkg
testsuite/tests/cabal/test7a.pkg
testsuite/tests/cabal/test7b.pkg
testsuite/tests/cabal/testdup.pkg
testsuite/tests/ghc-api/T7478/T7478.hs
testsuite/tests/ghci/linking/Makefile
testsuite/tests/module/base01/Makefile
testsuite/tests/module/mod73.stderr
testsuite/tests/rename/prog006/Makefile
testsuite/tests/rename/should_compile/T3103/test.T
testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly07.stderr
testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly08.stderr
testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout
utils/ghc-cabal/Main.hs
utils/ghc-pkg/Main.hs