Rename PackageId to PackageKey, distinguishing it from Cabal's PackageId.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Sat, 19 Jul 2014 16:11:08 +0000 (17:11 +0100)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Mon, 21 Jul 2014 15:45:17 +0000 (08:45 -0700)
commit4bebab25e4c9a3bfccc491d4dd13c685629cd1de
tree25ad202438a52c814d27cb62e1d02c566d30720b
parentc26bba843f35ea843c2eafe68daf1e4545572447
Rename PackageId to PackageKey, distinguishing it from Cabal's PackageId.

Summary:
Previously, both Cabal and GHC defined the type PackageId, and we expected
them to be roughly equivalent (but represented differently).  This refactoring
separates these two notions.

A package ID is a user-visible identifier; it's the thing you write in a
Cabal file, e.g. containers-0.9.  The components of this ID are semantically
meaningful, and decompose into a package name and a package vrsion.

A package key is an opaque identifier used by GHC to generate linking symbols.
Presently, it just consists of a package name and a package version, but
pursuant to #9265 we are planning to extend it to record other information.
Within a single executable, it uniquely identifies a package.  It is *not* an
InstalledPackageId, as the choice of a package key affects the ABI of a package
(whereas an InstalledPackageId is computed after compilation.)  Cabal computes
a package key for the package and passes it to GHC using -package-name (now
*extremely* misnamed).

As an added bonus, we don't have to worry about shadowing anymore.

As a follow on, we should introduce -current-package-key having the same role as
-package-name, and deprecate the old flag.  This commit is just renaming.

The haddock submodule needed to be updated.

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/D79

Conflicts:
compiler/main/HscTypes.lhs
compiler/main/Packages.lhs
utils/haddock
56 files changed:
compiler/basicTypes/DataCon.lhs
compiler/basicTypes/Module.lhs
compiler/basicTypes/Module.lhs-boot
compiler/basicTypes/Name.lhs
compiler/basicTypes/RdrName.lhs
compiler/cmm/CLabel.hs
compiler/cmm/CmmParse.y
compiler/codeGen/StgCmmCon.hs
compiler/codeGen/StgCmmExtCode.hs
compiler/codeGen/StgCmmHeap.hs
compiler/codeGen/StgCmmLayout.hs
compiler/codeGen/StgCmmMonad.hs
compiler/codeGen/StgCmmProf.hs
compiler/codeGen/StgCmmTicky.hs
compiler/codeGen/StgCmmUtils.hs
compiler/coreSyn/CorePrep.lhs
compiler/deSugar/Coverage.lhs
compiler/deSugar/DsForeign.lhs
compiler/deSugar/DsMeta.hs
compiler/ghci/ByteCodeLink.lhs
compiler/ghci/DebuggerUtils.hs
compiler/ghci/Linker.lhs
compiler/hsSyn/Convert.lhs
compiler/iface/BinIface.hs
compiler/iface/LoadIface.lhs
compiler/iface/MkIface.lhs
compiler/main/CodeOutput.lhs
compiler/main/DriverPipeline.hs
compiler/main/DynFlags.hs
compiler/main/Finder.lhs
compiler/main/GHC.hs
compiler/main/GhcMake.hs
compiler/main/HscMain.hs
compiler/main/HscTypes.lhs
compiler/main/InteractiveEval.hs
compiler/main/PackageConfig.hs
compiler/main/Packages.lhs
compiler/main/SysTools.lhs
compiler/main/TidyPgm.lhs
compiler/nativeGen/AsmCodeGen.lhs
compiler/nativeGen/X86/CodeGen.hs
compiler/parser/Lexer.x
compiler/prelude/ForeignCall.lhs
compiler/prelude/PrelNames.lhs
compiler/prelude/PrimOp.lhs
compiler/rename/RnNames.lhs
compiler/rename/RnSource.lhs
compiler/typecheck/TcEnv.lhs
compiler/typecheck/TcErrors.lhs
compiler/typecheck/TcGenDeriv.lhs
compiler/typecheck/TcRnDriver.lhs
compiler/typecheck/TcRnTypes.lhs
compiler/typecheck/TcSplice.lhs
docs/users_guide/7.10.1-notes.xml
ghc/InteractiveUI.hs
utils/haddock