diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-07-19 17:11:08 +0100 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-07-21 08:45:17 -0700 |
commit | 4bebab25e4c9a3bfccc491d4dd13c685629cd1de (patch) | |
tree | 25ad202438a52c814d27cb62e1d02c566d30720b /docs | |
parent | c26bba843f35ea843c2eafe68daf1e4545572447 (diff) | |
download | haskell-4bebab25e4c9a3bfccc491d4dd13c685629cd1de.tar.gz |
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
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/7.10.1-notes.xml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/users_guide/7.10.1-notes.xml b/docs/users_guide/7.10.1-notes.xml index 8d0545ebf3..0af4c3145b 100644 --- a/docs/users_guide/7.10.1-notes.xml +++ b/docs/users_guide/7.10.1-notes.xml @@ -234,6 +234,27 @@ </sect3> <sect3> + <title>ghc</title> + <itemizedlist> + <listitem> + <para> + Many internal functions in GHC related to package IDs have been + renamed to refer to package keys, e.g. <literal>PackageId</literal> + is now <literal>PackageKey</literal>, the wired-in names + such as <literal>primPackageId</literal> are now + <literal>primPackageKey</literal>, etc. This reflects a distinction + that we are now making: a package ID is, as before, the user-visible + ID from Cabal <literal>foo-1.0</literal>; a package key is now + a compiler-internal entity used for generating linking symbols, and + may not correspond at all to the package ID. In + particular, there may be multiple package keys per + package ID. + </para> + </listitem> + </itemizedlist> + </sect3> + + <sect3> <title>ghc-prim</title> <itemizedlist> <listitem> |