This project is mirrored from https://github.com/haskell/Cabal. Pull mirroring updated .
  1. 03 Jan, 2016 1 commit
  2. 29 Dec, 2015 1 commit
  3. 28 Dec, 2015 1 commit
    • Edward Z. Yang's avatar
      Rewrite the package test suite. · e94552e8
      Edward Z. Yang authored
      
      
      I've rewritten the test suite to be more concise and "correct by
      construction".  The primary method that this is achieved by
      is introducing the 'TestM' monad, which carries around the
      important state for the tests so that (1) we don't have to
      pass it as an argument all around, and (2) we can automatically
      make the correct decisions about how to do things.  This new
      method emphasises "configuration by convention": we assume
      that a test-case named "Foo" has its test packages in the
      directory "tests/PackageTests/Foo".
      
      A secondary change is that all command functions automatically fail if
      they have a non-zero exit code (unless you use the 'shouldFail'
      combinator which inverts the sense.)  This saves a lot of typing
      on test-cases.  (In fact, I've reorganized all of the commands
      related here.)
      
      In the process, I've tightened up the logic for how to find the
      LocalBuildInfo of the Cabal we've testing, so we should now
      reliably be testing the inplace Cabal library, and not the
      system library (as was often the case.)
      
      Because things are a lot shorter, there is no good reason to
      make Check modules except for the biggest test cases.  Most
      test-cases have been folded into PackageTests.Tests; if you
      have a small test-case you should just put it there.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      e94552e8
  4. 05 Nov, 2015 1 commit
  5. 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
  6. 26 Sep, 2015 1 commit
    • enolan's avatar
      Carry package dbs into testsuite · bc3e1a7d
      enolan authored
      Prior to this patch, the testsuite used your global package db, and
      sometimes, the inplace package db, which led to errors if you didn't
      have old-time installed globally. They looked like this:
      
      BuildDeps/SameDepsAllRound:          Cabal result was Result {successful = False, success = Failure, outputText = "\"/home/enolan/cabal/Cabal/tests/Setup configure --user -w  /home/enolan/.nix-profile/bin/ghc\" in PackageTests/BuildDeps/SameDepsAllRound\nConfiguring SameDepsAllRound-0.1...\nSetup: At least the following dependencies are missing:\nold-time -any\n"}
      bc3e1a7d
  7. 08 Aug, 2015 4 commits
  8. 29 Jun, 2015 1 commit
  9. 29 Mar, 2015 1 commit
    • Ian Ross's avatar
      Allow preprocessors to specify extra C sources · a30b11fe
      Ian Ross authored
      Add functionality to allow preprocessors like hsc2hs and C2HS to inform
      Cabal of extra C sources that they create that need to be compiled and
      linked.  Includes hsc2hs-based test case.
      a30b11fe
  10. 20 Mar, 2015 1 commit
  11. 18 Dec, 2014 2 commits
    • ttuegel's avatar
      PackageTests: set dist prefix · 61f97e07
      ttuegel authored
      Some package tests run multiple tests on the same package, causing the
      build directory to be overwritten. For debugging, it is important to
      keep the build directory contents, so in this case we run each test
      with a different build directory.
      61f97e07
    • ttuegel's avatar
      PackageTests: add full range of TestSuite/Hpc tests · 6af70b39
      ttuegel authored
      Also runs the HPC tests regardless of the detected version.
      6af70b39
  12. 09 Dec, 2014 1 commit
    • ttuegel's avatar
      getConfigStateFile: throw meaningful exceptions, recover old LBI · 78776496
      ttuegel authored
      getConfigStateFile now throws meaningful exceptions which are caught by
      tryGetConfigStateFile and friends, which are allowed to propagate,
      rather than just calling 'die'. If the LocalBuildInfo was generated by
      an older version of Cabal, an exception is still generated, but the
      LocalBuildInfo is included if it is recoverable. This feature is used to
      reduce code duplication between the library and the test suite.
      78776496
  13. 14 Sep, 2014 1 commit
  14. 30 Aug, 2014 1 commit
    • ttuegel's avatar
      Load binary LocalBuildInfo in package-tests · a86ad66c
      ttuegel authored
      PackageTests has its own version of getPersistBuildConfig which does not
      check which version of Cabal created dist/setup-config. Now that the
      LocalBuildInfo is written with Binary, this version needed to be
      updated, too.
      a86ad66c
  15. 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 <ezyang@cs.stanford.edu>
      62450f9a
  16. 11 Jul, 2014 1 commit
  17. 10 May, 2014 1 commit
  18. 19 Mar, 2014 1 commit
  19. 12 Feb, 2014 2 commits
  20. 09 Feb, 2014 1 commit
  21. 05 Feb, 2014 1 commit
  22. 20 Dec, 2013 1 commit
  23. 06 Nov, 2013 1 commit
  24. 27 Aug, 2013 1 commit
    • tibbe's avatar
      Unit tests: use configure GHC · 323460ec
      tibbe authored
      This means that the package tests will pick up whatever GHC was passed
      on the
      
          cabal configure --enable-tests -w some-ghc
      
      command line.
      323460ec
  25. 11 Jul, 2013 1 commit
  26. 07 May, 2013 1 commit
  27. 28 Apr, 2013 2 commits
  28. 21 Mar, 2013 2 commits
  29. 10 Dec, 2012 1 commit
    • Duncan Coutts's avatar
      Support for C/C++/Obj-C as main · de88f409
      Duncan Coutts authored
      This allows specifying the main-is field as a C file.
      
      This is closely based on patches by Edward Z. Yang, who in turn credits
      and earlier set of patches by Irene Knapp. The slight difference in
      this version of the patch is that it is adjusted to work with the new
      approach where we have separate hs compile; c compile; and link phases.
      de88f409
  30. 30 Oct, 2012 2 commits
  31. 26 Oct, 2012 2 commits