This project is mirrored from https://github.com/haskell/Cabal. Pull mirroring updated .
  1. 08 Oct, 2016 2 commits
  2. 06 Oct, 2016 26 commits
  3. 02 Oct, 2016 2 commits
  4. 30 Sep, 2016 1 commit
  5. 29 Sep, 2016 2 commits
    • Herbert Valerio Riedel's avatar
      Move ShortText to Distribution.Utils.ShortText to avoid cycles · e204a346
      Herbert Valerio Riedel authored
      This moves `String`/UTF8 conversion helpers to Distribution.Utils.String
      e204a346
    • Duncan Coutts's avatar
      Adjust behaviour of reportBuildFailures · 4d308c04
      Duncan Coutts authored
      Make sure it consistently uses stderr, rather than a mixture of stdout
      and stderr. Also rename it to dieOnBuildFailure to make it clear that
      it is fatal in the case of build failures.
      
      In general we report build failures in two steps: header plus build log
      for each failing package, then a final die exception with summary.
      Previously the build log step was reported to stdout whereas the die
      exception message gets reported to stderr. So we switch that to use
      new dieMsg and dieMsgNoWrap utils so that it all goes to stderr. Also,
      like die, these are reported irrespective of the verbosity.
      
      This is more or less just a workaround for the fact that we do not yet
      have a nice structured/formatted error mechanism that would allow us to
      throw just the one error in this case.
      4d308c04
  6. 28 Sep, 2016 2 commits
    • Herbert Valerio Riedel's avatar
      Add `Distribution.Simple.Utils.ShortText` type (#3898) · 993d20a2
      Herbert Valerio Riedel authored
      This implements a type with a compact representation of `[Char]`.
      
      The data is stored internally as UTF8 in an 'Data.ByteString.Short.ShortByteString'
      when compiled against `bytestring >= 0.10.4`, and otherwise in a
      plain old `[Char]`.
      
      `ShortByteString` is available only from `bytestring` 0.10.4 on, and GHC
      7.8.4 was the first GHC to bundle `binary-0.10.4`. So this fallback
      affects mostly only GHC 7.6 and older.
      
      Note: Originally a strict `ByteString` was used as fallback for this patch. However, the 
      `[Char]` fallback avoids pinned memory and may be more preferable when dealing with
      many small `ShortText`s
      993d20a2
    • Herbert Valerio Riedel's avatar
      Make `Version` type opaque (#3905) · bb2026c4
      Herbert Valerio Riedel authored
      Similiar to dabd9d98 which made
      `PackageName` opaque, this makes `Distribution.Version.Version` opaque.
      
      The most common version numbers occuring on Hackage are 3- and
      4-part versions. This results in significant Heap overhead due to
      `Data.Version`'s inefficient internal representation.
      
      So like the `PackageName` commit, this commit is a preparatory commit to
      pave the way for replacing `Version`'s internal representation by a
      representation with a memory footprint which can be an order of
      magnitude smaller.
      
      Finally, this also adds a new functor-like convenience function
      
          alterVersion :: ([Int] -> [Int]) -> Version -> Version
      
      for modifying the version number components.
      bb2026c4
  7. 27 Sep, 2016 1 commit
    • Herbert Valerio Riedel's avatar
      Make `PackageName` type opaque (#3896) · dabd9d98
      Herbert Valerio Riedel authored
      When looking at heap-profiles of `cabal-install`, the `(:)` constructor
      stands out as the most-allocated constructor on the heap.
      
      Having to handle 10k+ package names contributes to the allocation
      numbers, especially on 64bit archs where ASCII `String`s have a 24 byte
      per character footprint.
      
      This commit is a preparatory commit to pave the way for changing
      `PackageName`'s internal representation to something like
      `ShortByteString` (which is essentially a thin wrapper around primitive
      `ByteArray#`s which themselves have have an overhead of 2 words + one
      byte per ASCII character rounded up to nearest word) which would allow
      to reduce the memory footprint by a full order of magnitude, as well as
      reduce pointer chasing and GC overhead.
      dabd9d98
  8. 22 Sep, 2016 1 commit
    • Herbert Valerio Riedel's avatar
      Update default-language & avoid default-extensions (#3880) · f87738df
      Herbert Valerio Riedel authored
      This upgrades the `default-language: Haskell98` to `Haskell2010`
      and removes `default-extensions: RankNTypes, FlexibleContexts`
      in favor of adding `LANGUAGE` pragmas where needed.
      
      Moroever, this also drops `LANGUAGE` pragmas which have become redundant
      due to `Haskell2010` (specifically, `EmptyDataDecls`,
      `ForeignFunctionInterface` and `PatternGuards`)
      
      Finally, an `other-extensions` specification is put in place for the
      `Cabal` library component.
      
      This helps loading up files directly in GHCi, such as e.g. `ghci Setup.hs`
      without having to specify `-X...` flags.
      f87738df
  9. 19 Sep, 2016 2 commits
    • Edward Z. Yang's avatar
      Never use --enable-profiling when invoking Setup. · bf3d3e68
      Edward Z. Yang authored
      
      
      In Cabal 1.22.5.0, the semantics of
      --disable-profiling/--enable-profiling depend on ordering (because there
      is a hack that operates by looking at the current flag assignment and
      doing something). In particular, if I specify --enable-library-profiling
      --disable-profiling, I end up with library profiling DISABLED.
      
      The fix is that we NEVER pass --enable-profiling or --disable-profiling
      to Cabal. At the moment, and according to my historical analysis, Cabal
      ONLY uses configProf to affect the effective library/executable
      profiling, which means that anything we do with --enable-profiling, we
      can do using the library/executable profiling individually. Since these
      are always flags for the versions of Cabal library we support, we will
      get order invariance. Historical versions have varied on whether or not
      setting executable profiling implies library profiling, but if we set
      both explicitly this change in behavior doesn't matter.
      
      This patch is difficult to test because the bad profiling flags
      can't be induced on an inplace build.  I tested by hand by building
      a package that depended on 'distributive' by hand.
      
      Fixes #3790.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      bf3d3e68
    • Edward Z. Yang's avatar
  10. 18 Sep, 2016 1 commit
    • Edward Z. Yang's avatar
      Use enabledBuildInfos rather than allBuildInfo. · b17a45e9
      Edward Z. Yang authored
      
      
      In many places, we incorrectly used allBuildInfo, which
      returns all BuildInfos that are buildable, and not
      necessarily the ones we are actually going to *build*.
      This used to "mostly do the right thing" because we
      literally edited the PackageDescription to nub out things,
      so you wouldn't see non-enabled components anyway.  However
      when I added support for per-component configure, I stopped
      editing the PackageDescription, which meant all of these
      uses were wrong.
      
      So, I updated them to do the right thing. Note that there
      are still uses of allBuildInfo in Check, but that probably
      requires a closer look.
      
      Fixes #3847.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      b17a45e9