[GHC] #9265: Extend PackageId to include version dependency information

GHC ghc-devs at haskell.org
Mon Jul 21 15:47:20 UTC 2014


#9265: Extend PackageId to include version dependency information
-------------------------------------+------------------------------------
        Reporter:  ezyang            |            Owner:  ezyang
            Type:  feature request   |           Status:  new
        Priority:  high              |        Milestone:  7.10.1
       Component:  Package system    |          Version:  7.9
      Resolution:                    |         Keywords:  backpack
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by Edward Z. Yang <ezyang@…>):

 In [changeset:"4bebab25e4c9a3bfccc491d4dd13c685629cd1de/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="4bebab25e4c9a3bfccc491d4dd13c685629cd1de"
 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 at 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
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9265#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list