1. 16 Oct, 2019 4 commits
    • John Ericson's avatar
      Merge remote-tracking branches... · d9fc3017
      John Ericson authored
      Merge remote-tracking branches 'obsidian-gitlab/skip-associated-type-defaults-in-sig-8.6' and 'obsidian-gitlab/backport-absolute-submodule-url-8.6' into miri-backpack-8.6/0
      d9fc3017
    • Artem Pelenitsyn's avatar
      Make all submodules have absolute URLs · 4bb9f33d
      Artem Pelenitsyn authored
      The relative URLs were a workaround to let most contributors fork from
      Github due to a weakness in the haskell.org server.
      
      This workaround is no longer needed. And relative submodule URLs are
      an impediment to forking which makes contributions harder than they
      should be.
      
      The URLs are chosen to clone from https, because this makes sure that
      anybody, even not a registered Gitlab user, can clone a fork
      recursively.
      
      (cherry picked from commit a76b233d)
      4bb9f33d
    • John Ericson's avatar
      Skip type family defaults with hs-boot and hsig files · e8ca51c7
      John Ericson authored
      Works around #17190, possible resolution for #17224
      
      Instances in signatures currently unconditionally opt into associated
      family defaults if no explicit instance is given. This is bad for two
      reasons:
      
        1. It constrains possible instantiations to use the default, rather
        than possibly define the associated family differently.
      
        2. It breaks compilation as type families are unsupported in
        signatures.
      
      This PR simply turns off the filling in of defaults in those cases.
      Additionally, it squelches a missing definition warning for hs-boot too
      that was only squelched for hsig before.
      
      The downsides are:
      
        1. There is no way to opt into the default, other than coppying its
        definition.
      
        2. If we fixed type classes in signatures, and wanted instances to
        have to explicitly *out of* rather than into the default, that would
        now be a breaking change.
      
      Neither opt-in or opt-out is very appealing. Perhaps the right answer is
      "just use deriving via"! Default methods are once again being more
      combersome and requiring more syntax (c.f. default signatures), and yet
      are still less powerful.
      
      The only part of this patch I am sure is a good iea is harmonizing the
      warning squelching between hs-boot or hsig. Maybe they should have the
      warning (opt out of default) maybe they shouldn't (opt in to default),
      but surely it should be the same for both.
      
      (cherry picked from commit cf4de90e)
      e8ca51c7
    • John Ericson's avatar
      Add `module {-# SOURCE #-} Foo` syntax for hs-boot in bkp · cf32c4bf
      John Ericson authored
      This is a good convenience for testing.
      
      (cherry picked from commit 67bf734c)
      cf32c4bf
  2. 15 Oct, 2019 6 commits
    • John Ericson's avatar
      WIP: Put hole instantiation typechecking in the module graph · c56de4b8
      John Ericson authored
      Backpack instantiations need to be typechecked to make sure that the
      arguments fit the parameters. `tcRnInstantiateSignature` checks
      instantiations with concrete modules, while `tcRnCheckUnitId` checks
      instantiations with free holes (signatures in the current modules).
      
      Before this change, it worked that `tcRnInstantiateSignature` was called
      after typechecking the argument module, see `HscMain.hsc_typecheck`,
      while `tcRnCheckUnitId` was called in `unsweep'` where-bound in
      `GhcMake.upsweep`. `tcRnCheckUnitId` was called once per each
      instantiation once all the argument sigs were processed. This was done
      with simple "to do" and "already done" accumulators in the fold.
      `parUpsweep` did not implement the change.
      
      With this change, `tcRnCheckUnitId` instead is associated with its own
      node in the `ModuleGraph`. Nodes are now:
      ```haskell
      data WorkGraphNode
        = InstantiationNode IndefUnitId
        | ModuleNode ModSummary
      ```
      instead of just `ModSummary`; the `InstantiationNode` case is the
      instantiation of a unit to be checked. The dependencies of such nodes
      are the same free holes as was checked with the accumulator before. Both
      upsweeps on such a node call `tcRnCheckUnitId`.
      
      The instantiation nodes are not depended on by other nodes; `tcRnCheckUnitId` is
      just being called for errors. I do take this as evidence for the argument that
      perhaps my patch is over-engineered; one could also just leave the graph as-is
      and post upsweep `tcRnCheckUnitId` all unit-ids unconditionally. Now, if there
      is extra `-j` sooner one can get the errors quicker than that with mine, but
      without the dependencies into the merged node (mimicking the eagerness of the
      fold of the sequential upsweep) this isn't guaranteed to happen.
      
      I admit I went with the current approach before I realized that nothing
      else depended on the effects for `tcRnCheckUnitId`, but I still think
      it is the right one with future changes in mind. For this, I refer to
      "Note [Identity versus semantic module]". The current reasoning appeals
      to the compilation pipeline invariants, but if we get multi package
      support [proposal 23], we could have all three of the original
      signature, argument, and instiation in home packages. I think having
      separate dependency nodes for each of those 3 might yield more
      incrementality and/or parallelism, especially if nodes became per
      pipeline stage.
      
      Fixes #17188
      
      Things yet to do:
      
      * [ ]  There are extra numbered steps that don't print out, probably should have some `[m of n] checking instantiation ...`
      
      * [ ]  Errors are rendered slightly differently for some reason
      
      [proposal 23]: https://github.com/ghc-proposals/ghc-proposals/pull/263
      c56de4b8
    • John Ericson's avatar
      For -fkeep-failed do not duplicate dependency edge code · 5e6a0c7d
      John Ericson authored
      We now compute the deps for -fkeep-failed the same way that the original
      graph calculates them, so the edges are correct. Upsweep really ought to
      take the graph rather than a topological sort so we are never
      recalculating anything, but at least things are done consistently now.
      5e6a0c7d
    • John Ericson's avatar
      Switch from HscSource to IsBootInterface for module lookup in GhcMake · 9a705e9a
      John Ericson authored
      We look up modules by their name, and not their contents. There is no
      way to separately reference a signature vs regular module; you get what
      you get. Only boot files can be referenced indepenently with `import {-#
      SOURCE #-}`.
      9a705e9a
    • John Ericson's avatar
      Clean up boot vs non-boot disambiguating types · ebe8c2ec
      John Ericson authored
      We often have (ModuleName, Bool) or (Module, Bool) pairs for "extended"
      module names (without or with a unit id) disambiguating boot and normal
      modules. I think this is important enough across the compiler that it
      deserves a new nominal product type.
      
      With that written, I think the IsBool enum type in GhcMake is overkill;
      just use the same product. I first tried to use both the custom product
      and enum everywhere---against my judgement but in order to make sure we
      never regressed in inference or boolean blindness---but the refactor was
      annoying so I so switched tacks.
      ebe8c2ec
    • John Ericson's avatar
      Switch order on GhcMake.IsBoot · 6b528efa
      John Ericson authored
      In the next commit I replace it with a boolean (and make it stored in a
      named product type). This one test failed, which scared me greatly, but
      then I realized it was just a matter of the Ord instance being
      different. Doing this as a separate step so as to demonstrate that the
      refactor itself changes no behavior.
      6b528efa
    • Vladislav Zavialov's avatar
      Fix optSemi type in Parser.y · 35df2ef0
      Vladislav Zavialov authored
      The definition of 'optSemi' claimed it had type
      
      ([Located a],Bool)
      
      Note that its production actually returns ([Located Token],Bool):
      
        : ';' { ([$1],True) }   -- $1 :: Located Token
      
      Due to an infelicity in the implementation of 'happy -c', it effectively
      resulted in 'unsafeCoerce :: Token -> a'.
      See https://github.com/simonmar/happy/pull/134
      
      If any consumer of 'optSemi' tried to instantiate 'a' to something not
      representationally equal to 'Token', they would experience a segfault.
      
      In addition to that, this definition made it impossible to compile Parser.y
      without the -c flag (as it's reliant on this bug to cast 'Token' to 'forall
      a. a').
      
      (cherry picked from commit 071bef18)
      35df2ef0
  3. 23 Apr, 2019 1 commit
  4. 21 Apr, 2019 1 commit
  5. 19 Apr, 2019 4 commits
  6. 08 Apr, 2019 1 commit
  7. 07 Apr, 2019 2 commits
  8. 06 Apr, 2019 2 commits
  9. 04 Apr, 2019 3 commits
  10. 29 Mar, 2019 2 commits
  11. 21 Mar, 2019 1 commit
  12. 19 Mar, 2019 1 commit
  13. 05 Mar, 2019 1 commit
  14. 04 Mar, 2019 1 commit
  15. 02 Mar, 2019 3 commits
  16. 20 Feb, 2019 2 commits
    • Herbert Valerio Riedel's avatar
      Fix regression incorrectly advertising TH support · bdc9680c
      Herbert Valerio Riedel authored
      `--supported-languages` must only advertise language extensions
      which are supported by the compiler in order for tooling such
      as Cabal relying on this signalling not to behave incorrectly.
      
      Fixes #16331
      
      (cherry picked from commit db4372cda7f6c87e7ad26efe3fca4b3f7f527a48)
      bdc9680c
    • Ömer Sinan Ağacan's avatar
      Fix two bugs in stg_ap_0_fast in profiling runtime · a481b199
      Ömer Sinan Ağacan authored
      This includes two bug fixes in profiling version of stg_ap_0_fast:
      
      - PAPs allocated by stg_ap_0_fast are now correctly tagged. This
        invariant is checked in Sanity.c:checkPAP.
      
        (This was originally implemented in 2693eb11, later reverted with
        ab55b4dd because it revealed the bug below, but it wasn't clear at
        the time whether the bug was the one below or something in the commit)
      
      - The local variable `untaggedfun` is now marked as a pointer so it
        survives GC.
      
      With this we finally fix all known bugs caught in #15508. `concprog001`
      now works reliably with prof+threaded and prof runtimes (with and
      without -debug).
      
      (cherry picked from commit 908b4b86)
      a481b199
  17. 12 Feb, 2019 1 commit
  18. 11 Feb, 2019 3 commits
    • Tamar Christina's avatar
      Stack: fix name mangling. · 0f253b89
      Tamar Christina authored
      (cherry picked from commit fb031b9b)
      0f253b89
    • Ben Gamari's avatar
      GhcPlugins: Fix lookup of TH names · 5abfd982
      Ben Gamari authored
      Previously `thNameToGhcName` was calling `lookupOrigNameCache` directly, which
      failed to handle the case that the name wasn't already in the name cache. This
      happens, for instance, when the name was in scope in a plugin being used during
      compilation but not in scope in the module being compiled. In this case we the
      interface file containing the name won't be loaded and `lookupOrigNameCache`
      fails. This was the cause of #16104.
      
      The solution is simple: use the nicely packaged `lookupOrigIO` instead.
      
      (cherry picked from commit 0d9f105b)
      5abfd982
    • Ben Gamari's avatar
      testsuite: Add test for #16104 · 8c2dbc16
      Ben Gamari authored
      8c2dbc16
  19. 09 Feb, 2019 1 commit