Skip to content
Snippets Groups Projects
  1. Jan 17, 2022
  2. Jan 15, 2022
    • Eric Lindblad's avatar
      wikipedia link · 4031ef62
      Eric Lindblad authored
      4031ef62
    • Tamar Christina's avatar
      winio: fix heap corruption and various leaks. · 0dc72395
      Tamar Christina authored and Marge Bot's avatar Marge Bot committed
      0dc72395
    • Ben Gamari's avatar
      rts: Consolidate RtsSymbols from libc · e2b60be8
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Previously (9ebda74e) `environ` was
      added to `RtsSymbols` to ensure that environment was correctly
      propagated when statically linking. However, this introduced #20577
      since platforms are inconsistent in whether they provide a prototype for
      `environ`. I fixed this by providing a prototype but while doing so
      dropped symbol-table entry, presumably thinking that it was redundant
      due to the entry in the mingw-specific table.
      
      Here I reintroduce the symbol table entry for `environ` and move libc
      symbols shared by Windows and Linux into a new macro,
      `RTS_LIBC_SYMBOLS`, avoiding this potential confusion.
      e2b60be8
  3. Jan 14, 2022
  4. Jan 13, 2022
  5. Jan 12, 2022
    • Matthew Pickering's avatar
      docs: MonadComprehension desugar using Alternative rather than MonadPlus · 92f3e6e4
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      Fixes #20928
      92f3e6e4
    • Matthew Pickering's avatar
      RTTI: Substitute the [rk] skolems into kinds · c2099059
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      
      (Fixes #10616 and #10617)
      
      Co-authored-by: default avatarRoland Senn <rsx@bluewin.ch>
      c2099059
    • Peter Trommler's avatar
      RTS: Remove unused file xxhash.c · 35bea01b
      Peter Trommler authored and Marge Bot's avatar Marge Bot committed
      35bea01b
    • Greg Steuck's avatar
      Disable keep-cafs{,-fail} tests on OpenBSD · ed39d15c
      Greg Steuck authored and Marge Bot's avatar Marge Bot committed
      They are likely broken for the same reason as FreeBSD where the tests
      are already disabled.
      ed39d15c
    • Greg Steuck's avatar
      Feed /dev/null into cgrun025 · 7911aaa9
      Greg Steuck authored and Marge Bot's avatar Marge Bot committed
      The test currently times out waiting for end of stdin in getContents.
      The expected output indicates that nothing should come for the test to
      pass as written. It is unclear how the test was supposed to pass, but
      this looks like a sufficient hack to make it work.
      7911aaa9
    • Greg Steuck's avatar
      Remove from error the parenthesized amount of memory requested · e505dbd3
      Greg Steuck authored and Marge Bot's avatar Marge Bot committed
      Diagnostics for outofmem test on OpenBSD includes the amount of memory
      that it failed to allocate. This seems like an irrelevant detail that
      could change over time and isn't required for determining if test
      passed.
      
      Typical elided text is '(requested 2148532224 bytes)'
      e505dbd3
    • Matthew Pickering's avatar
      Change assertions in Stats.c to warnings (and introduce WARN macro) · 7ca43a3f
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      ASSERT should be used in situations where something very bad will happen
      later on if a certain invariant doesn't hold. The idea is that IF we
      catch the assertion earlier then it will be easier to work out what's
      going on at that point rather than at some indeterminate point in the
      future of the program.
      
      The assertions in Stats.c do not obey this philsophy and it is quite
      annoying if you are running a debug build (or a ticky compiler) and one
      of these assertions fails right at the end of your program, before the
      ticky report is printed out so you don't get any profiling information.
      
      Given that nothing terrible happens if these assertions are not true, or
      at least the terrible thing will happen in very close proximity to the
      assertion failure, these assertions use the new WARN macro which prints
      the assertion failure to stdout but does not exit the program.
      
      Of course, it would be better to fix these metrics to not trigger the
      assertion in the first place but if they did fail again in the future it
      is frustrating to be bamboozled in this manner.
      
      Fixes #20899
      7ca43a3f
    • Matthew Pickering's avatar
      Enable :seti in a multi component repl · 19b13698
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      Part of #20889
      19b13698
    • Matthew Pickering's avatar
      Use interactive flags when printing expressions in GHCi · 833216a3
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      The documentation states that the interactive flags should be use for
      any interactive expressions. The interactive flags are used when
      typechecking these expressions but not when printing. The session flags
      (modified by :set) are only used when loading a module.
      
      Fixes #20909
      833216a3
    • Krzysztof Gogolewski's avatar
      warnPprTrace: pass separately the reason · 23d215fc
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      This makes it more similar to pprTrace, pprPanic etc.
      23d215fc
    • sheaf's avatar
      TcPlugins: `newWanted` uses the provided `CtLoc` · 49731fed
      sheaf authored and Marge Bot's avatar Marge Bot committed
      The `GHC.Tc.Plugin.newWanted` function takes a `CtLoc` as an argument,
      but it used to discard the location information, keeping only
      the `CtOrigin`. It would then retrieve the source location from the
      `TcM` environment using `getCtLocM`.
      
      This patch changes this so that `GHC.Tc.Plugin.newWanted` passes on
      the full `CtLoc`. This means that authors of type-checking plugins
      no longer need to manually set the `CtLoc` environment in the `TcM`
      monad if they want to create a new Wanted constraint with the given
      `CtLoc` (in particular, for setting the `SrcSpan` of an emitted
      constraint). This makes the `newWanted` function consistent with
      `newGiven`, which always used the full `CtLoc` instead of using
      the environment.
      
      Fixes #20895
      49731fed
    • sheaf's avatar
      Fix parsing & printing of unboxed sums · 34d8bc24
      sheaf authored and Marge Bot's avatar Marge Bot committed
      The pretty-printing of partially applied unboxed sums was incorrect,
      as we incorrectly dropped the first half of the arguments, even
      for a partial application such as
      
        (# | #) @IntRep @DoubleRep Int#
      
      which lead to the nonsensical (# DoubleRep | Int# #).
      
      This patch also allows users to write unboxed sum type constructors
      such as
      
        (# | #) :: TYPE r1 -> TYPE r2 -> TYPE (SumRep '[r1,r2]).
      
      Fixes #20858 and #20859.
      34d8bc24
    • sheaf's avatar
      Kind TyCons: require KindSignatures, not DataKinds · addf8e54
      sheaf authored and Marge Bot's avatar Marge Bot committed
        Uses of a TyCon in a kind signature required users to enable
        DataKinds, which didn't make much sense, e.g. in
      
          type U = Type
          type MyMaybe (a :: U) = MyNothing | MyJust a
      
        Now the DataKinds error is restricted to data constructors;
        the use of kind-level type constructors is instead gated behind
        -XKindSignatures.
      
        This patch also adds a convenience pattern synonym for patching
        on both a TyCon or a TcTyCon stored in a TcTyThing, used in
        tcTyVar and tc_infer_id.
      
        fixes #20873
      addf8e54
    • Greg Steuck's avatar
      Skip T16180 on OpenBSD due to bug #14012 · c6300cb3
      Greg Steuck authored and Marge Bot's avatar Marge Bot committed
      c6300cb3
    • Greg Steuck's avatar
      Skip T18623 on OpenBSD · b65e7274
      Greg Steuck authored and Marge Bot's avatar Marge Bot committed
      The bug it regresses didn't happen on this OS (no RLIMIT_AS) and the
      regression doesn't work (ulimit: -v: unknown option)
      b65e7274
    • Ben Gamari's avatar
      rts: Only declare environ when necessary · 247cd336
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Previously we would unconditionally provide a declaration for `environ`,
      even if `<unistd.h>` already provided one. This would result in
      `-Werror` builds failing on some platforms.
      
      Also `#include <unistd.h>` to ensure that the declaration is visible.
      
      Fixes #20861.
      247cd336
    • Ben Gamari's avatar
      rts: Depend explicitly on libc · 6737c8e1
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      As noted in #19029, currently `ghc-prim` explicitly lists `libc` in
      `extra-libraries`, resulting in incorrect link ordering with the
      `extra-libraries: pthread` in `libHSrts`. Fix this by adding an explicit
      dependency on `libc` to `libHSrts`.
      
      Closes #19029.
      6737c8e1
    • Matthew Pickering's avatar
      ci: Nightly, run one head.hackage job with core-lint and one without · 759f3421
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      This fixes serious skew in the performance numbers because the packages
      were build with core-lint.
      
      Fixes #20826
      759f3421
    • Zubin's avatar
      ci: test bootstrapping and use hadrian for source dists · 85473a09
      Zubin authored and Marge Bot's avatar Marge Bot committed
      85473a09
    • Zubin's avatar
      hadrian: Fully implement source distributions (#19317) · 02cf4bc6
      Zubin authored and Marge Bot's avatar Marge Bot committed
      We use `git ls-files` to get the list of files to include in the source distribution.
      
      Also implements the `-testsuite` and `-extra-tarballs` distributions.
      02cf4bc6
    • Zubin's avatar
      hadrian: allow offline bootstrapping · a8fb4251
      Zubin authored and Marge Bot's avatar Marge Bot committed
      This patch adds the ability to fetch and store dependencies needed for
      boostrapping hadrian. By default the script will download the
      dependencies from the network but some package managers disallow network
      access so there are also options to build given a supplied tarball.
      
      The -s option allos you to provide the tarball
      
          bootstrap.py -d plan-bootstrap-8.10.5.json -w /path/to-ghc -s sources-tarball.tar.gz
      
      Which dependencies you need can be queried using the `list-sources` option.
      
          bootstrap.py list-sources -d plan-bootstrap-8.10.5.json
      
      This produces `fetch_plan.json` which tells you where to get each source from.
      
      You can instruct the script to create the tarball using the `fetch` option.
      
          bootstrap.py fetch -d plan-bootstrap-8.10.5.json -o sources-tarball.tar.gz
      
      Together these commands mean you can build GHC without needing
      cabal-install.
      
      Fixes #17103
      a8fb4251
    • Matthew Pickering's avatar
      hadrian: Add bootstrap scripts for building without cabal-install · 2b6c2179
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      These scripts are originally from the cabal-install repo with a few
      small tweaks.
      
      This utility allows you to build hadrian without cabal-install, which can be useful
      for packagers. If you are a developer then build hadrian using cabal-install.
      
      If you want to bootstrap with ghc-8.10.5 then run the ./bootstrap script with the
      `plan-bootstrap-8.10.5.json` file.
      
          bootstrap.py -d plan-bootstrap-8.10.5.json -w /path/to-ghc
      
      The result of the bootstrap script will be a hadrian binary in
      `_build/bin/hadrian`.
      
      There is a script (using nix) which can be used to generate the bootstrap plans for the range
      of supported GHC versions using nix.
      
          generate_bootstrap_plans
      
      Otherwise you can run the commands in ./generate_bootstrap_plans directly.
      
      Fixes #17103
      2b6c2179
  6. Jan 07, 2022
    • Joachim Breitner's avatar
      Remove dangling references to Note [Type-checking overloaded labels] · f583eb8e
      Joachim Breitner authored and Marge Bot's avatar Marge Bot committed
      that note was removed in 4196969c
      f583eb8e
    • Matthew Pickering's avatar
      Thoughtful forcing in CoreUnfolding · 7b783c9d
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      We noticed that the structure of CoreUnfolding could leave double the
      amount of CoreExprs which were retained in the situation where the
      template but not all the predicates were forced. This observation was
      then confirmed using ghc-debug:
      
      ```
      (["ghc:GHC.Core:App","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","THUNK_1_0"],Count 237)
      (["ghc:GHC.Core:App","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","ghc-prim:GHC.Types:True"],Count 1)
      (["ghc:GHC.Core:Case","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","THUNK_1_0"],Count 12)
      (["ghc:GHC.Core:Cast","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","BLACKHOLE"],Count 1)
      (["ghc:GHC.Core:Cast","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","THUNK_1_0"],Count 78)
      (["ghc:GHC.Core:Cast","ghc-prim:GHC.Types:True","THUNK_1_0","ghc-prim:GHC.Types:False","THUNK_1_0"],Count 1)
      (["ghc:GHC.Core:Cast","ghc-prim:GHC.Types:True","ghc-prim:GHC.Types:False","THUNK_1_0","THUNK_1_0"],Count 3)
      (["ghc:GHC.Core:Cast","ghc-prim:GHC.Types:True","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0"],Count 1)
      (["ghc:GHC.Core:Lam","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","BLACKHOLE"],Count 31)
      (["ghc:GHC.Core:Lam","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","THUNK_1_0"],Count 4307)
      (["ghc:GHC.Core:Lam","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","ghc-prim:GHC.Types:True"],Count 6)
      (["ghc:GHC.Core:Let","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","THUNK_1_0"],Count 29)
      (["ghc:GHC.Core:Lit","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","ghc-prim:GHC.Types:True"],Count 1)
      (["ghc:GHC.Core:Tick","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","THUNK_1_0"],Count 36)
      (["ghc:GHC.Core:Var","ghc-prim:GHC.Types:True","THUNK_1_0","THUNK_1_0","THUNK_1_0"],Count 1)
      (["ghc:GHC.Core:Var","ghc-prim:GHC.Types:True","ghc-prim:GHC.Types:False","THUNK_1_0","THUNK_1_0"],Count 6)
      (["ghc:GHC.Core:Var","ghc-prim:GHC.Types:True","ghc-prim:GHC.Types:False","ghc-prim:GHC.Types:True","THUNK_1_0"],Count 2)
      ```
      
      Where we can see that the first argument is forced but there are still
      thunks remaining which retain the old expr.
      
      For my test case (a very big module, peak of 3 000 000 core terms) this
      reduced peak memory usage by 1G (12G -> 11G).
      
      Fixes #20905
      7b783c9d
Loading