Skip to content
  • Teo Camarasu's avatar
    Make template-haskell a stage1 package · 42bd0407
    Teo Camarasu authored and Marge Bot's avatar Marge Bot committed
    Promoting template-haskell from a stage0 to a stage1 package means that
    we can much more easily refactor template-haskell.
    
    We implement this by duplicating the in-tree `template-haskell`.
    A new `template-haskell-next` library is autogenerated to mirror `template-haskell`
    `stage1:ghc` to depend on the new interface of the library including the
    `Binary` instances without adding an explicit dependency on `template-haskell`.
    
    This is controlled by the `bootstrap-th` cabal flag
    
    When building `template-haskell` modules as part of this vendoring we do
    not have access to quote syntax, so we cannot use variable quote
    notation (`'Just`). So we either replace these with hand-written `Name`s
    or hide the code behind CPP.
    
    We can remove the `th_hack` from hadrian, which was required when
    building stage0 packages using the in-tree `template-haskell` library.
    
    For more details see Note [Bootstrapping Template Haskell].
    
    Resolves #23536
    
    
    
    Co-Authored-By: default avatarSebastian Graf <sgraf1337@gm...>
    42bd0407