This project is mirrored from https://gitlab.haskell.org/ghc/ghc.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Last successful update .
  1. 30 Jan, 2017 5 commits
    • Matthew Pickering's avatar
      Add a flag to emit error messages as JSON · 91691117
      Matthew Pickering authored
      This patch adds the flag `-ddump-json` which dumps all the compiler
      output as a JSON array. This allows tooling to more easily parse GHC's
      output to display to users.
      
      The flag is currently experimental and will hopefully be refined for the
      next release.  In particular I have avoided any changes which involve
      significant refactoring and provided what is easy given the current
      infrastructure.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: DanielG, gracjan, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3010
      
      GHC Trac Issues: #13190
      91691117
    • Ryan Scott's avatar
      Check that a default type signature aligns with the non-default signature · 7363d538
      Ryan Scott authored
      Before, GHC was extremely permissive about the form a default type
      signature could take on in a class declaration. Notably, it would accept
      garbage like this:
      
        class Monad m => MonadSupply m where
          fresh :: m Integer
          default fresh :: MonadTrans t => t m Integer
          fresh = lift fresh
      
      And then give an extremely confusing error message when you actually
      tried to declare an empty instance of MonadSupply. We now do extra
      validity checking of default type signatures to ensure that they align
      with their non-default type signature counterparts. That is, a default
      type signature is allowed to differ from the non-default one only in its
      context - they must otherwise be alpha-equivalent.
      
      Fixes #12918.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, simonpj, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: mpickering, dfeuer, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2983
      
      GHC Trac Issues: #12918
      7363d538
    • Rufflewind's avatar
      Fix broken tests · 2ec1c834
      Rufflewind authored
      1. DoParamM requires the FlexibleContexts pragma now.
      
      2. topHandler02 and topHandler03 were broken as timeout.py failed to
         translate signals to exit codes.
      
      3. topHandler03 does not produce a consistent stderr, as it depends on
         what the user has /bin/sh set to.  dash writes "Terminated" whereas
         bash and zsh produce nothing in non-interactive mode.
      
      4. The remaining tests are broken due to changes in the error message
         formatting.
      
      Test Plan: validate
      
      Reviewers: thomie, dfeuer, austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: Phyx, dfeuer
      
      Differential Revision: https://phabricator.haskell.org/D2807
      2ec1c834
    • Erik de Castro Lopo's avatar
      Fix deprecation warnings from containers · d2cf5dea
      Erik de Castro Lopo authored
      The functions that were causing warnings were deprecated in containers
      0.5 and GHC is already using containers 0.5.9.1.
      
      Test Plan: validate
      
      Reviewers: rwbarton, bgamari, hsyl20, austin, dfeuer
      
      Reviewed By: dfeuer
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3036
      d2cf5dea
    • Ryan Scott's avatar
      Fix mismatched tick in GHC.Generics documentation · f60287c4
      Ryan Scott authored
      [ci skip]
      
      A Generic derivation example in the documentation of GHC.Generics put a tick
      (used for datatype promotion) in the wrong place.
      
      Fixes #13206.
      f60287c4
  2. 29 Jan, 2017 2 commits
    • Sergei Trofimovich's avatar
      UNREG: add a forward declaration for local literals · 4441f907
      Sergei Trofimovich authored
      
      
      When toplevel literals don't have a way to be exported
      from module GHC infers their labels as static.
      
      Example from GHC.Arr:
          static char rdVA_bytes[] = " out of range ";
      
      When this label is used in module internally
      we also need to provide it's forward declaration.
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      4441f907
    • Sergei Trofimovich's avatar
      UNREG: fix "_bytes" string literal forward declaration · 34a02055
      Sergei Trofimovich authored
      
      
      Typical UNREG build failure looks like that:
      
        ghc-unreg/includes/Stg.h:226:46: error:
           note: in definition of macro 'EI_'
           #define EI_(X)          extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
                                                        ^
            |
        226 | #define EI_(X)          extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
            |                                              ^
      
        /tmp/ghc10489_0/ghc_3.hc:1754:6: error:
           note: previous definition of 'ghczmprim_GHCziTypes_zdtcTyCon2_bytes' was here
           char ghczmprim_GHCziTypes_zdtcTyCon2_bytes[] = "TyCon";
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             |
        1754 | char ghczmprim_GHCziTypes_zdtcTyCon2_bytes[] = "TyCon";
             |      ^
      
      As we see here "_bytes" string literals are defined as 'char []'
      array, not 'StgWord []'.
      
      The change special-cases "_bytes" string literals to have
      correct declaration type.
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      34a02055
  3. 28 Jan, 2017 3 commits
    • Ryan Scott's avatar
      Convert pprTrace in isPredTy to a WARN · bc42e2b0
      Ryan Scott authored
      Summary:
      There was a `pprTrace` in `isPredTy` that could fire under certain
      scenarios, causing normal GHC users to see debugging output. This turns it into
      a less chatty `WARN`, and expounds on the comment below it to add the scenario
      in #13187 which triggered the `pprTrace`.
      
      Reviewers: goldfire, austin, bgamari
      
      Reviewed By: goldfire, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3033
      
      GHC Trac Issues: #13187
      bc42e2b0
    • Ömer Sinan Ağacan's avatar
      de78ee6f
    • Tamar Christina's avatar
      Add delete retry loop. [ci skip] · 1f366b8d
      Tamar Christina authored
      Summary:
      On Windows we have to retry the delete a couple of times.
      The reason for this is that a `FileDelete` command just marks a
      file for deletion. The file is really only removed when the last
      handle to the file is closed. Unfortunately there are a lot of
      system services that can have a file temporarily opened using a shared
      readonly lock, such as the built in AV and search indexer.
      
      We can't really guarantee that these are all off, so what we can do is
      whenever after a `rmtree` the folder still exists to try again and wait a bit.
      
      Based on what I've seen from the tests on CI server, is that this is relatively rare.
      So overall we won't be retrying a lot. If after a reasonable amount of time the folder is
      still locked then abort the current test by throwing an exception, this so it won't fail
      with an even more cryptic error.
      
      The issue is that these services often open a file using `FILE_SHARE_DELETE` permissions.
      So they can seemingly be removed, and for most intended purposes they are, but recreating
      the file with the same name will fail as the FS will prevent data loss.
      
      The MSDN docs for `DeleteFile` says:
      
      ```
      The DeleteFile function marks a file for deletion on close.
      Therefore, the file deletion does not occur until the last handle
      to the file is closed. Subsequent calls to CreateFile to open the
      file fail with ERROR_ACCESS_DENIED.
      ```
      
      Retrying seems to be a common pattern, SQLite has it in their driver
      http://www.sqlite.org/src/info/89f1848d7f
      
      The only way to avoid this is to run each way of a test in it's own folder.
      This would also have the added bonus of increased parallelism.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2936
      
      GHC Trac Issues: #12661, #13162
      1f366b8d
  4. 26 Jan, 2017 15 commits
    • Chris Martin's avatar
      Remove Data.Tuple doc's claim to have tuple types · 2af38b06
      Chris Martin authored
      "The tuple data types" seems like an inaccurate way to lead off the
      description of this module, which doesn't actually export the tuple data
      types. The latter part of the sentence, "associated functions",
      accurately describes the entire module.
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: dfeuer, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2924
      2af38b06
    • Daishi Nakajima's avatar
      Fix the right-shift operation for negative big integers (fixes #12136) · 06b9561a
      Daishi Nakajima authored
      In `x shiftR y`, any of the following conditions cause an abort:
      - `x` is a negative big integer
      - The size of `x` and `y` is a multiple of `GMP_NUMB_BITS`
      - The bit of the absolute value of `x` is filled with `1`
      
      For example:
      Assuming `GMP_NUMB_BITS = 2`,  the processing of `-15 shiftR 2` is as 
      follows:
      
      1. -15 = -1111 (twos complement: 10001)
      2. right shift 2 (as a positive number) -> 0011
      3. Due to the shift larger than GMP_NUMB_BITS, the size of the 
      destination is decreasing (2bit) -> 11
      4. Add 1, and get carry: (1) 00
      5. abort
      
      I fixed it that the destination size does not decrease in such a case.
      
      Test Plan: I tested the specific case being reported.
      
      Reviewers: goldfire, austin, hvr, bgamari, rwbarton
      
      Reviewed By: bgamari, rwbarton
      
      Subscribers: mpickering, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2998
      
      GHC Trac Issues: #12136
      06b9561a
    • Simon Marlow's avatar
      Fatal if we try to reinitialize the RTS · 2ffcdfad
      Simon Marlow authored
      This isn't supported, and fatalling with an error is better than
      segfaulting later.
      
      Test Plan: validate
      
      Reviewers: JonCoens, austin, erikd, niteria, bgamari
      
      Reviewed By: niteria, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3020
      2ffcdfad
    • Ben Gamari's avatar
      Bump hsc2hs submodule · 4e63e859
      Ben Gamari authored
      4e63e859
    • Ben Gamari's avatar
      Bump nofib submodule · d8cb4b0d
      Ben Gamari authored
      d8cb4b0d
    • Dave Laing's avatar
      Generalizes the type of asProxyTypeOf (#12805) · 3eebd1f5
      Dave Laing authored
      Test Plan: validate
      
      Reviewers: austin, hvr, bgamari, RyanGlScott, simonpj
      
      Reviewed By: RyanGlScott, simonpj
      
      Subscribers: simonpj, RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3017
      
      GHC Trac Issues: #12805
      3eebd1f5
    • Ryan Scott's avatar
      Don't unnecessarily qualify TH-converted instances with empty contexts · ad3d2dfa
      Ryan Scott authored
      Summary:
      The addition of rigorous pretty-printer tests
      (499e4382) had the unfortunate
      side-effect of revealing a bug in `hsSyn/Convert.hs` wherein instances are
      _always_ qualified with an instance context, even if the context is empty. This
      led to instances like this:
      
      ```
      instance Foo Int
      ```
      
      being pretty-printed like this!
      
      ```
      instance () => Foo Int
      ```
      
      We can prevent this by checking if the context is empty before adding an
      HsQualTy to the type.
      
      Also does some refactoring around HsForAllTys in `Convert` while I was in town.
      
      Fixes #13183.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, bgamari, austin, alanz
      
      Reviewed By: alanz
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3018
      
      GHC Trac Issues: #13183
      ad3d2dfa
    • Gabor Greif's avatar
      Prune unneeded Derive* language pragmas · 50544eea
      Gabor Greif authored
      50544eea
    • Alan Zimmerman's avatar
      Make type import/export API Annotation friendly · 0d1cb157
      Alan Zimmerman authored
      Summary:
      At the moment an export of the form
      
         type C(..)
      
      is parsed by the rule
      
      ```
        |  'type' oqtycon           {% amms (mkTypeImpExp (sLL $1 $> (unLoc $2)))
                                           [mj AnnType $1,mj AnnVal $2] }
      ```
      
      This means that the origiinal oqtycon loses its location which is then retained
      in the AnnVal annotation.
      
      The problem is if the oqtycon has its own annotations, these get lost.
      
      e.g. in
      
        type (?)(..)
      
      the parens annotations for (?) get lost.
      
      This patch adds a wrapper around the name in the IE type to
      
      (a) provide a distinct location for the adornment annotation and
      
      (b) identify the specific adornment, for use in the pretty printer rather than
      occName magic.
      
      Updates haddock submodule
      
      Test Plan: ./validate
      
      Reviewers: mpickering, dfeuer, bgamari, austin
      
      Reviewed By: dfeuer
      
      Subscribers: dfeuer, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D3016
      
      GHC Trac Issues: #13163
      0d1cb157
    • Gabor Greif's avatar
      Typos in comments [ci skip] · ff9355e4
      Gabor Greif authored
      ff9355e4
    • Ryan Scott's avatar
      Nix typo and redundant where-clauses · 88a89b76
      Ryan Scott authored
      88a89b76
    • Ryan Scott's avatar
      Add pragCompleteDName to templateHaskellNames · e4ab8ba7
      Ryan Scott authored
      95dc6dc0 forgot to add `pragCompleteDName`
      to the list of `templateHaskellNames`, which caused a panic if you actually
      tried to splice a `COMPLETE` pragma using Template Haskell. This applies the
      easy fix and augments the regression test to check for this in the future.
      e4ab8ba7
    • David Feuer's avatar
      Generalize the type of runRW# · c344005b
      David Feuer authored
      * Generalize the type of `runRW#` to allow arbitrary return types.
      
      * Use `runRW#` to implement `Control.Monad.ST.Lazy.runST` (this
      provides evidence that it actually works properly with the generalized
      type).
      
      * Adjust the type signature in the definition of `oneShot` to match
      the one it is given in `MkId`.
      
      Reviewers: simonmar, austin, bgamari, hvr
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3012
      
      GHC Trac Issues: #13178
      c344005b
    • Matthew Pickering's avatar
      Template Haskell support for COMPLETE pragmas · 95dc6dc0
      Matthew Pickering authored
      Reviewers: RyanGlScott, austin, goldfire, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2997
      
      GHC Trac Issues: #13098
      95dc6dc0
    • Matthew Pickering's avatar
      COMPLETE pragmas for enhanced pattern exhaustiveness checking · 1a3f1eeb
      Matthew Pickering authored
      This patch adds a new pragma so that users can specify `COMPLETE` sets of
      `ConLike`s in order to sate the pattern match checker.
      
      A function which matches on all the patterns in a complete grouping
      will not cause the exhaustiveness checker to emit warnings.
      
      ```
      pattern P :: ()
      pattern P = ()
      
      {-# COMPLETE P #-}
      
      foo P = ()
      ```
      
      This example would previously have caused the checker to warn that
      all cases were not matched even though matching on `P` is sufficient to
      make `foo` covering. With the addition of the pragma, the compiler
      will recognise that matching on `P` alone is enough and not emit
      any warnings.
      
      Reviewers: goldfire, gkaracha, alanz, austin, bgamari
      
      Reviewed By: alanz
      
      Subscribers: lelf, nomeata, gkaracha, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2669
      
      GHC Trac Issues: #8779
      1a3f1eeb
  5. 25 Jan, 2017 4 commits
  6. 24 Jan, 2017 11 commits