This project is mirrored from https://github.com/haskell/Cabal. Pull mirroring updated .
  1. 22 Nov, 2017 1 commit
    • Ben Gamari's avatar
      Split sections support for GHC · 450d6bc4
      Ben Gamari authored
      Add --enable-split-sections flag and pipe it through to the GHC backend. Note
      that some of the implementation here could be made a bit more precise:
      -split-sections and -split-objs are mutually exlusive yet the types don't
      currently reflect this.
      
      Fixes #4819.
      450d6bc4
  2. 27 Oct, 2017 1 commit
    • Herbert Valerio Riedel's avatar
      Make `FlagAssignment` an opaque `newtype` · 6cb6a516
      Herbert Valerio Riedel authored
      This is a refactoring abstracting `FlagAssignment` while retaining its
      external appearance as much as possible (i.e. same Read/Show/Binary
      instances etc).
      
      Later we can attach new instances, enforce internal invariants (like
      e.g. uniqueness of flagnames), switch out the internal
      representation (maybe to `Data.Map`), etc more easily.
      6cb6a516
  3. 22 Jul, 2017 2 commits
  4. 21 Jul, 2017 1 commit
  5. 20 Jul, 2017 1 commit
  6. 05 Jul, 2017 1 commit
  7. 18 May, 2017 1 commit
    • Herbert Valerio Riedel's avatar
      Remove --allow-{newer,older} support from Cabal · a95b8f4e
      Herbert Valerio Riedel authored
      This is a preparatory refactoring needed for future work such as #4203.
      
      I've refrained from doing additional cleanups in order to keep this a
      refactoring that mostly moves around blocks of code mostly
      unchanged (except for whitespace), and make it easier to review.
      
      This feature was originally implemented because its lack was complained
      about by Stack/Stackage developers. However, after it got implemented it
      was never really being used; what's more, it's causing us overhead for
      no benefit as well as blocking us improving the implementation via the
      likes of #4203.
      
      Closes #3581
      a95b8f4e
  8. 05 May, 2017 1 commit
  9. 28 Apr, 2017 1 commit
  10. 27 Apr, 2017 1 commit
  11. 17 Mar, 2017 3 commits
    • Edward Z. Yang's avatar
      Refactor MungedPackageId and PackageIndex. · f4ded04f
      Edward Z. Yang authored
      
      
      This makes the necessary changes to 4dc0f30fc36914ee2f01bde016bee98b8e0bb0bb
      to handle component configuring correctly.  It probably is a good step
      towards pkg:lib style dependencies.
      
      The big ideas:
      
      * There's a new AnnotatedId type, which is any identifier (like
        ComponentId), but also with a PackageId and ComponentName.
        It's a bit like ConfiguredId, but ConfiguredId is specialized
        for ComponentId.  There's a conversion function
        annotatedIdToConfiguredId.
      
      * We adopt a totally new strategy for handling MungedPackageId in
        InstalledPackageInfo.  Rather than store the munged package
        identifier in IPI, we NEVER store it, instead computing it
        from the package name and library name (which are stored.)
        There is now code to PARSE a munged package name into these
        two components, so that when we read 'name' we get the
        correct info.  The resulting code is splendidly clear.
      
      * Some places where we took a ComponentName (notably
        computeCompatPackageName) we now take 'Maybe UnqualComponentName'.
        This is more accurate, because compatibility package names are
        only computed for libraries, not other components.  Some code
        in Distribution.Backpack.ReadyComponent is partial now,
        but the invariants should hold up.
      
      * A number of places where MungedId was applied, I undid them.
        Most notable are macro generation (that should be PACKAGES,
        not components) and mkLegacyUnitId (since REALLY old style
        unit identifiers, we won't support internal libraries anyway.)
      
      * Many functions in PackageIndex are monomorphized to
        InstalledPackageInfo.  Fortunately cabal-install's usage
        still works.
      
      * Distribution/Client/SolverPlanIndex.hs, not used by anyone,
        got the axe.
      
      * Dependency solving has a hack to solve the problem of how to
        interpret installed internal libraries in the package database.
        The basic idea is that, although in most cases where we used
        a MungedId, we say it explicitly, in the SOLVER, we munge
        *installed package names* only, and keep the type PackageName.
        It's a hack, but the alternative is to write a lot more code.
        Note that is MORALLY PN is indeed a PackageName, since we really
        are solving for honest to goodness packages, not components!
        See Note [Index conversion with internal libraries] for more
        details.
      
      * ConfiguredId now records the ComponentName.  This is quite important,
        because we need to use it to figure out how we are going to phrase
        --dependency.  In fact, it is a miracle that this worked at all
        (and it only worked because of a very skeevy update to the PackageId
        in the creation of ConfiguredComponent).  Irritatingly, this must
        be a Maybe ComponentName, because a ConfiguredId MIGHT refer to
        a setup component. Very distressing.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      f4ded04f
    • Edward Z. Yang's avatar
      Revert "Revert "Merge pull request #4382 from Ericson2314/munge"" · b0e6c311
      Edward Z. Yang authored
      This reverts commit 4774fb6558974a721176f1fb48d8ce7d43119251.
      b0e6c311
    • Edward Z. Yang's avatar
      Revert "Merge pull request #4382 from Ericson2314/munge" · b1b9d3b1
      Edward Z. Yang authored
      This reverts commit 332d809c, reversing
      changes made to 0c72bc88.
      b1b9d3b1
  12. 09 Mar, 2017 1 commit
  13. 06 Mar, 2017 2 commits
  14. 19 Feb, 2017 3 commits
    • Edward Z. Yang's avatar
      New variant of die which takes verbosity. · 6a652a87
      Edward Z. Yang authored and Edward Z. Yang's avatar Edward Z. Yang committed
      
      
      This flips error handling around, so that 'die' now can format
      an error message with call stacks and markers before raising
      it to the top handler.  The top handler detects "verbatim"
      deaths and prints them without formatting.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      6a652a87
    • Edward Z. Yang's avatar
      The --deterministic flag tries to make Cabal deterministic. · f7b16cf0
      Edward Z. Yang authored and Edward Z. Yang's avatar Edward Z. Yang committed
      
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      f7b16cf0
    • Edward Z. Yang's avatar
      Refactor setupMessage use in Cabal library. · bc9d5ada
      Edward Z. Yang authored and Edward Z. Yang's avatar Edward Z. Yang committed
      
      
      I noticed that I was repeatedly writing the same code
      to print out more elaborate information when we do builds,
      so I refactored it all into one place.  In the process,
      I think that I have made the build output more generally
      useful.
      
      The key changes:
      
          - There is a new function setupMessage' which takes in
            more information than the conventional setupMessage
            does, and prints a more informative message: whereas
            setupMessage will only tell you about the package
            it is being run in, setupMessage' will also tell
            you about the component and instantiation.
      
          - I applied this function to applicable sites, in some
            cases moving around messages to be closer to the place
            where an actual operation takes place.  For example,
            the 'Building' message previously only was triggered
            at the beginning of the build process; now it is
            emitted immediately before we call out to GHC.  This
            is a lot more informative, and avoids people thinking
            that we are slow because of preprocessing (we're not.)
            Something similar happened for Haddock as well.
      
      Before:
      
      Preprocessing library 'spider' for reflex-backpack-0.5.0..
      [1 of 1] Compiling Reflex.Spider.Backpack ( src/Reflex/Spider/Backpack.hs, /srv/code/reflex-backpack/dist-newstyle/build/x86_64-linux/ghc-8.1.20170123/reflex-backpack-0.5.0/c/spider/build/spider/Reflex/Spider/Backpack.o )
      
      After:
      
      Preprocessing library 'host' for reflex-backpack-0.5.0..
      Building library 'host' instantiated with
        Reflex.Host.Sig = reflex-backpack-0.5.0-inplace-spider:Reflex.Spider.Backpack
        Reflex.Sig = reflex-backpack-0.5.0-inplace-spider:Reflex.Spider.Backpack
      for reflex-backpack-0.5.0..
      [1 of 8] Compiling Reflex.Host.Sig[sig] ( host/Reflex/Host/Sig.hsig, /srv/code/reflex-backpack/dist-newstyle/build/x86_64-linux/ghc-8.1.20170123/reflex-backpack-0.5.0/c/host/reflex-backpack-0.5.0-inplace-host+FDoWUmUc0MMBtBRwItgjj9/build/reflex-backpack-0.5.0-inplace-host+FDoWUmUc0MMBtBRwItgjj9/Reflex/Host/Sig.o ) [Reflex.Basics changed]
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      bc9d5ada
  15. 08 Feb, 2017 2 commits
    • Duncan Coutts's avatar
      Change Graph.fromList to fromDistinctList and fix conseqeunces · 1440ffd5
      Duncan Coutts authored and Edward Z. Yang's avatar Edward Z. Yang committed
      It's really an error to try and build a graph where you have duplicate
      node keys, so remove Graph.fromList and add Graph.fromDistinctList. This
      check is always on, not just an assertion, becuase we get it for free
      given the way Maps can be constructed.
      
      All uses of Graph.fromList are ok to convert to fromDistinctList.
      1440ffd5
    • Edward Z. Yang's avatar
      Make 'Configuring component' message prettier. · 8e792524
      Edward Z. Yang authored
      
      
      Now it looks like:
      
      Configuring component lib:str-bytestring-lazy from str-bytestring-0.1.0.0
      Instantiated with:
        Data.ByteString=bytestring-0.10.8.1:Data.ByteString
        Data.ByteString.Elem=bytestring-elem-0.1.0.0-inplace:Data.ByteString.Elem
        Data.ByteString.Lazy=bytestring-0.10.8.1:Data.ByteString.Lazy
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      8e792524
  16. 23 Jan, 2017 1 commit
  17. 06 Jan, 2017 1 commit
  18. 21 Dec, 2016 1 commit
  19. 13 Dec, 2016 1 commit
  20. 26 Nov, 2016 1 commit
    • tulcod's avatar
      Implement foreign library versioning · 8744e30b
      tulcod authored
      This adds support for building foreign libraries with a given ABI version on Linux. This is enables foreign libraries to specify ABI compatibility information. This is important since ABI compatibility differs from package release versions.
      
      Two new fields are added: lib-version-info and lib-version-linux. The former accept versions Libtool-style, the latter sets SONAME versions directly. In both cases, appropriate symlinks are installed.
      
      Libtool accepts ABI version data via the -version-info flag, which takes current[:revision[:age]] data. This is then parsed into a major.minor.build version number. We copy this approach so that library versioning may be generalised to other operating systems than Linux.
      8744e30b
  21. 17 Nov, 2016 1 commit
  22. 15 Nov, 2016 1 commit
  23. 14 Nov, 2016 1 commit
  24. 13 Nov, 2016 1 commit
  25. 05 Nov, 2016 1 commit
    • Edward Z. Yang's avatar
      Add fingerprint of Generic representation when serializing. · ebcae71d
      Edward Z. Yang authored and Edward Z. Yang's avatar Edward Z. Yang committed
      
      
      The idea is we can use Rep to get a full, structural representation
      of a type, and the fingerprint it using Typeable.  This gives
      us a very concise way of fingerprinting our Binary representation.
      
      This patch is not completely correct; the fingerprint needs
      to be overridable when someone writes a custom Binary instance.
      But this should be "good enough" in practice; we're not using
      these fingerprints to check anything security critical.
      
      TODO: Not sure if I have tagged all the call-sites which could
      profit from this.
      
      Fixes #4059.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      ebcae71d
  26. 01 Nov, 2016 1 commit
  27. 31 Oct, 2016 4 commits
  28. 29 Oct, 2016 1 commit
  29. 28 Oct, 2016 1 commit
    • Edsko de Vries's avatar
      Add support for foreign libraries. · 382143aa
      Edsko de Vries authored
      A stanza for a platform library looks something like
      
          platform-library test-package
            type:                native-shared
      
            if os(Windows)
              options: standalone
              mod-def-file: TestPackage.def
      
            other-modules:       MyPlatformLib.Hello
                                 MyPlatformLib.SomeBindings
            build-depends:       base >=4.7 && <4.9
            hs-source-dirs:      src
            c-sources:           csrc/MyPlatformLibWrapper.c
            default-language:    Haskell2010
      
      where native-shared means that we want to build a native shared library
      (.so on Linux, .dylib on OSX, .dll on Windows). The parser also
      recognizes native-static but this is not currently supported anywhere.
      The standalone option means that the we merge all library dependencies
      into the dynamic library (i.e., ghc options -shared -static), rather
      than make the created dynamic library just record its dependencies (ghc
      options -shared -dynamic); it is currently compulsory on Windows and
      unsupported anywhere else. The mod-def-file can be used to specify a
      module definition file, and is also Windows specific.
      
      There is a bit of refactoring in Build: gbuild is the old buildOrReplExe
      and now deals with both executables and platform libraries.
      382143aa
  30. 25 Oct, 2016 1 commit
    • Edward Z. Yang's avatar
      Drop version check when resolving package names. · af24cefe
      Edward Z. Yang authored
      
      
      In #4017, hvr reported that when he used --allow-older/--allow-newer,
      there was an assert failure in toConfiguredComponent.  Indeed
      the problem was that toConfiguredComponent was testing version
      ranges of build-depends to determine which package to select, but
      there was no satisfying one (since the build-depends field had
      not been updated.)
      
      After thinking about this for a bit, it seemed a bit bogus for
      us to be doing another version check at this late phase; we
      already picked dependencies earlier in the configuration process.
      So I decided to drop it.
      
      To drop it, however, I needed to remove support for a feature (discussed
      in #4020), which uses version ranges to disambiguate whether or not a
      dependency is on an external package or an internal package.  This
      feature doesn't seem to be very useful.  If someone asks, I'll
      check on Hackage to see if anyone is using it.
      
      Also added some useful extra debug info.
      
      Fixes #4020 and #4017
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      af24cefe