1. 11 Dec, 2018 3 commits
  2. 10 Dec, 2018 1 commit
  3. 08 Dec, 2018 20 commits
    • Ben Gamari's avatar
      hadrian: Drop nix build script · c00d2f59
      Ben Gamari authored
      It's currently too out-of-date to build current hadrian and is arguably
      completely broken anyways (see #15794).
      c00d2f59
    • Ben Gamari's avatar
      testsuite: 32-bit expected output for T15460 · f5bff4bc
      Ben Gamari authored
      f5bff4bc
    • Ben Gamari's avatar
      rts: Ensure that task->id is initialized · 64ef4d7f
      Ben Gamari authored
      Reviewers: erikd, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5325
      64ef4d7f
    • Simon Marlow's avatar
      Use --no-as-needed with LLD too · aa619f39
      Simon Marlow authored
      Test Plan: validate using LLD as the linker (TODO)
      
      Reviewers: bgamari, angerman, kavon, erikd
      
      Reviewed By: bgamari
      
      Subscribers: watashi, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5336
      aa619f39
    • Matthew Pickering's avatar
      Add -fno-safe-haskell flag · 45e98f64
      Matthew Pickering authored
      This flag can be set to turn off the Safe Haskell checks.
      
      Whether a module is marked Safe/Unsafe/Trustworthy is ignored when
      this flag to set.
      
      Reviewers: bgamari, tdammers
      
      Reviewed By: tdammers
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15920
      
      Differential Revision: https://phabricator.haskell.org/D5360
      45e98f64
    • Ömer Sinan Ağacan's avatar
      Fix StgLint bound id check, generalize StgLint · 04caa935
      Ömer Sinan Ağacan authored
      StgLint was incorrectly using isLocalId for bound id check to see
      whether an id is imported (in which case we don't expect it to be bound)
      or local.  The problem with isLocalId is that its semantics changes
      after Core, as explained in the note: (last line)
      
          Note [GlobalId/LocalId]
          ~~~~~~~~~~~~~~~~~~~~~~~
          A GlobalId is
            * always a constant (top-level)
            * imported, or data constructor, or primop, or record selector
            * has a Unique that is globally unique across the whole
              GHC invocation (a single invocation may compile multiple
              modules)
            * never treated as a candidate by the free-variable finder;
                  it's a constant!
      
          A LocalId is
            * bound within an expression (lambda, case, local let(rec))
            * or defined at top level in the module being compiled
            * always treated as a candidate by the free-variable finder
      
          After CoreTidy, top-level LocalIds are turned into GlobalIds
      
      We now pass current module as a parameter to StgLint, which uses it to
      see if an id should be bound (defined in the current module) or not
      (imported).
      
      Other changes:
      
      - Generalized StgLint to make it work on both StgTopBinding and
        CgStgTopBinding.
      - Bring all top-level binders into scope before linting top-level
        bindings to allow uses before definitions.
      
      TODO: We should remove the binder from local vars when checking RHSs of
      non-recursive bindings.
      
      Test Plan: This validates.
      
      Reviewers: simonpj, bgamari, sgraf
      
      Reviewed By: simonpj, sgraf
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5370
      04caa935
    • Roland Senn's avatar
      Fix #15369: GHCi doesn't honor :set +c when loading for a second time · 57c9b1ae
      Roland Senn authored
      The decision to (re)collect the type info for a (re)loaded module is
      now taken only by comparing the file timestamps of the .hs file of the
      module. (Or form the .o file if the .hs file is missing).
      If the file timestamp changes, we (re)collect the type info.
      The timestamp of the processing time of the last collect is no longer
      used.
      
      Test Plan: make test TEST=T15369
      
      Reviewers: alanz, hvr, monoidal, osa1, thomie, bgamari, tdammers
      
      Reviewed By: tdammers
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15369
      
      Differential Revision: https://phabricator.haskell.org/D5376
      57c9b1ae
    • Andreas Klebinger's avatar
      Add haddock for Node in Digraph. [skip ci] · c5ced679
      Andreas Klebinger authored
      Test Plan: make
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5378
      c5ced679
    • Zejun Wu's avatar
      Remove redundant include of Rts.h in EventLogWriter.h · a24ab444
      Zejun Wu authored
      `EventLogWriter.h` doesn't use anything from `Rts.h`, the include is
      redundant. This include is ignored when we include
      
      ```
      Rts.h -> RtsAPI.h -> rts/EventLogWriter.h -> Rts.h
      ```
      
      but can can cause problem when we include `RtsApi.h` directly with
      errors like
      
      ```
      In file included from /usr/lib/ghc-8.6.2/include/RtsAPI.h:20:
      In file included from
      /usr/lib/ghc-8.6.2/include/rts/EventLogWriter.h:14:
      In file included from /usr/lib/ghc-8.6.2/include/Rts.h:185:
      /usr/lib/ghc-8.6.2/include/rts/storage/GC.h:187:29: error: unknown type
      name 'Capability'
      StgPtr  allocate          ( Capability *cap, W_ n );
      ```
      
      Test Plan: ./validate
      
      Reviewers: simonmar, bgamari, afarmer, erikd, alexbiehl
      
      Reviewed By: bgamari, alexbiehl
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5395
      a24ab444
    • Ömer Sinan Ağacan's avatar
      Rename "changed" to "no-change" in HscMain · f2bad7e1
      Ömer Sinan Ağacan authored
      hscSimpleIface is returning a bool for whether there were _no changes_
      in the iface file. The same bool is called "no_change_at_all" in
      mkIface_, and "no_change" in hscWriteIface and other functions. However
      it is called "changed" in HscMain.finish and hscMaybeWriteIface, which
      is confusing because "changed" and "no_change" have opposite meanings.
      This patch renames "changed" to "no_change" to fix this.
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5416
      f2bad7e1
    • Alp Mestanogullari's avatar
      Hadrian: fix dynamicGhcPrograms value for the quickest flavour · 7d96d281
      Alp Mestanogullari authored
      Quickest does not build anything in a dynamic way, so that
      flavour should default to not building "ghc programs" dynamically.
      
      I ran into this problem by building the 'docs' target with quickest,
      which failed because at some point we run a haddock command in a
      context whose Way is sensitive to dynamicGhcPrograms, and it
      started looking for dyn interface files when it shouldn't have.
      
      Test Plan: hadrian/build.sh --flavour=quickest docs
      
      Reviewers: snowleopard, bgamari
      
      Reviewed By: snowleopard
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5419
      7d96d281
    • Ömer Sinan Ağacan's avatar
      Mark SRT_1/SRT_2 as CONSTR_1_0/CONSTR_2_0 · 38edeea9
      Ömer Sinan Ağacan authored
      Test Plan:
      Validated locally, but skipped perf tests as there's a
      framework-related error
      there.
      
      Reviewers: simonmar, bgamari, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5421
      38edeea9
    • Alp Mestanogullari's avatar
      hadrian: eliminate most of the remaining big rule enumerations · 665f8b0c
      Alp Mestanogullari authored
      Following what was done to Rules.Library some time ago and to
      Rules.Compile recently (D5412), this patch moves more rules away from
      the "enumerate a lot of contexts and generate one rule for each" style
      and instead uses the "parse data from file path to recover context"
      approach. In fact, the only rules left to convert seem to be the ones
      from Rules.Generate.
      
      This effectively decreases the pauses described in #15938 further as
      well as the amount of allocations and GC that we do, unsurprisingly.
      Nowhere as drastically as D5412, though.
      
      Test Plan: perform full build and generate docs
      
      Reviewers: snowleopard, bgamari
      
      Reviewed By: snowleopard
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15938
      
      Differential Revision: https://phabricator.haskell.org/D5422
      665f8b0c
    • Alec Theriault's avatar
      Require 'libdw' for '--enable-dwarf-unwind' · cb882fc9
      Alec Theriault authored
      This causes './configure --enable-dwarf-unwind' to exit with a helpful
      error message when 'libdw' cannot be found (compared to the previous
      behaviour of silently pretending the user hadn't requested DWARF support
      at all).
      
      Test Plan: ./configure --enable-dwarf-unwind # on systems with/without
      libdw
      
      Reviewers: bgamari, nh2
      
      Reviewed By: nh2
      
      Subscribers: nh2, rwbarton, erikd, carter
      
      GHC Trac Issues: #15968
      
      Differential Revision: https://phabricator.haskell.org/D5424
      cb882fc9
    • Peter Trommler's avatar
      Mark broken tests on powerpc64le and skip ghci-ext · bd808316
      Peter Trommler authored
      Mark tests with DWARF as broken
      Test way `ghci-ext` only where available
      
      Test Plan: validate
      
      Reviewers: bgamari, hvr, simonmar, erikd, Phyx
      
      Reviewed By: bgamari, Phyx
      
      Subscribers: Phyx, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5297
      bd808316
    • Ben Gamari's avatar
      testsuite: Fix tests expecting 64-bit word size · e1a98fab
      Ben Gamari authored
      These were added in 75a8349b.
      e1a98fab
    • Adam Sandberg Eriksson's avatar
      856dd66f
    • abc's avatar
      Fixed plugin example to work · 3de019cb
      abc authored
      3de019cb
    • Simon Jakobi's avatar
      Fix typo in Foldable docs · eb7ba36b
      Simon Jakobi authored
      eb7ba36b
    • Sven Tennie's avatar
      Add some complexities to Data.List documentation (#15003) · 07e02d57
      Sven Tennie authored
      Namely for:
      - head
      - uncons
      - tail
      - last
      - init
      - null
      07e02d57
  4. 07 Dec, 2018 6 commits
    • Ben Gamari's avatar
      CircleCI: Don't ignore gitlab/.* branches · c77fbd94
      Ben Gamari authored
      This was added (for good reasons) in b9260e92
      but it seems this field isn't allowed in this context. Sadly there doesn't
      appear to be an easy way to accomplish what we are after with CircleCI's rather
      restrictive configuration language. Sigh.
      c77fbd94
    • Ben Gamari's avatar
      testsuite: Fix use of stats_num_field · a6b4da8c
      Ben Gamari authored
      This is now collect_stats.
      a6b4da8c
    • Ryan Scott's avatar
      Fix #12102/#15872 by removing outdated users' guide prose · 73cce63f
      Ryan Scott authored
      Summary:
      In the beginning, #12102 (and #15872, which is of a similar
      ilk) were caused by a poor, confused user trying to use code that
      looks like this (with a constraint in the kind of a data type):
      
      ```lang=haskell
      type family IsTypeLit a where
        IsTypeLit Nat    = 'True
        IsTypeLit Symbol = 'True
        IsTypeLit a      = 'False
      
      data T :: forall a. (IsTypeLit a ~ 'True) => a -> * where
        MkNat    :: T 42
        MkSymbol :: T "Don't panic!"
      ```
      
      Many bizarre GHC quirks (documented in those tickets) arose from
      this sort of construction. Ultimately, the use of constraints in
      data type kinds like this has made a lot of people very confused and
      been widely regarded as a bad move.
      
      Commit 2257a86d finally put this
      feature out of its misery, so now the code above simply errors with
      `Illegal constraint in a kind`. As a result, the aforementioned
      tickets are moot, so this patch wraps a bow on the whole thing by:
      
      1. Removing the (now outdated) section on constraints in data type
         kinds from the users' guide, and
      2. Adding a test case to test this code path.
      
      Test Plan: make test TEST=T12102
      
      Reviewers: goldfire, simonpj, bgamari, tdammers
      
      Reviewed By: tdammers
      
      Subscribers: tdammers, rwbarton, carter
      
      GHC Trac Issues: #12102, #15872
      
      Differential Revision: https://phabricator.haskell.org/D5397
      73cce63f
    • Simon Peyton Jones's avatar
      Careful tweaking to exprOkForSpeculation · f334d20e
      Simon Peyton Jones authored
      This patch does several things:
      
      * Make exprOkForSpeculation ignore evaluatedness of variables
        See the Note [exprOkForSpeculation and evaluated variables]
        This means that the binder-swap transformation no longer
        invaliates the let/app invariant.
      
      * Make exprOkForSpeculation return False for
           DataToTagOp and SeqOp.
        See Note [exprOkForSpeculation and SeqOp/DataToTagOp]
      
      * Remove the 'can_fail' property from dataToTag#; it was
        always a hack (described in the old Note [dataToTag#] in
        primops.txt.pp), and now its not necessary because of the
        fixes above.
      
      * Make SetLevels use exprIsHNF, /not/ exprOkForSpeculation,
        when floating single-alternative cases.  See SetLevels
        Note [Floating single-alternative cases]
      
      * Fix a buglet in FloatIn; probably never bites in practice
        See Note [Dead bindings]
      
      Collectively, these changes finally fix Trac #15696.
      f334d20e
    • Simon Peyton Jones's avatar
      Wibble to Taming the Kind Inference Monster · 5b7ca039
      Simon Peyton Jones authored
      I had allowed rename/should_fail/T15828 (Trac #15828) to regress a bit.
      The main payload of this patch is to fix that problem, at the cost of
      more contortions in checkConsistentFamInst.  Oh well, at least they are
      highly localised.
      
      I also update the -ddump-types code in TcRnDriver to print out some
      more expicit information about each type constructor, thus instead of
      
         DF{3} :: forall k. * -> k -> *
      
      we get
      
         data family DF{3} :: forall k. * -> k -> *
      
      Remember, this is debug-printing only.  This change is the reason
      that so many .stderr files change.
      5b7ca039
    • Alp Mestanogullari's avatar
      hadrian: optimise Rules.Compile · eee1b61f
      Alp Mestanogullari authored
      Previously, as reported in #15938, resuming a build "in the middle",
      e.g when building _build/stage1/libraries/base/, hadrian would take up
      to a whole minute to get started doing actual work, building code.
      
      This was mostly due to a big enumeration that we do in Rules.hs, to
      generate all the possible patterns for object files for 1) all ways, 2)
      all packages and 3) all stages. Since rule enumeration is always
      performed, whatever the target, we were always paying this cost, which
      seemed to grow bigger the farther in the build we stopped and were
      resuming from.
      
      Instead, this patch borrows the approach that we took for Rules.Library
      in https://github.com/snowleopard/hadrian/pull/571, which exposes all the
      relevant object files under as few catch-all rules as possible (8 here),
      and parses all the information we need out of the object's path.
      
      The concrete effect of this patch that I have observed is to reduce the
      45-60 seconds pause to <5 seconds. Along with the Shake performance
      improvements that Neil mentions in #15938, most of the pause should
      effectively disappear.
      
      Reviewers: snowleopard, bgamari, goldfire
      
      Reviewed By: snowleopard
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15938
      
      Differential Revision: https://phabricator.haskell.org/D5412
      eee1b61f
  5. 06 Dec, 2018 5 commits
    • Tobias Decking's avatar
      Add fusion rules for the zipWith functions in base (#15263) · fb669f51
      Tobias Decking authored
      This patch will allow `zip3` and `zipWith3` in `GHC.List` as well
      as `zipWith4`, `zipWith5`, `zipWith6` and `zipWith7` in `Data.OldList` to fuse.
      
      These rules are kept in a similar style as the rules for `zip` and `zipWith`.
      
      Added a corresponding test case.
      
      Test Plan: validate
      
      Reviewers: hvr, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rockbmb, rwbarton, carter
      
      GHC Trac Issues: #15263
      
      Differential Revision: https://phabricator.haskell.org/D5241
      fb669f51
    • Ben Gamari's avatar
      Windows: Use the "big" PE object format on amd64 · 1ef90f99
      Ben Gamari authored
      Test Plan: Do full build on Windows.
      
      Reviewers: AndreasK, Phyx
      
      Reviewed By: AndreasK
      
      Subscribers: rwbarton, erikd, carter
      
      GHC Trac Issues: #15934
      
      Differential Revision: https://phabricator.haskell.org/D5383
      1ef90f99
    • Sebastian Graf's avatar
      Don't use a generic apply thunk for known calls · dc54c07c
      Sebastian Graf authored
      Summary:
      Currently, an AP thunk like `sat = f a b c` will not have its own entry
      point and info pointer and will instead reuse a generic apply thunk
      like `stg_ap_4_upd`.
      
      That's great from a code size perspective, but if `f` is a known
      function, a specialised entry point with a plain call can be much faster
      than figuring out the arity and doing dynamic dispatch.
      
      This looks at `f`s arity to figure out if it is a known function and if so, it
      will not lower it to a generic apply function.
      
      Benchmark results are encouraging: No changes to allocation, but 0.2% less
      counted instructions.
      
      Test Plan: Validates locally
      
      Reviewers: simonmar, osa1, simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #16005
      
      Differential Revision: https://phabricator.haskell.org/D5414
      dc54c07c
    • Simon Peyton Jones's avatar
      Remove a tcTrace · 081f44bf
      Simon Peyton Jones authored
      This tcTrace, in tcTyFamInstEqn, caused a knot-tying loop, because
      it was printing a type after zonking-to-Type.  Easy solution: don't
      do that.
      081f44bf
    • Simon Peyton Jones's avatar
      Tests Trac #14847 · 91c4e71f
      Simon Peyton Jones authored
      91c4e71f
  6. 05 Dec, 2018 2 commits
    • Alexander Vershilov's avatar
      Remove explicit recursion in retainer profiling (fixes #14758) · 5f1d949a
      Alexander Vershilov authored
      Retainer profiling contained a recursion that under
      certain circumstances could lead to the stack overflow
      in C code.
      
      The idea of the improvement is to keep an explicit stack for the
      object, more precise to reuse existing stack, but allow new type of
      objects to be stored there.
      
      There is no reliable reproducer that is not a big program
      but in some cases foldr (+) 0 [1..10000000] can work.
      
      Reviewers: bgamari, simonmar, erikd, osa1
      
      Reviewed By: bgamari, osa1
      
      Subscribers: osa1, rwbarton, carter
      
      GHC Trac Issues: #14758
      
      Differential Revision: https://phabricator.haskell.org/D5351
      5f1d949a
    • Simon Peyton Jones's avatar
      Remove duplicates in -ddump-minimial-imports · 84cba4bc
      Simon Peyton Jones authored
      This fixes Trac #15994.
      
      Previously RdrName.gresToAvailInfo assumed that the input list
      of GREs had no duplicates. I accidentally broke this precondition
      in this refactoring:
      
          commit 6353efc7
          Date:   Thu Nov 22 14:48:05 2018 -0500
      
          Fix unused-import warnings
      
          This patch fixes a fairly long-standing bug (dating back to 2015) in
          RdrName.bestImport, namely
      
      (There was an ASSERT, but it's usually switched off in stage2.  It
      tripped when I switched stage2 assertions on.)
      
      The fix is straightforward: account for dups in gresToAvailInfo.
      84cba4bc
  7. 04 Dec, 2018 3 commits
    • Tamar Christina's avatar
      linker: store entire link map and use it. · a8b7cef4
      Tamar Christina authored
      Summary:
      This fixes a corner case in which we have seen the symbol multiple times in
      different static libraries, but due to a depencency we end up loading the
      symbol from a library other than the first one.
      
      Previously the runtime linker would only track symbols from the first
      library and did not store the full link map.  In this case it was unable
      to find the address for the symbols in the second library during delay
      loading.
      
      This change stores the address of all symbols seen so a full link map
      is generated, such that when we make a different decision later than what
      was expected we're able to still correctly load the library.
      
      Test Plan: ./validate, new testcase T15894
      
      Reviewers: angerman, bgamari, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15894
      
      Differential Revision: https://phabricator.haskell.org/D5353
      a8b7cef4
    • Alec Theriault's avatar
      Hadrian: include 'findPtr' via find-ptr cabal flag · 924026e0
      Alec Theriault authored
      Summary:
      This is the latest in the 'findPtr' saga. See
      
        * 900c47f8
        * 561748cb
      
      for the previous attempts. The problem with re-using the 'debug'
      cabal flag for the purpose of forcing inclusion of 'findPtr' occurs
      when 'debug' is one of the RTS ways, but RTS is not being compiled
      with '-DDEBUG':
      
        * the 'debug' flag gets passed to cabal, signalling to build
          'rts' with the debug flavour, but also forcing inclusion of
          the 'findPtr'/'_findPtr' symbol
      
        * since '-DDEBUG' isn't enabled, that symbol doesn't show up in
          the libraries, so executable that depend on 'rts' (everything)
          will end up always requiring 'findPtr'/'_findPtr' but 'rts' won'y
          provide it!
      
      The fix is simple: create a a new 'find-ptr' cabal-flag whose only
      purpose is forcing '-Wl,-u,findPtr'/'-Wl,-u,_findPtr'. Then, enable that
      flag when the RTS is being compiled with '-DDEBUG'
      
      Test Plan: ./hadrian/build.sh -c # on mac
      
      Reviewers: alpmestan, snowleopard, bgamari, erikd, simonmar, Phyx
      
      Reviewed By: alpmestan, snowleopard, Phyx
      
      Subscribers: Phyx, rwbarton, carter
      
      GHC Trac Issues: #15956
      
      Differential Revision: https://phabricator.haskell.org/D5404
      924026e0
    • Roland Senn's avatar
      Improve test T14452 for Windows · 6090002e
      Roland Senn authored
      Summary: Under Windows all parameters to gcc are enclosed in quotes, opposite to
      Linux, where the quotes are missing. Therefore in the test, we remove all
      quotes in the stdout file with sed.
      
      Test Plan: make test TEST=T14452
      
      Reviewers: osa1, hvr, bgamari, monoidal, Phyx, simonpj
      
      Reviewed By: Phyx
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #14452
      
      Differential Revision: https://phabricator.haskell.org/D5398
      6090002e