1. 10 Dec, 2019 2 commits
  2. 06 Dec, 2019 2 commits
  3. 19 Nov, 2019 2 commits
  4. 18 Nov, 2019 3 commits
  5. 12 Nov, 2019 1 commit
  6. 10 Nov, 2019 1 commit
    • vdukhovni's avatar
      On FreeBSD 12 sys/sysctl.h requires sys/types.h · dde5c06a
      vdukhovni authored
      Else build fails with:
          In file included from ExecutablePath.hsc:42:
          /usr/include/sys/sysctl.h:1062:25: error: unknown type name 'u_int'; did you mean 'int'?
           int sysctl(const int *, u_int, void *, size_t *, const void *, size_t);
          compiling libraries/base/dist-install/build/System/Environment/ExecutablePath_hsc_make.c failed (exit code 1)
      Perhaps also also other FreeBSD releases, but additional include
      will no harm even if not needed.
  7. 08 Nov, 2019 2 commits
    • Simon Peyton Jones's avatar
      Improve error recovery in the typechecker · cf05e689
      Simon Peyton Jones authored
      Issue #16418 showed that we were carrying on too eagerly after a bogus
      type signature was identified (a bad telescope in fact), leading to a
      subsequent crash.
      This led me in to a maze of twisty little passages in the typechecker's
      error recovery, and I ended up doing some refactoring in TcRnMonad.
      Some specfifics
      * TcRnMonad.try_m is now called attemptM.
      * I switched the order of the result pair in tryTc,
        to make it consistent with other similar functions.
      * The actual exception used in the Tc monad is irrelevant so,
        to avoid polluting type signatures, I made tcTryM, a simple
        wrapper around tryM, and used it.
      The more important changes are in
      * TcSimplify.captureTopConstraints, where we should have been calling
        simplifyTop rather than reportUnsolved, so that levity defaulting
        takes place properly.
      * TcUnify.emitResidualTvConstraint, where we need to set the correct
        status for a new implication constraint.  (Previously we ended up
        with an Insoluble constraint wrapped in an Unsolved implication,
        which meant that insolubleWC gave the wrong answer.
      (cherry picked from commit 4927117c)
    • Sebastian Graf's avatar
      Fix #17112 · bf5c4c19
      Sebastian Graf authored
      The `mkOneConFull` function of the pattern match checker used to try to
      guess the type arguments of the data type's type constructor by looking
      at the ambient type of the match. This doesn't work well for Pattern
      Synonyms, where the result type isn't even necessarily a TyCon
      application, and it shows in #11336 and #17112.
      Also the effort seems futile; why try to try hard when the type checker
      has already done the hard lifting? After this patch, we instead supply
      the type constructors arguments as an argument to the function and
      lean on the type-annotated AST.
      (cherry picked from commit a308b435)
  8. 07 Nov, 2019 1 commit
    • Simon Peyton Jones's avatar
      Don't do binder-swap for GlobalIds · dc9aa75e
      Simon Peyton Jones authored
      This patch disables the binder-swap transformation in the
      (relatively rare) case when the scrutinee is a GlobalId.
      Reason: we are getting Lint errors so that GHC doesn't
      even validate.  Trac #16346.
      This is NOT the final solution -- it's just a stop-gap
      to get us running again.
      The final solution is in Trac #16296
      (cherry picked from commit 0eb7cf03)
  9. 04 Nov, 2019 1 commit
  10. 03 Nov, 2019 23 commits
    • Ryan Scott's avatar
      Reify oversaturated data family instances correctly (#17296) · 9ecf4bb1
      Ryan Scott authored
      `TcSplice` was not properly handling oversaturated data family
      instances, such as the example in #17296, as it dropped arguments due
      to carelessly zipping data family instance arguments with
      `tyConTyVars`. For data families, the number of `tyConTyVars` can
      sometimes be less than the number of arguments it can accept in a
      data family instance due to the fact that data family instances can
      be oversaturated.
      To account for this, `TcSplice.mkIsPolyTvs` has now been renamed to
      `tyConArgsPolyKinded` and now factors in `tyConResKind` in addition
      to `tyConTyVars`. I've also added
      `Note [Reified instances and explicit kind signatures]` which
      explains the various subtleties in play here.
      Fixes #17296.
      (cherry picked from commit e3636a68)
    • Ryan Scott's avatar
      Fix #14579 by defining tyConAppNeedsKindSig, and using it · 963ed692
      Ryan Scott authored
      (cherry picked from commit e88e083d)
    • Ben Gamari's avatar
      configure: Search for LLVM executables with two-number versions · 140f0a74
      Ben Gamari authored
      Fedora uses the naming llc-7.0 while Debian uses llc-7. Ensure that both
      are found.
      Fixes #16990.
      (cherry picked from commit 90bf11c6)
    • Ben Gamari's avatar
      testsuite: Add tests for #16943 · d9e01a96
      Ben Gamari authored
      (cherry picked from commit f1d0e49f)
    • Sam Halliday's avatar
      expose ModuleInfo.minf_rdr_env for tooling authors · 854ce0e5
      Sam Halliday authored
      (cherry picked from commit 993804bf)
    • Andreas Klebinger's avatar
      Fix bounds check in ocResolve_PEi386 for relocation values. · ab65b997
      Andreas Klebinger authored
      The old test was wrong at least for gcc and the value -2287728808L.
      It also relied on implementation defined behaviour (right shift
      on a negative value), which might or might not be ok.
      Either way it's now a simple comparison which will always work.
      (cherry picked from commit abfbdff2)
    • Ben Gamari's avatar
      configure: Don't depend upon alex in source dist build · 996f281c
      Ben Gamari authored
      This fixes #16860 by verifying that the generated sources don't already
      exist before asserting that the `alex` executable was found. This
      replicates the logic already used for `happy` in the case of `alex`.
      (cherry picked from commit 68dc96a0)
    • Ömer Sinan Ağacan's avatar
      Fix new compact block allocation in allocateForCompact · c4cfb707
      Ömer Sinan Ağacan authored
      allocateForCompact() is called when nursery of a compact region is
      full, to add new blocks to the compact. New blocks added to an existing
      region needs a StgCompactNFDataBlock header, not a StgCompactNFData.
      This fixes allocateForCompact() so that it now correctly allocates space
      for StgCompactNFDataBlock instead of StgCompactNFData as before.
      Fixes #17044.
      A regression test T17044 added.
      (cherry picked from commit 981d3b9e)
    • Ben Gamari's avatar
      Exclude rts.cabal from source distributions · 1c33f5d6
      Ben Gamari authored
      This modifies both the Hadrian and make build systems to avoid included
      the rts.cabal generated by autoconf in the source distribution.
      Fixes #17265.
      (cherry picked from commit e81d4bc7)
    • Ben Gamari's avatar
      rules/haddock: Ensure that RTS stats directory exists · c3fd844c
      Ben Gamari authored
      It may not exist if the source tarball was extracted yet not the
      testsuite tarball.
      (cherry picked from commit 624eb0fc)
    • Ben Gamari's avatar
      rts: Fix CNF dirtying logic · 900fce4e
      Ben Gamari authored
      Previously due to a silly implementation bug CNFs would never have their
      dirty flag set, resulting in their being added again and again to the
      `mut_list`. Fix this.
      Fixes #17297.
      (cherry picked from commit ba27fe74)
    • Stefan Schulze Frielinghaus's avatar
      Extend argument of createIOThread to word size · 822a7f4d
      Stefan Schulze Frielinghaus authored
      Function createIOThread expects its second argument to be of size word.
      The natural size of the second parameter is 32bits. Thus for some 64bit
      architectures, where a write of the lower half of a register does not
      clear the upper half, the value must be zero extended.
      (cherry picked from commit d0924b15)
    • Ben Gamari's avatar
      configure: Determine library versions of template-haskell, et al. · 2c0df863
      Ben Gamari authored
      These are needed by the user guide documentation. Fixes #17260.
      (cherry picked from commit 0c53d0aa)
    • Roland Senn's avatar
      New fix for #11647. Avoid side effects like #17171 · 2fe94000
      Roland Senn authored
      If a main module doesn't contain a header, we omit the check whether the main module is exported.
      With this patch GHC, GHCi and runghc use the same code.
      (cherry picked from commit 93f02b62)
    • Ryan Scott's avatar
      Don't skip validity checks for built-in classes (#17355) · 51036008
      Ryan Scott authored
      Issue #17355 occurred because the control flow for
      `TcValidity.check_valid_inst_head` was structured in such a way that
      whenever it checked a special, built-in class (like `Generic` or
      `HasField`), it would skip the most important check of all:
      `checkValidTypePats`, which rejects nonsense like this:
      instance Generic (forall a. a)
      This fixes the issue by carving out `checkValidTypePats` from
      `check_valid_inst_head` so that `checkValidTypePats` is always
      invoked. `check_valid_inst_head` has also been renamed to
      `check_special_inst_head` to reflect its new purpose of _only_
      checking for instances headed by special classes.
      Fixes #17355.
      (cherry picked from commit f375e3fb)
    • Ben Gamari's avatar
      Bump stm submodule · e8175bed
      Ben Gamari authored
      (cherry picked from commit 8b578e72)
    • ryates@cs.rochester.edu's avatar
      Full abort on validate failure merging `orElse`. · 432a270e
      ryates@cs.rochester.edu authored
      Previously partial roll back of a branch of an `orElse` was attempted
      if validation failure was observed.  Validation here, however, does
      not account for what part of the transaction observed inconsistent
      state.  This commit fixes this by fully aborting and restarting the
      (cherry picked from commit 998f2e18)
    • Ben Gamari's avatar
      Drop duplicate -optl's from GHC invocations · 9c7dde7f
      Ben Gamari authored
      Previously the make build system would pass things like
      `-optl-optl-Wl,-x -optl-optl-Wl,noexecstack` to GHC. This would
      naturally result in mass confusion as GHC would pass `-optl-Wl,-x` to
      GCC. GCC would in turn interpret this as `-o ptl-Wl,-x`, setting the
      output pass of the invocation.
      The problem that `-optl` was added to the command-line in two places in
      the build system. Fix this.
      Fixes #17385.
      (cherry picked from commit 2d12d59e)
    • Ben Gamari's avatar
      base: Add @since on GHC.IO.Handle.Lock.hUnlock · 68dc5b0a
      Ben Gamari authored
      Unfortunately this was introduced in base-4.11.0 (GHC 8.4.1)
      whereas the other locking primitives were added in base-4.10.0 (GHC
      (cherry picked from commit 3ad35f76)
    • Roland Senn's avatar
      Fix #14690 - :steplocal panics after break-on-error · 4c376e30
      Roland Senn authored
      `:steplocal` enables only breakpoints in the current top-level binding.
      When a normal breakpoint is hit, then the module name and the break id from the `BRK_FUN` byte code
      allow us to access the corresponding entry in a ModBreak table. From this entry we then get the SrcSpan
      (see compiler/main/InteractiveEval.hs:bindLocalsAtBreakpoint).
      With this source-span we can then determine the current top-level binding, needed for the steplocal command.
      However, if we break at an exception or at an error, we don't have an BRK_FUN byte-code, so we don't have any source information.
      The function `bindLocalsAtBreakpoint` creates an `UnhelpfulSpan`, which doesn't allow us to determine the current top-level binding.
      To avoid a `panic`, we have to check for `UnhelpfulSpan` in the function `ghc/GHCi/UI.hs:stepLocalCmd`.
      Hence a :steplocal command after a break-on-exception or a break-on-error is not possible.
      (cherry picked from commit 1be9c35c)
    • Ben Gamari's avatar
      testsuite: Add test for #17414 · d04492c0
      Ben Gamari authored
      (cherry picked from commit 1ce3d982)
    • Ben Gamari's avatar
      base: Clamp IO operation size to 2GB on Darwin · 176367f8
      Ben Gamari authored
      As reported in #17414, Darwin throws EINVAL in response to large
      (cherry picked from commit 08810f12)
    • Ömer Sinan Ağacan's avatar
      Fix LLVM version check yet again · 061f7f9b
      Ömer Sinan Ağacan authored
      There were two problems with LLVM version checking:
      - The parser would only parse x and x.y formatted versions. E.g. 1.2.3
        would be rejected.
      - The version check was too strict and would reject x.y formatted
        versions. E.g. when we support version 7 it'd reject 7.0 ("LLVM
        version 7.0") and only accept 7 ("LLVM version 7").
      We now parse versions with arbitrarily deep minor numbering (x.y.z.t...)
      and accept versions as long as the major version matches the supported
      version (e.g. 7.1, 7.1.2, ...).
      (cherry picked from commit bf9dfe1c)
  11. 23 Oct, 2019 2 commits