This project is mirrored from https://github.com/haskell/Cabal. Pull mirroring updated .
  1. 29 Mar, 2016 4 commits
    • Edward Z. Yang's avatar
    • Edward Z. Yang's avatar
    • Edward Z. Yang's avatar
      Per-component cabal_macros.h (#1893) and install paths · 90e908b8
      Edward Z. Yang authored
      
      
      This commit is a number of refactorings that I needed to do
      while fixing bugs with internal libraries support.
      
      - With internal libraries, it becomes especially clear that
        cabal_macros.h and Paths_foo.hs need to be done per-component.
        It is done!
      
        This change breaks BC in an important way: the preprocessor
        interface now takes a ComponentLocalBuildInfo along with the
        BuildInfo and LocalBuildInfo.  This means that if you implemented
        a custom preprocessor, or called 'preprocessComponent' in a custom
        Setup, you will have to make sure you pass the right
        ComponentLocalBuildInfo.  Some sub-notes:
      
          - While I was mucking about cabal_macros.h, I updated it to have
            two new macros: CURRENT_COMPONENT_ID (an alias for
            CURRENT_PACKAGE_KEY, but using modern terminology) and
            LOCAL_COMPONENT_ID (which refers to the public library; we use
            this in Cabal's test suite but it's unclear what the general
            utility of this is.  See the TODO.)
      
          - checkForeignDeps has a hack where we hardcode the
            cabal_macros.h of the main library.  If we did the foreign dep
            check for every component individually that would be better,
            but I didn't want to roll it into this patch.
      
      - The other piece I needed for internal libraries was per-component
        install directories; otherwise, internal libraries clobber each
        other.  absoluteInstallDirs now takes a ComponentId, which is used
        to determine what '$libname' expands to.  Generally, InstallPaths
        must be computed per component, c.f. #2836.  We're not TRULY
        per-component install paths, since some files are installed for
        the "per-package" InstallPaths (the one we computed for the
        library as a whole), but for libraries we have to compute
        InstallPaths for each one.
      
          - While doing this, ComponentLocalBuildInfo grew a new
            'componentId' field for non-library things.  This lets us
            treat InstallPaths expansion uniformly.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      90e908b8
    • Edward Z. Yang's avatar
      Implement "convenience libraries", fixes #269. · 2040c1c9
      Edward Z. Yang authored
      
      
      Convenience libraries are package-private libraries
      that can be used as part of executables, libraries, etc
      without being exposed to the external world.  Private
      libraries are signified using the
      
          library foo
      
      stanza.  Within a Cabal package, the name convenience library
      shadows the conventional meaning of package name in
      build-depends, so that references to "foo" do not indicate
      foo in Hackage, but the convenience library defined in the
      same package. (So, don't shadow Hackage packages!)
      
      This commit implements convenience libraries such that they
      ARE installed the package database (this prevents us from
      having to special case dynamically linked executables);
      in GHC 7.10 and later they are installed under the same
      package name as the package that contained them, but have
      a distinct "component ID" (one pay off of making the distinction
      between component IDs and installed package IDs.)
      
      There is a "default" library which is identified by the fact
      that its library name coincides with the package name.  There
      are some new convenience functions to permit referencing this.
      
      There are a few latent bugs in this commit which are fixed
      in later commits in this patchset.  (Those bugfixes required
      a bit of refactoring, so it's clearer if they're not
      with this patch.)
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      2040c1c9
  2. 30 Jan, 2016 1 commit
  3. 25 Jan, 2016 1 commit
  4. 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
            afterwards.
      
      This patch replaces InstalledPackageId and PackageKey with a
      new identifier called ComponentId, which has the following
      properties:
      
          - 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
            'HasComponentId'.
      
          - 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 <ezyang@cs.stanford.edu>
      b083151f
  5. 04 Jul, 2015 1 commit
    • kristenk's avatar
      Support pure test packages (issue #1186) · f2f4ad4b
      kristenk authored
      This commit relaxes D.PackageDescription.Check.checkConfiguredPackage so that it
      only warns when a package declares no executables, libraries, tests, or
      benchmarks.  Similarly, it relaxes the check during build to only require one
      component that is buildable and enabled.  Install now requires an executable or
      library.
      f2f4ad4b
  6. 18 Dec, 2014 1 commit
  7. 19 Oct, 2014 1 commit
  8. 02 Feb, 2014 1 commit
  9. 08 Jan, 2014 1 commit
    • Duncan Coutts's avatar
      New license-files field. · a7b58b1f
      Duncan Coutts authored
      Based closely on the patches by Mathieu Boespflug <mboes@cs.mcgill.ca>
      
      This field is intended to be used instead of (or in addition to) the
      normal 'license-file' field by packages that have multiple files for
      their license material. This is useful when eg the license is
      supplemented by additional permissions and/or conditions. Notably,
      the LGPL is structured in this way: it amends the GPL with additional
      permissions, therefore one should distribute both the GPL in COPYING
      and the LGPL in COPYING.LESSER.
      
      So we keep both the license-file and license-files fields (rather than
      deprecating one) and packages can use either or a mixture.
      a7b58b1f
  10. 03 Oct, 2013 1 commit
  11. 12 Mar, 2013 1 commit
  12. 31 Oct, 2012 1 commit
  13. 23 Oct, 2011 1 commit
  14. 19 Jun, 2011 1 commit
  15. 18 Oct, 2010 1 commit
  16. 20 Apr, 2010 3 commits
  17. 30 Mar, 2010 1 commit
  18. 05 Jul, 2009 1 commit
  19. 28 May, 2009 1 commit
  20. 19 May, 2009 1 commit
  21. 27 May, 2009 3 commits
  22. 15 May, 2009 1 commit
  23. 29 Jan, 2009 2 commits
  24. 22 Jan, 2009 2 commits
  25. 21 Nov, 2008 1 commit
  26. 13 Aug, 2008 1 commit
  27. 12 Jul, 2008 1 commit
    • Ian Lynagh's avatar
      Fix installing datafiles · 8c817afc
      Ian Lynagh authored
      If datadir is foo and the datafile is bar then we should install it to
      $datadir/bar, not $datadir/foo/bar.
      8c817afc
  28. 29 Jun, 2008 1 commit
  29. 28 Jun, 2008 1 commit
    • Duncan Coutts's avatar
      Update module headers · 0c993c84
      Duncan Coutts authored
      Use cabal-devel@haskell.org 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 libraries@haskell.org
      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.
      0c993c84
  30. 26 Jun, 2008 2 commits