1. 26 Jun, 2019 7 commits
  2. 25 Jun, 2019 8 commits
    • Erik de Castro Lopo's avatar
      Add MonadFail instance for ParserM · 73598b14
      Erik de Castro Lopo authored
      (cherry picked from commit 581cbc28)
      73598b14
    • Erik de Castro Lopo's avatar
      Fixes for LLVM 7 · 8dd80930
      Erik de Castro Lopo authored
      LLVM version numberinf changed recently. Previously, releases were numbered
      4.0, 5.0 and 6.0 but with version 7, they dropped the redundant ".0".
      
      Fix requires for Llvm detection and some code.
      
      (cherry picked from commit 71aca77c)
      8dd80930
    • Ben Gamari's avatar
      ghci: Load static objects in batches · 921c18de
      Ben Gamari authored
      Previously in the case where GHC was dynamically linked we would load
      static objects one-by-one by linking each into its own shared object and
      dlopen'ing each in order. However, this meant that the link would fail
      in the event that the objects had cyclic symbol dependencies.
      
      Here we fix this by merging each "run" of static objects into a single
      shared object and loading this.
      
      Fixes #13786 for the case where GHC is dynamically linked.
      
      (cherry picked from commit cd177b44)
      921c18de
    • Ben Gamari's avatar
      testsuite: Test for #13786 · bbf5dfa6
      Ben Gamari authored
      (cherry picked from commit 652b83be)
      bbf5dfa6
    • Ben Gamari's avatar
      testsuite: Add test for #16563 · 1c06d9e7
      Ben Gamari authored
      (cherry picked from commit 22743f72)
      1c06d9e7
    • Ben Gamari's avatar
      ghci: Don't rely on resolution of System.IO to base module · ce029689
      Ben Gamari authored
      Previously we would hackily evaluate a textual code snippet to compute
      actions to disable I/O buffering and flush the stdout/stderr handles.
      This broke in a number of ways (#15336, #16563).
      
      Instead we now ship a module (`GHC.GHCi.Helpers`) with `base` containing
      the needed actions. We can then easily refer to these via `Orig` names.
      
      (cherry picked from commit abee907f)
      ce029689
    • Richard Eisenberg's avatar
      GHCi support for levity-polymorphic join points · 7ffe0681
      Richard Eisenberg authored
      Fixes #16509.
      
      See Note [Levity-polymorphic join points] in ByteCodeGen,
      which tells the full story.
      
      This commit also adds some comments and cleans some code
      in the byte-code generator, as I was exploring around trying
      to understand it.
      
      test case: ghci/scripts/T16509
      
      (cherry picked from commit 392210bf)
      7ffe0681
    • Vladislav Zavialov's avatar
      Fix the ghci063 test on Darwin (Trac #16201) · f9da172c
      Vladislav Zavialov authored
      We use "touch -r" to set modification timestamps, which leads to precision loss
      on Darwin. For example,
      
         before: 2019-02-25 01:11:23.807627350 +0300
         after:  2019-02-25 01:11:23.807627000 +0300
                                           ^^^
      This means we can't trick GHCi into thinking the file hasn't been changed by
      restoring its old timestamp, as we cannot faithfully restore all digits.
      
      The solution is to nullify the insignificant digits before the first :load
      
      (cherry picked from commit f320f3b2)
      f9da172c
  3. 24 Jun, 2019 11 commits
  4. 23 Jun, 2019 9 commits
    • Zejun Wu's avatar
      Pass preprocessor options to C compiler when building foreign C files (#16737) · 1c18d3b4
      Zejun Wu authored
      (cherry picked from commit cfd3e0f1)
      1c18d3b4
    • Ben Gamari's avatar
      testsuite: Add test for #16514 · c1c0ce7a
      Ben Gamari authored
      (cherry picked from commit 41bf4045)
      c1c0ce7a
    • Iavor S. Diatchki's avatar
      Add a `NOINLINE` pragma on `someNatVal` (#16586) · ab8a4a3a
      Iavor S. Diatchki authored
      This fixes #16586, see `Note [NOINLINE someNatVal]` for details.
      
      (cherry picked from commit 59f4cb6f)
      ab8a4a3a
    • Yuriy Syrovetskiy's avatar
      Replace git.haskell.org with gitlab.haskell.org (#16196) · 04a27889
      Yuriy Syrovetskiy authored
      (cherry picked from commit 75abaaea)
      04a27889
    • Shayne Fletcher's avatar
      Make Extension derive Bounded · bdb70d2e
      Shayne Fletcher authored
      (cherry picked from commit 9047f184)
      bdb70d2e
    • Ben Gamari's avatar
      ghci: Ensure that system libffi include path is searched · 0988b193
      Ben Gamari authored
      Previously hsc2hs failed when building against a system FFI.
      
      (cherry picked from commit 1abb76ab)
      0988b193
    • Ben Gamari's avatar
      users guide: Mention supported LLVM version · 0b1519b3
      Ben Gamari authored
      0b1519b3
    • Simon Peyton Jones's avatar
      Add a missing update of sc_hole_ty (#16312) · 589ad602
      Simon Peyton Jones authored
      In simplCast I totally failed to keep the sc_hole_ty field of
      ApplyToTy (see Note [The hole type in ApplyToTy]) up to date.
      When a cast goes by, of course the hole type changes.
      
      Amazingly this has not bitten us before, but #16312 finally
      triggered it.  Fortunately the fix is simple.
      
      Fixes #16312.
      
      (cherry picked from commit ef36b102)
      589ad602
    • Michael Peyton Jones's avatar
      Visibility: handle multiple units with the same name · 856cdb9d
      Michael Peyton Jones authored
      Fixes #16228. The included test case is adapted from the reproduction in
      the issue, and fails without this patch.
      
      ------
      
      We compute an initial visilibity mapping for units based on what is
      present in the package databases. To seed this, we compute a set of all
      the package configs to add visibilities for.
      
      However, this set was keyed off the unit's *package name*. This is
      correct, since we compare packages across databases by version. However,
      we would only ever consider a single, most-preferable unit from the
      database in which it was found.
      
      The effect of this was that only one of the libraries in a Cabal package
      would be added to this initial set. This would cause attempts to use
      modules from the omitted libraries to fail, claiming that the package
      was hidden (even though `ghc-pkg` would correctly show it as visible).
      
      A solution is to do the selection of the most preferable packages
      separately, and then be sure to consider exposing all units in the
      same package in the same package db. We can do this by picking a
      most-preferable unit for each package name, and then considering
      exposing all units that are equi-preferable with that unit.
      
      ------
      
      Why wasn't this bug apparent to all people trying to use sub-libraries
      in Cabal? The answer is that Cabal explicitly passes `-package` and
      `-package-id` flags for all the packages it wants to use, rather than
      relying on the state of the package database. So this bug only really
      affects people who are trying to use package databases produced by Cabal
      outside of Cabal itself.
      
      One particular example of this is the way that the
      Nixpkgs Haskell infrastructure provides wrapped GHCs: typically these
      are equipped with a package database containing all the needed
      package dependencies, and the user is not expected to pass
      `-package` flags explicitly.
      
      (cherry picked from commit 8a20bfc2)
      856cdb9d
  5. 22 Jun, 2019 1 commit
  6. 21 Jun, 2019 1 commit
  7. 19 Jun, 2019 2 commits
    • Richard Eisenberg's avatar
      Fix #16517 by bumping the TcLevel for method sigs · 4a5ab8f0
      Richard Eisenberg authored
      There were actually two bugs fixed here:
      
      1. candidateQTyVarsOfType needs to be careful that it does not
         try to zap metavariables from an outer scope as "naughty"
         quantification candidates. This commit adds a simple check
         to avoid doing so.
      
      2. We weren't bumping the TcLevel in kcHsKindSig, which was used
         only for class method sigs. This mistake led to the acceptance
         of
      
           class C a where
             meth :: forall k. Proxy (a :: k) -> ()
      
         Note that k is *locally* quantified. This patch fixes the
         problem by using tcClassSigType, which correctly bumps the
         level. It's a bit inefficient because tcClassSigType does other
         work, too, but it would be tedious to repeat much of the code
         there with only a few changes. This version works well and is
         simple.
      
      And, while updating comments, etc., I noticed that tcRnType was
      missing a pushTcLevel, leading to #16767, which this patch also
      fixes, by bumping the level. In the refactoring here, I also
      use solveEqualities. This initially failed ghci/scripts/T15415,
      but that was fixed by teaching solveEqualities to respect
      -XPartialTypeSignatures.
      
      This patch also cleans up some Notes around error generation that
      came up in conversation.
      
      Test case: typecheck/should_fail/T16517, ghci/scripts/T16767
      
      (cherry picked from commit a22e51ea)
      (cherry picked from commit 19ab32c5)
      4a5ab8f0
    • Simon Peyton Jones's avatar
      Fail fast in solveLocalEqualities · ce6a492b
      Simon Peyton Jones authored
      This patch makes us fail fast in TcSimplify.solveLocalEqualities,
      and in TcHsType.tc_hs_sig_type, if there are insoluble constraints.
      
      Previously we ploughed on even if there were insoluble constraints,
      leading to a cascade of hard-to-understand type errors. Failing
      eagerly is much better; hence a lot of testsuite error message
      changes.  Eg if we have
                f :: [Maybe] -> blah
                f xs = e
      then trying typecheck 'f x = e' with an utterly bogus type
      is just asking for trouble.
      
      I can't quite remember what provoked me to make this change,
      but I think the error messages are notably improved, by
      removing confusing clutter and focusing on the real error.
      
      (cherry picked from commit 5c1f268e)
      ce6a492b
  8. 18 Jun, 2019 1 commit