Changes between Version 7 and Version 8 of Commentary/Packages


Ignore:
Timestamp:
Aug 25, 2009 1:45:19 PM (5 years ago)
Author:
duncan
Comment:

bring the package Id type/field names up to date, also mention ghc --abi-hash

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Packages

    v7 v8  
    3030== Identifying Packages == 
    3131 
    32  `PackageName` ("base"):: 
     32 `Cabal.PackageName` ("base"):: 
    3333    A string.  Defined in `Distribution.Package`.  Does not uniquely identify a package: the package 
    3434    database can contain several packages with the same name. 
    3535 
    36  `PackageIdentifier` ("base-4.1.0.0"):: 
    37     A `PackageName` plus a `Version`.  A `PackageIdentifier` names an API.  If two `PackageIdentifiers` are 
    38     the same, they have the same API. 
     36 `Cabal.PackageId` ("base-4.1.0.0"):: 
     37    A `PackageName` plus a `Version`.  A `PackageId` names an API.  If two `PackageId`s are 
     38    the same, they are assumed to have the same API. 
    3939    [[BR]][[BR]] 
    40     `InstalledPackageInfo` contains the field `package :: PackageIdentifier`. 
     40    `InstalledPackageInfo` contains the field `sourcePackageId :: PackageId`. 
    4141    [[BR]][[BR]] 
    42     In GHC 6.11, the `PackageIdentifier` also uniquely identifies a package instance in the package database, but 
     42    In GHC 6.11, the `PackageId` also uniquely identifies a package instance in the package database, but 
    4343    only by convention (we may lift this restriction in the future, and allow the database to contain 
    44     multiple package instances with the same `PackageIdentifier` (and different `InstalledPackageId`s). 
     44    multiple package instances with the same `PackageId` (and different `InstalledPackageId`s). 
    4545 
    46  `InstalledPackageId` ("base-4.1.0.0-1mpgjN")::  
     46 `Cabal.InstalledPackageId` ("base-4.1.0.0-1mpgjN")::  
    4747    (introduced in GHC 6.12 / Cabal 1.7.2) A string that uniquely identifies a package instance in the database. 
    4848    An `InstalledPackageId` identifies an ABI: if two `InstalledPackageIds` are the same, they have the 
    4949    same ABI. 
    5050    [[BR]][[BR]] 
    51     `InstalledPackageInfo` contains the field `package :: PackageIdentifier`. 
     51    `InstalledPackageInfo` contains the field `installedPackageId :: InstalledPackageId`. 
    5252    [[BR]][[BR]] 
    5353    Dependencies between installed packages are identified by the `InstalledPackageId`.  An `InstalledPackageId` is 
    54     currently chosen by adding a random suffix to the string representing the `PackageIdentifier` when a package is 
    55     registered. 
     54    chosen when a package is registered. It is chosen by calling `ghc --abi-hash` on the compiled modules and appending 
     55    the hash as a suffix to the string representing the `PackageIdentifier`. 
    5656 
    57  `PackageId` (these currently look like "base-4.1.0.0" in GHC 6.12):: 
     57 `GHC.PackageId` (these currently look like "base-4.1.0.0" in GHC 6.12):: 
    5858    Inside GHC, we use the type `PackageId`, which is a `FastString`.  The (Z-encoding of) `PackageId` prefixes each 
    5959    external symbol in the generated code, so that the modules of one package do not clash with those of another package,