Changes between Version 7 and Version 8 of Commentary/Packages
- Timestamp:
- 08/25/09 06:45:19 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Commentary/Packages
v7 v8 30 30 == Identifying Packages == 31 31 32 ` PackageName` ("base")::32 `Cabal.PackageName` ("base"):: 33 33 A string. Defined in `Distribution.Package`. Does not uniquely identify a package: the package 34 34 database can contain several packages with the same name. 35 35 36 ` PackageIdentifier` ("base-4.1.0.0")::37 A `PackageName` plus a `Version`. A `PackageId entifier` names an API. If two `PackageIdentifiers`are38 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. 39 39 [[BR]][[BR]] 40 `InstalledPackageInfo` contains the field ` package :: PackageIdentifier`.40 `InstalledPackageInfo` contains the field `sourcePackageId :: PackageId`. 41 41 [[BR]][[BR]] 42 In GHC 6.11, the `PackageId entifier` also uniquely identifies a package instance in the package database, but42 In GHC 6.11, the `PackageId` also uniquely identifies a package instance in the package database, but 43 43 only by convention (we may lift this restriction in the future, and allow the database to contain 44 multiple package instances with the same `PackageId entifier` (and different `InstalledPackageId`s).44 multiple package instances with the same `PackageId` (and different `InstalledPackageId`s). 45 45 46 ` InstalledPackageId` ("base-4.1.0.0-1mpgjN")::46 `Cabal.InstalledPackageId` ("base-4.1.0.0-1mpgjN"):: 47 47 (introduced in GHC 6.12 / Cabal 1.7.2) A string that uniquely identifies a package instance in the database. 48 48 An `InstalledPackageId` identifies an ABI: if two `InstalledPackageIds` are the same, they have the 49 49 same ABI. 50 50 [[BR]][[BR]] 51 `InstalledPackageInfo` contains the field ` package :: PackageIdentifier`.51 `InstalledPackageInfo` contains the field `installedPackageId :: InstalledPackageId`. 52 52 [[BR]][[BR]] 53 53 Dependencies between installed packages are identified by the `InstalledPackageId`. An `InstalledPackageId` is 54 c urrently chosen by adding a random suffix to the string representing the `PackageIdentifier` when a package is55 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`. 56 56 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):: 58 58 Inside GHC, we use the type `PackageId`, which is a `FastString`. The (Z-encoding of) `PackageId` prefixes each 59 59 external symbol in the generated code, so that the modules of one package do not clash with those of another package,
