This project is mirrored from Pull mirroring updated .
  1. 01 Nov, 2015 1 commit
  2. 09 Oct, 2015 1 commit
    • Edward Z. Yang's avatar
      Implement ComponentId, replacing PackageKey and InstalledPackageId. · b083151f
      Edward Z. Yang authored
      Today in Cabal, when you build and install a package, it is
      uniquely identified using an InstalledPackageId which is computed
      using the ABI hash of the library that was installed.  There
      are few problems with doing it this way:
          - In a Nix-like world, we should instead uniquely identify
            build products by some sort of hash on the inputs to the
            compilation (source files, dependencies, flags).  The ABI
            hash doesn't capture any of this!
          - An InstalledPackageId suggests that we can uniquely identify
            build products by hashing the source and dependencies of
            a package as a whole.  But Cabal packages contain many components:
            a library, test suite, executables, etc.  Currently, when
            we say InstalledPackageId, we are really just talking about
            the dependencies of the library; however, this is unacceptable
            if a Cabal package can install multiple libraries; we need
            different identifiers for each.
          - We've also needed to compute another ID, which we've called
            the "package key", which is to be used for linker symbols
            and type equality GHC-side.  It is confusing what the distinction
            between this ID and InstalledPackageIds are; the main reason
            we needed another ID was because the package key was needed
            prior to compilation, whereas the ABI hash was only available
      This patch replaces InstalledPackageId and PackageKey with a
      new identifier called ComponentId, which has the following
          - It is computed per-component, and consists of a package
            name, package version, hash of the ComponentIds
            of the dependencies it is built against, and the name
            of the component.  For example, "foo-0.1-abcdef" continues
            to identify the library of package foo-0.1, but
            "foo-0.1-123455-foo.exe" would identify the executable,
            and "foo-0.1-abcdef-bar" would identify a private sub-library
            named bar.
          - It is passed to GHC to be used for linker symbols and
            type equality.  So as far as GHC is concerned, this is
            the end-all be-all identifier.
          - Cabal the library has a simple, default routine for computing
            a ComponentId which DOES NOT hash source code;
            in a later patch Duncan is working on, cabal-install can
            specify a more detailed ComponentId for a package
            to be built with.
      Here are some knock-on effects:
          - 'id' is a ComponentId
          - 'depends' is now a list of ComponentIds
          - New 'abi' field to record what the ABI of a unit is (as it is no longer
            computed by looking at the output of ghc --abi-hash).
          - The 'HasInstalledPackageId' typeclass is renamed to
          - GHC 7.10 has explicit compatibility handling with
            a 'compatPackageKey' (an 'ComponentId') which is
            in a compatible format.  The value of this is read out
            from the 'key' field.
      Signed-off-by: default avatarEdward Z. Yang <>
  3. 26 Mar, 2015 3 commits
  4. 21 Mar, 2015 1 commit
    • Edsko de Vries's avatar
      Split the PackageInstalled class · 2ea3dde1
      Edsko de Vries authored
      Introduce a new superclass HasInstalledPackageId:
          class Package pkg => HasInstalledPackageId pkg where
            installedPackageId :: pkg -> InstalledPackageId
          class HasInstalledPackageId pkg => PackageInstalled pkg where
            installedDepends :: pkg -> [InstalledPackageId]
      Most functions that deal with the package index now just require
      HasInstalledPackageId; only the functions that actually require the
      dependencies still rely on PackageInstalled.
      The point is that a ConfiguredPackage/ReadyPackage/PlanPackage can reasonably
      be made an instance of HasInstalledPackageId, but not of PackageInstalled; that
      will be the topic of the next, much larger, pull request.
  5. 06 Mar, 2015 2 commits
  6. 08 Jan, 2015 1 commit
    • ttuegel's avatar
      D.Compat.Binary: backport binary generics to binary-0.5 · c650e347
      ttuegel authored
      GHC generics are used to derive binary instances for types appearing
      in the persistent build config, which requires GHC >= 7.2 and
      binary >= 0.7. Unfortunately, GHC < 7.8 ships with binary == 0.5.*.
      The missing module is Data.Binary.Generics, which we have copied from
      binary- to Distribution.Compat.Binary.Generics. To provide
      generic implementations for the Binary class, we also have to provide
      our own implementation, which is copied from binary- to
      Distribution.Compat.Binary.Class. The interface required by Cabal is
      exported from Distribution.Compat.Binary. This is only done if
      bootstrapping Cabal with GHC < 7.8 or if binary >= 0.7 is not available,
      otherwise Distribution.Compat.Binary simply re-exports Data.Binary.
  7. 04 Nov, 2014 1 commit
    • Edward Z. Yang's avatar
      Consolidate exposed-modules and reexported-modules in InstalledPackageInfo. · 1f8a0a20
      Edward Z. Yang authored
      A note first: this patch does NOT modify the user-facing experience in Cabal
      files; it only changes how we register information in the installed package
      This patch takes the exposed-modules and reexported-modules fields in
      the InstalledPackageInfo structure and consolidates them into just the
      exposed module fields, which now has a Maybe flag indicating if a
      module is reexported and, if it is, what the original module was.  I've
      also added in a field for signatures although it is currently unused.
      The big benefit of this change is that it will make processing at the GHC level
      much more uniform when we add signatures: signatures can also be reexported
      and the new representation means we can share the code.
      Signed-off-by: default avatarEdward Z. Yang <>
  8. 03 Oct, 2014 1 commit
    • Edward Z. Yang's avatar
      Switch InstallPlan over to using IPID-indexed PackageIndex. · ff6c718b
      Edward Z. Yang authored
      While this doesn't let us get rid of Distribution.Client.PackageIndex,
      it does make InstallPlan more flexible, so we can have the same
      package name-package version in the install plan multiple times.
      We do this by synthesizing fake installed package IDs to act
      as placeholders prior to compilation.
      There is some shindig with 'FakeMap' in PackageIndex, check out
      the Note in that file for more details.
      This reverts commit a5a0f8e1959003ee702c04a23375a60d48f03f90, with
      a bugfix for linearizeInstallPlan.
      Fixes #2123
  9. 23 Sep, 2014 1 commit
  10. 22 Sep, 2014 1 commit
    • Edward Z. Yang's avatar
      Fix three bugs with fake-map implementation for PackageIndex. · f59bab10
      Edward Z. Yang authored
      1. When we union PackageIndexes together, prefer the later one.
         This idiom is used when we update the processing-state of
         packages in an InstallPlan.
      2. dependencyInconsistencies' was missing a number of indirections
         through the fakeMap, so in some cases we incorrectly concluded
         packages were not equal when they were.
      3. We need to initialize the fakeMap with any pre-installed packages,
         otherwise the invariant check for configured-packages will fail.
      Signed-off-by: default avatarEdward Z. Yang <>
  11. 30 Aug, 2014 1 commit
  12. 27 Aug, 2014 3 commits
    • Edward Z. Yang's avatar
      Switch InstallPlan over to using IPID-indexed PackageIndex. · 6465d174
      Edward Z. Yang authored
      While this doesn't let us get rid of Distribution.Client.PackageIndex,
      it does make InstallPlan more flexible, so we can have the same
      package name-package version in the install plan multiple times.
      We do this by synthesizing fake installed package IDs to act
      as placeholders prior to compilation.
      There is some shindig with 'FakeMap' in PackageIndex, check out
      the Note in that file for more details.
      Signed-off-by: default avatarEdward Z. Yang <>
    • Edward Z. Yang's avatar
      Make Distribution.Simple.PackageIndex polymorphic in package storage. · 4e8c6ecc
      Edward Z. Yang authored
      BC note: renamed type PackageIndex :: * to InstalledPackageIndex.
      The intent is to have cabal-install use this package index in order to
      track information about compilation in progress.  We introduce a new
      PackageInstalled type-class to keep track of data types which have their
      IDs and dependency graphs in InstalledPackageId.
      Signed-off-by: default avatarEdward Z. Yang <>
    • Duncan Coutts's avatar
      Change rep of module re-exports, and do resolution ourselves · a3d3273a
      Duncan Coutts authored
      The initial support for module re-exports relied on ghc-pkg to resolve
      user-specified re-exports to references to specific installed packages.
      This resolution is something that can fail so it's better for Cabal to
      do it during the package configure phase.
      In addition, it is inconvenient in ghc-pkg to be doing this resolution,
      and it just seems fishy as a design. Also, the same ModuleExport type
      was being used both for user-specified source re-exports and also for
      the specific re-exports in the package db.
      This patch splits the type into two: one for source level, and one for
      resolved ones for use in the package db. The configure phase resolves
      one to the other.
      One minor change: it is now possible to re-export a module defined in
      the same package that is not itself exported (ie it's in other-modules,
      rather than exposed-modules). Previously for modules definied in the
      same package they had to be themselves exported. Of course for
      re-exports from other packages they have to be exposed.
  13. 16 Jul, 2014 1 commit
    • Edward Z. Yang's avatar
      Implement "reexported-modules" field, towards fixing GHC bug #8407. · 62450f9a
      Edward Z. Yang authored
      Re-exported modules allow packages to reexport modules from their
      dependencies without having to create stub files.  Reexports of the same
      original module don't count as ambiguous imports when module finding
      occurs.  The syntax is:
          "orig-pkg" OrigName as NewName
      You can omit 'as NewName', in which case it is reexported as the same
      name.  Self referential aliases work too; however, they're only visible
      to packages which depend on this package.
      Left to future work: just provide a module name 'OrigName', where ghc-pkg
      figures out what the source package is.
      Signed-off-by: default avatarEdward Z. Yang <>
  14. 14 Apr, 2014 1 commit
  15. 07 Sep, 2013 1 commit
  16. 25 Jun, 2012 1 commit
    • Duncan Coutts's avatar
      Fix impl of PackageIndex.allPackagesByName · 6192dbf4
      Duncan Coutts authored
      Fixes the problem with generating the haddock documentation contents page for
      all installed packages. Previously we were (accidentally) telling haddock to
      use all versions of each package and haddock would pick the first (lowest
      version). Now we correctly do what we were trying to do all along, which is
      to pick only the highest version of each package.
  17. 23 Oct, 2011 1 commit
  18. 19 Jun, 2011 1 commit
  19. 09 Oct, 2010 1 commit
  20. 29 Nov, 2009 1 commit
  21. 06 Oct, 2009 1 commit
  22. 05 Oct, 2009 1 commit
    • Duncan Coutts's avatar
      Rewrite the PackageIndex again · 15f70a85
      Duncan Coutts authored
      It's a unified index again, rather than one for looking up by an
      InstalledPackageId and one for the source PackageId. The new one
      lets you look up by either. It also maintains the order of
      preference of different installed packages that share the same
      source PackageId. In configure we just pick the first preference.
  23. 22 Aug, 2009 1 commit
  24. 06 Aug, 2009 1 commit
    • Simon Marlow's avatar
      Add a unuque identifier for installed packages (part 3 of 9) · a809635c
      Simon Marlow authored
      This part adds the InstalledPackageIndex type to
      Distribution.Simple.PackageIndex.  Now that packages have a unique
      identifier within a package database, it makes sense to use this as
      the key for looking up installed packages, so InstalledPackageIndex is
      a mapping from InstalledPackageId to InstalledPackageInfo.
      Distribution.Simple.PackageIndex still supports other kinds of package
      mappings: PackageIndex is a mapping from PackageName.
      All the functions in the section "Special Queries" now work on
      InstalledPackageIndex rather than PackageFixedDeps pkg => PackageIndex
  25. 02 Oct, 2008 1 commit
    • Duncan Coutts's avatar
      Relax dependencyInconsistencies to allow the base-3,4 thing · 991e52a4
      Duncan Coutts authored
      Previously we said a package graph was inconsistent if two
      dependencies on the same package name specified different
      versions. Now we say that two such dependencies on different
      versions are ok if there is a direct dependency between those
      two package versions. So if your package graph ends up with
      both base 3 and base 4 in it, then that's ok because base 3
      directly depends on base 4, so we declare it not to be an
      inconsistency. This removes the scary warnings at configure
      time (fixing ticket #366) and also adjusts the invariant and
      assertion of the InstallPlan ADT in cabal-install.
  26. 04 Sep, 2008 1 commit
  27. 30 Aug, 2008 1 commit
    • Duncan Coutts's avatar
      Merge PackageSet and PackageIndex · eea57172
      Duncan Coutts authored
      Have just a single module that provides both the case sensitive and
      insensitive operations. Turns out we hardly use the case insensitive
      operations, and the places where we do are not performance sensitive
      at all. So we use the PackageSet implementation which stores the
      packages case sensitively and tack on the case insensitive operations
      but with linear time implementations rather than log time. For the
      merged module/type name use PackageIndex because that is what older
      released versions exported, so less needless client breakage.
  28. 20 Jul, 2008 1 commit
    • Duncan Coutts's avatar
      Convert from PackageIndex to PackageSet · c6f2d793
      Duncan Coutts authored
      Turns out the feature to do case-insensitive lookups was only
      needed in cabal-install (and only in one little part) and
      elsewhere it causes problems. So use PackageSet instead.
  29. 28 Jun, 2008 1 commit
    • Duncan Coutts's avatar
      Update module headers · 0c993c84
      Duncan Coutts authored
      Use as the maintainer in most cases except for
      a few which were pre-existing modules copied from elsewhere or modules
      like L.H.Extension which really belong to
      Remove the useless stability module. We have more detailed information
      on stability elsewhere (in the version number and user guide).
      Add more top level module documentation, taken from the source guide.
  30. 14 Jun, 2008 1 commit
  31. 12 Jun, 2008 1 commit
  32. 29 May, 2008 1 commit
  33. 14 May, 2008 3 commits