1. 14 May, 2018 14 commits
    • Sergei Trofimovich's avatar
      rts: export new absentSumFieldError from base · 79bbb23f
      Sergei Trofimovich authored
      commit b2ff5dde
       "Fix #15038"
      added new stable closure 'absentSumFieldError_closure' to
      base package. This closure is used in rts package.
      Unfortunately the symbol was not explicitly exported and build
      failed on windows as:
      "inplace/bin/ghc-stage1" -o ...hsc2hs.exe ...
      rts/dist/build/libHSrts.a(RtsStartup.o): In function `hs_init_ghc':
      rts/RtsStartup.c:272:0: error:
           undefined reference to `base_ControlziExceptionziBase_absentSumFieldError_closure'
      272 |     getStablePtr((StgPtr)absentSumFieldError_closure);
          | ^
      This change adds 'absentSumFieldError_closure' to explicit export
      into libHSbase.def.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
    • Tobias Dammers's avatar
      Fix performance regressions from #14737 · d92c7556
      Tobias Dammers authored
      See #15019. When removing an unnecessary type equality check in #14737,
      several regression tests failed. The cause was that some coercions that
      are actually Refl coercions weren't passed in as such, which made the
      equality check needlessly complex (Refl coercions can be discarded in
      this particular check immediately, without inspecting the types at all).
      We fix that, and get additional performance improvements for free.
      Reviewers: goldfire, bgamari, simonpj
      Reviewed By: bgamari, simonpj
      Subscribers: simonpj, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4635
    • Ben Gamari's avatar
      Revert "rts: Compile with gcc -Og" · 1e272094
      Ben Gamari authored
      This reverts commit d4abd031.
    • Nolan's avatar
      Fix #14973 · e408d03b
      Nolan authored
      Reviewers: bgamari
      Reviewed By: bgamari
      Subscribers: thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4661
    • Sergei Trofimovich's avatar
      utils/fs: use <sys/stat.h>, not <sys\stat.h> · 6d57a92f
      Sergei Trofimovich authored
      Fix cross-compilation failure from linux to windows:
        CC utils/unlit/dist-install/build/fs.o
      utils/unlit/fs.c:24:10: fatal error: sys\stat.h: No such file or directory
       #include <sys\stat.h>
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
    • David Feuer's avatar
      Improve some Foldable methods for NonEmpty · b7139869
      David Feuer authored
      * `length` is improved by using the default definition,
        while `foldr1` is improved by using a custom one.
      * Several methods had useless lazy pattern matches
        (i.e., the functions were actually strict in those arguments).
        Remove `~`s to clarify.
      Reviewers: hvr, bgamari, mpickering, nomeata
      Reviewed By: bgamari
      Subscribers: ygale, rwbarton, thomie, carter
      GHC Trac Issues: #15131
      Differential Revision: https://phabricator.haskell.org/D4677
    • Alp Mestanogullari's avatar
      Fix another batch of `./validate --slow` failures · ca3d3039
      Alp Mestanogullari authored
      A rather detailed summary can be found at:
      This doesn't fix all expectation mismatches yet, but we're down to about
      20 mismatches with my previous patch and this one, as opposed to ~150
      when I got started.
      Test Plan: ./validate --slow
      Reviewers: bgamari, erikd, simonmar
      Reviewed By: simonmar
      Subscribers: thomie, carter
      GHC Trac Issues: #14890
      Differential Revision: https://phabricator.haskell.org/D4636
    • Herbert Valerio Riedel's avatar
      Add support for opting out of package environments · 8f3c149d
      Herbert Valerio Riedel authored
      This implements the first part proposed in #13753:
      Define a special magic "null" environment, which instructs GHC to ignore
      any package environment files. To this end, I propose to use the name
      `-` (i.e. a single dash), as that is more portable than using the empty
      string for environment variables. In other words, a
      - `-package-env -` CLI flag, or a
      - `GHC_ENVIRONMENT=-` env var (unless a `-package-env` flag is present)
      would inhibit GHC from looking up and interpreting any package
      environment files from the filesystem; this is the equivalent of
      `-ignore-dot-ghci` for package environment files.
      Reviewers: bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #13753
      Differential Revision: https://phabricator.haskell.org/D4690
    • Ben Gamari's avatar
      ghc-pkg: Configure handle encodings · cf88c2b1
      Ben Gamari authored
      This fixes #15021 using a the same approach as was used to fix the issue
      in ghc (#10762).
      Test Plan: Validate on Windows as user whose username contains
      non-ASCII characters
      Reviewers: simonmar
      Reviewed By: simonmar
      Subscribers: lehins, thomie, carter
      GHC Trac Issues: #15021
      Differential Revision: https://phabricator.haskell.org/D4642
    • Ryan Scott's avatar
      Fix #14875 by introducing PprPrec, and using it · 21e1a00c
      Ryan Scott authored
      Trying to determine when to insert parentheses during TH
      conversion is a bit of a mess. There is an assortment of functions
      that try to detect this, such as:
      * `hsExprNeedsParens`
      * `isCompoundHsType`
      * `hsPatNeedsParens`
      * `isCompoundPat`
      * etc.
      To make things worse, each of them have slightly different semantics.
      Plus, they don't work well in the presence of explicit type
      signatures, as #14875 demonstrates.
      All of these problems can be alleviated with the use of an explicit
      precedence argument (much like what `showsPrec` currently does). To
      accomplish this, I introduce a new `PprPrec` data type, and define
      standard predences for things like function application, infix
      operators, function arrows, and explicit type signatures (that last
      one is new). I then added `PprPrec` arguments to the various
      `-NeedsParens` functions, and use them to make smarter decisions
      about when things need to be parenthesized.
      A nice side effect is that functions like `isCompoundHsType` are
      now completely unneeded, since they're simply aliases for
      `hsTypeNeedsParens appPrec`. As a result, I did a bit of refactoring
      to remove these sorts of functions. I also did a pass over various
      utility functions in GHC for constructing AST forms and used more
      appropriate precedences where convenient.
      Along the way, I also ripped out the existing `TyPrec`
      data type (which was tailor-made for pretty-printing `Type`s) and
      replaced it with `PprPrec` for consistency.
      Test Plan: make test TEST=T14875
      Reviewers: alanz, goldfire, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #14875
      Differential Revision: https://phabricator.haskell.org/D4688
    • Matthew Pickering's avatar
      Add note documenting refineDefaultAlt · bf6cad8b
      Matthew Pickering authored
      Reviewers: sjakobi, bgamari
      Reviewed By: sjakobi
      Subscribers: rwbarton, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4687
    • David Feuer's avatar
      Clarify what the FFI spec says · 48dee7c9
      David Feuer authored
      Section 10.1.1 claimed that
      > The FFI addendum stipulates that an implementation is free to
      implement an unsafe call by performing a safe call ...
      Reading through the FFI addendum (and the Haskell 2010 Report, which
      integrates it), I see no such stipulation. I think this explains the
      situation a bit better.
      [ci skip]
      Reviewers: bgamari
      Reviewed By: bgamari
      Subscribers: thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4656
    • Chaitanya Koparkar's avatar
      GHCi: Include a note in the hint to expose a hidden package · 30c887d3
      Chaitanya Koparkar authored
      Test Plan: validate
      Reviewers: bgamari, RyanGlScott, osa1
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #15055
      Differential Revision: https://phabricator.haskell.org/D4669
    • Ben Gamari's avatar
      rts: Compile with gcc -Og · d4abd031
      Ben Gamari authored
      This optimisation level is specifically designed to provide the benefits
      of optimisation without the obfuscation that sometimes results.
      Test Plan: Validate
      Reviewers: simonmar
      Reviewed By: simonmar
      Subscribers: rwbarton, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4675
  2. 13 May, 2018 9 commits
    • David Feuer's avatar
      Remove unused things from utils/Digraph · cdbe00fe
      David Feuer authored
      `utils/Digraph` had a bunch of code that wasn't actually being used,
      much of which wasn't documented at all, some of which was clearly
      ill-considered, and some of which was documented as being inefficient.
      Remove all unused code from that module except for the obvious and
      innocuous `emptyG`.
      Reviewers: bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4676
    • David Feuer's avatar
      Fix changelog message for asinh · 2828dbf4
      David Feuer authored
      Reviewers: bgamari, hvr
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4678
    • Michal Terepeta's avatar
      Fix a few GCC warnings · eb39f988
      Michal Terepeta authored
      GCC 8 now generates warnings for incompatible function pointer casts
      [-Werror=cast-function-type]. Apparently there are a few of those in rts
      code, which makes `./validate` unhappy (since we compile with `-Werror`)
      This commit tries to fix these issues by changing the functions to have
      the correct type (and, if necessary, moving the casts into those
      For instance, hash/comparison function are declared (`Hash.h`) to take
      `StgWord` but we want to use `StgWord64[2]` in `StaticPtrTable.c`.
      Instead of casting the function pointers, we can cast the `StgWord`
      parameter to `StgWord*`. I think this should be ok since `StgWord`
      should be the same size as a pointer.
      Signed-off-by: Michal Terepeta's avatarMichal Terepeta <michal.terepeta@gmail.com>
      Test Plan: ./validate
      Reviewers: bgamari, erikd, simonmar
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4673
    • Sylvain Henry's avatar
      Refactor LitString · 7c665f9c
      Sylvain Henry authored
      Refactor LitString so that the string length is computed at most once
      and then stored.
      Also remove strlen and memcmp wrappers (it seems like they were a
      workaround for a very old GCC when using -fvia-C).
      Bumps haddock submodule.
      Reviewers: bgamari, dfeuer, nickkuk
      Reviewed By: bgamari, nickkuk
      Subscribers: nickkuk, dfeuer, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4630
    • Ben Gamari's avatar
      Bump array submodule · 21884270
      Ben Gamari authored
    • Ben Gamari's avatar
      TcInteract: Ensure that tycons have representations before solving for Typeable · f0212a93
      Ben Gamari authored
      Summary: This fixes #15067.
      Test Plan: Validate
      Subscribers: thomie, carter, RyanGlScott
      GHC Trac Issues: #15067
      Differential Revision: https://phabricator.haskell.org/D4623
    • Ben Gamari's avatar
      base: Fix handling of showEFloat (Just 0) · 9039f847
      Ben Gamari authored
      Previously `showEFloat (Just 0) pi ""` would produce `3.0e0`. Of
      course, this
      blatantly disrespects the user's request to print with zero digits of
      Fix this.
      This is tested by base's `num008` testcase.
      Test Plan: Validate
      Reviewers: hvr
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #15115
      Differential Revision: https://phabricator.haskell.org/D4665
    • Matthew Pickering's avatar
      Simplify -ddump-json implementation · 6ab7cf99
      Matthew Pickering authored
      This patch takes the much simpler route of whenever the compiler tries
      to output something. We just dump a JSON document there and then.
      I think this should be sufficient to work with and anything more refined
      quickly got complicated as it was necessary to demarcate message scopes
      and so on.
      Reviewers: bgamari, dfeuer
      Reviewed By: bgamari
      Subscribers: Phyx, dfeuer, rwbarton, thomie, carter
      GHC Trac Issues: #14078
      Differential Revision: https://phabricator.haskell.org/D4532
    • Herbert Valerio Riedel's avatar
      Emit info-level log message when package envs are loaded · 00049e2d
      Herbert Valerio Riedel authored
      A common complaint with the new package environment files feature is
      that it's not obvious when package environments have been picked up.
      This patch applies the same strategy that was already used for `.ghci` files
      (which exhibit similar potential for confusion, c.f. #11389) to package
      environment files.
      For instance, this new notification looks like below for a GHCi invocation which
      loads both, a GHCi configuration as well as a package environment:
        GHCi, version 8.5.20180512: http://www.haskell.org/ghc/  :? for help
        Loaded package environment from /tmp/parsec-
        Loaded GHCi configuration from /home/hvr/.ghci
      Addresses #15145
      Reviewed By: bgamari, angerman
      GHC Trac Issues: #15145
      Differential Revision: https://phabricator.haskell.org/D4689
  3. 12 May, 2018 4 commits
  4. 11 May, 2018 2 commits
  5. 10 May, 2018 3 commits
  6. 09 May, 2018 1 commit
    • Simon Marlow's avatar
      Add -fghci-leak-check to check for space leaks · 5fe6aaa3
      Simon Marlow authored
      Space leaks in GHCi emerge from time to time and tend to come back again
      after they get fixed. This is an attempt to limit regressions by
      * adding a reliable detection for some classes of space leaks in GHCi
      * turning on leak checking for all GHCi tests in the test suite, so that
        we'll notice if the leak appears again.
      The idea for detecting space leaks is quite simple:
      * find some data that we expect to be GC'd later, make a weak pointer to it
      * when we expect the data to be dead, do a `performGC` and then check
        the status of the weak pointer.
      It would be nice to apply this trick to lots of things in GHC,
      e.g. ensuring that HsSyn is not retained after the desugarer, or
      ensuring that CoreSyn from the previous simplifier pass is not retained.
      Test Plan: validate
      Reviewers: bgamari, simonpj, erikd, niteria
      Subscribers: thomie, carter
      GHC Trac Issues: #15111
      Differential Revision: https://phabricator.haskell.org/D4658
  7. 08 May, 2018 7 commits