1. 01 Jun, 2015 1 commit
    • archblob's avatar
      Catch canonicalizePath exceptions, fix #10101 · 47564389
      archblob authored
      Introduce by #95 'canonicalizePath' throws and exception when given
      an invalid file in a call to 'sameFile'.
      There are two cases when this can happen when using ghci:
        1) If there is an error at the interactive prompt, "<interactive>"
           file is searched for and not found.
        2) If there is an error in any loaded file and editing an inexistent/new
           file with 'e: foo'.
      Both cases are now tested.
      Test Plan: validate
      Reviewers: austin, #ghc
      Reviewed By: austin, #ghc
      Subscribers: bgamari, thomie
      Differential Revision: https://phabricator.haskell.org/D930
      GHC Trac Issues: #10101
  2. 31 May, 2015 3 commits
  3. 30 May, 2015 16 commits
  4. 29 May, 2015 2 commits
  5. 28 May, 2015 4 commits
    • Austin Seipp's avatar
      base: fix #10298 & #7695 · e28462de
      Austin Seipp authored
      This applies a patch from Reid Barton and Sylvain Henry, which fix a
      disasterous infinite loop when iconv fails to load locale files, as
      specified in #10298.
      The fix is a bit of a hack but should be fine - for the actual reasoning
      behind it, see `Note [Disaster and iconv]` for more info.
      In addition to this fix, we also patch up the IO Encoding utilities to
      recognize several variations of the 'ASCII' encoding (including its
      aliases) directly so that GHC can do conversions without iconv. This
      allows a static binary to sit in an initramfs.
      Authored-by: rwbarton's avatarReid Barton <rwbarton@gmail.com>
      Authored-by: default avatarSylvain Henry <hsyl20@gmail.com>
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      Test Plan: Eyeballed it.
      Reviewers: rwbarton, hvr
      Subscribers: bgamari, thomie
      Differential Revision: https://phabricator.haskell.org/D898
      GHC Trac Issues: #10298, #7695
    • Edward Z. Yang's avatar
      Remove unnecessary loadInterface for TH quoted name. · 640fe142
      Edward Z. Yang authored
      The load was introduced a32d3e4d
      to fix a bug where deprecations assumed that the name in question
      had already had their interface loaded.  The new deprecation
      code no longer makes this assumption and just loads the interface,
      so this eager load is not necessary.
      Verified that TH_reifyType2 continues to work.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      Test Plan: validate
      Reviewers: simonpj, austin
      Subscribers: bgamari, thomie
      Differential Revision: https://phabricator.haskell.org/D891
      GHC Trac Issues: #10419
    • Thomas Miedema's avatar
      Testdriver: do not interfer with MinGW path magic (#10449) · ce166a3a
      Thomas Miedema authored
      This should fix the testsuite driver on Windows using the MinGW tools
      with a native build of Python.
      MinGW automagically converts MinGW-style paths (e.g.
      '/c/programs/ghc/bin/ghc') into ordinary Windows paths (e.g.
      'C:/programs/ghc/bin/ghc') when a native Windows program is invoked. But
      it doesn't do so when those paths are wrapped with a pair of escaped
      double quotes.
      The fix is to not call `eval` on the paths in Python, which let's us use
      one less pair of quotes, and makes MinGW happy.
      Reviewers: Rufflewind, austin
      Differential Revision: https://phabricator.haskell.org/D911
    • Rufflewind's avatar
      Testdriver: don't use os.popen in config/ghc · ef904660
      Rufflewind authored and Thomas Miedema's avatar Thomas Miedema committed
      Rewrite config/ghc to use getStdout (which use subprocess.Popen) instead
      of os.popen, which is deprecated; this also avoids the use of shell
      * Move getStdout to driver/testutil.py so both config/ghc and
        driver/runtests.py can use it
      * Remove support for Python below 2.4, which doesn't have subprocess
      Reviewed By: thomie
      Differential Revision: https://phabricator.haskell.org/D908
  6. 27 May, 2015 2 commits
    • Alan Zimmerman's avatar
      ApiAnnotations tweaks · c5911479
      Alan Zimmerman authored
      A collection of minor updates for the API Annotations.
      1. The annotations for the implicity parameter is disconnected in the
          type MPI = ?mpi_secret :: MPISecret
      2. In the following, the annotation for one of the commas is disconeected.
          mkPoli = mkBila . map ((,,(),,()) <$> P.base <*> P.pos <*> P.form)
      3. In the following, the annotation for the parens becomes disconnected
          data MaybeDefault v where
              SetTo :: forall v . ( Eq v, Show v ) => !v -> MaybeDefault v
              SetTo4 :: forall v a. (( Eq v, Show v ) => v -> MaybeDefault v
                                                      -> a -> MaybeDefault [a])
      Test Plan: ./validate
      Reviewers: hvr, austin
      Reviewed By: austin
      Subscribers: bgamari, thomie, mpickering
      Differential Revision: https://phabricator.haskell.org/D901
      GHC Trac Issues: #10399
    • Thomas Miedema's avatar
      Build system: don't install haddock .t files (#10410) · 388448bc
      Thomas Miedema authored
      When generating a haddock .t file for a library, don't save it in the
      `dist-install/doc` directory for that library, as then it gets copied to
      the installation directory during `make install` by `ghc-cabal copy`.
      Instead, save it a few directories up; putting it next to
      `haddock-prologue.txt` seemed appropriate.
      Test Plan: run `make` in `tests/perf/haddock`.
      Differential Revision: https://phabricator.haskell.org/D903
  7. 26 May, 2015 2 commits
  8. 25 May, 2015 1 commit
  9. 23 May, 2015 5 commits
  10. 22 May, 2015 4 commits
    • Simon Peyton Jones's avatar
      Fix a huge space leak in the mighty Simplifier · 45d9a15c
      Simon Peyton Jones authored
      This long-standing, terrible, adn somewhat subtle bug was exposed
      by Trac #10370, thanks to Reid Barton's brilliant test case (comment:3).
      The effect is large on the Trac #10370 test.
      Here is what the profile report says:
       total time  =       24.35 secs   (24353 ticks @ 1000 us, 1 processor)
       total alloc = 11,864,360,816 bytes  (excludes profiling overheads)
       total time  =       21.16 secs   (21160 ticks @ 1000 us, 1 processor)
       total alloc = 7,947,141,136 bytes  (excludes profiling overheads)
      The /combined/ effect of the tidyOccName fix, plus this one, is dramtic
      for Trac #10370.  Here is what +RTS -s says:
        15,490,210,952 bytes allocated in the heap
         1,783,919,456 bytes maximum residency (20 sample(s))
        MUT     time   30.117s  ( 31.383s elapsed)
        GC      time   90.103s  ( 90.107s elapsed)
        Total   time  120.843s  (122.065s elapsed)
         7,928,671,936 bytes allocated in the heap
            52,914,832 bytes maximum residency (25 sample(s))
        MUT     time   13.912s  ( 15.110s elapsed)
        GC      time    6.809s  (  6.808s elapsed)
        Total   time   20.789s  ( 21.954s elapsed)
      - Heap allocation halved
      - Residency cut by a factor of more than 30.
      - ELapsed time cut by a factor of 6
      Not bad!
      The details
      The culprit was SimplEnv.mkCoreSubst, which used mapVarEnv to do some
      impedence-matching from the substitituion used by the simplifier to
      the one used by CoreSubst.  But the impedence-mactching was recursive!
        mk_subst tv_env cv_env id_env
          = CoreSubst.mkSubst in_scope tv_env cv_env (mapVarEnv fiddle id_env)
        fiddle (DoneEx e)          = e
        fiddle (DoneId v)          = Var v
        fiddle (ContEx tv cv id e) = CoreSubst.substExpr (mk_subst tv cv id) e
      Inside fiddle, in the ContEx case, we may do another whole level of
      fiddle.  And so on.  Moreover, UniqFM (which is built on Data.IntMap) is
      strict, so the fiddling is done eagerly.  I didn't wok through all the
      details but the result is a gargatuan blow-up of entirely unnecessary work.
      Laziness would make this go away, I think, but I don't want to mess
      with IntMap.  And in any case, the impedence matching is a royal pain.
      In the end I simply ceased trying to use CoreSubst.substExpr in the
      simplifier, and instead just use simplExpr.  That does mean bit of
      duplication; e.g.  new code for simplRules.  But it's not a big deal
      and it's far more direct and easy to reason about.
      A bit of knock-on refactoring:
       * Data type ArgSummary moves to CoreUnfold.
       * interestingArg moves from CoreUnfold to SimplUtils, and gets a
         SimplEnv argument which can be used when we encounter a variable.
       * simplLamBndrs, addBndrRules move from SimplEnv to Simplify
         (because they now calls simplUnfolding, simplRules resp)
       * SimplUtils.substExpr, substUnfolding, mkCoreSubst die completely
       * In Simplify some several functions that were previously pure
         substitution-based functions are now monadic:
           - addBndrRules, simplRule
           - addCoerce, add_coerce in simplCast
       * In case 2c of Simplify.rebuildCase, there was a pretty disgusting
         expression-substitution taking place for 'rhs'; and we really don't
         want to make that monadic becuase 'rhs' can be big.
         Solution: reduce the arity of the rules for seq.
         See Note [User-defined RULES for seq] in MkId.
    • Simon Peyton Jones's avatar
      Fix quadratic behaviour in tidyOccName · c89bd681
      Simon Peyton Jones authored
      In the test program from comment:3 of Trac #10370, it turned out
      that 25% of all compile time was going in OccName.tidyOccName!
      It was all becuase the algorithm for finding an unused OccName
      had a quadratic case.
      This patch fixes it.  THe effect is pretty big:
      	total time  =       34.30 secs   (34295 ticks @ 1000 us, 1 processor)
      	total alloc = 15,496,011,168 bytes  (excludes profiling overheads)
      	total time  =       25.41 secs   (25415 ticks @ 1000 us, 1 processor)
      	total alloc = 11,812,744,816 bytes  (excludes profiling overheads)
    • Simon Peyton Jones's avatar
      Reduce magic for seqId · eae703aa
      Simon Peyton Jones authored
      An upcoming commit means that the RULES for 'seq' get only
      one value arg, not two.  This patch prepares for that by
      - reducing the arity of seq's built-in rule, to take one value arg
      - making 'seq' not inline on the LHS of RULES
      - and removing the horrid un-inlining in DsBinds.decomposeRuleLhs
    • Simon Peyton Jones's avatar
      White space layout only · 369dd0c6
      Simon Peyton Jones authored