Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Merge ghc-head into wip/hi-haddock #1021

Merged

Conversation

harpocrates
Copy link
Collaborator

Since the .hie stuff has landed, Hi Haddock can now properly generate hyperlinked sources!

Also, since Hi Haddock is still a month or more away from merging, I went ahead and carved out the Convert changes from the Hi Haddock branch into a separate commit on ghc-head (aa9644f), so I wanted to be the person to fix those conflicts when merging ghc-head back into wip/hi-haddock. 😄

Using this branch (and arc patch D5067 for GHC), HTML + hyperlinked sources worked on the first try.

harpocrates and others added 9 commits January 10, 2019 16:42
Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe"
is marked as `not-home`. That changes around some test output.
# Summary

This is a large architectural change to the Hyperlinker.

  * extract link (and now also type) information from `.hie` instead
    of doing ad-hoc SYB traversals of the `RenamedSource`. Also
    adds a superb type-on-hover feature (haskell#715).

 * re-engineer the lexer to avoid needless string conversions. By going
    directly through GHC's `P` monad and taking bytestring slices, we
    avoid a ton of allocation and have better handling of position
    pragmas and CPP.

In terms of performance, the Haddock side of things has gotten _much_
more efficient. Unfortunately, much of this is cancelled out by the
increased GHC workload for generating `.hie` files. For the full set of
boot libs (including `ghc`-the-library)

  * the sum of total time went down by 9-10% overall
  * the sum of total allocations went down by 6-7%

# Motivation

Haddock is moving towards working entirely over `.hi` and `.hie` files.
This change means we no longer need the `RenamedSource` from
`TypecheckedModule` (something which is _not_ in `.hi` files).

# Details

Along the way a bunch of things were fixed:

 * Cross package (and other) links are now more reliable (haskell#496)
 * The lexer tries to recover from errors on every line (instead of at CPP
    boundaries)
 * `LINE`/`COLUMN` pragmas are taken into account
 * filter out zero length tokens before rendering
 * avoid recomputing the `ModuleName`-based `SrcMap`
 * remove the last use of `Documentation.Haddock.Utf8` (see  haskell#998)
 * restructure temporary folder logic for `.hi`/`.hie` model
Should help make CI be less broken
* Amend `ParserSpec` to match new Hyperlinker API
    - pass in compiler info
    - strip out null tokens

* Make `hypsrc-test` pass reliably
    - strip out `local-*` ids
    - strip out `line-*` ids from the `ClangCppBug` test
    - re-accept output
The circumstances under which this module appeared are completely gone.
The Hyperlinker backend no longer needs this module (it uses the more
efficient `Encoding` module from `ghc`).

Why no deprecation? Because this module really shouldn't exist!

  - It isn't used in `haddock-library`/`haddock-api` anymore
  - It was copy pasted directly from `utf8-string`
  - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding`
@harpocrates harpocrates requested a review from sjakobi February 4, 2019 15:09
@harpocrates harpocrates merged commit 1ad8a10 into haskell:wip/hi-haddock Mar 8, 2019
@harpocrates harpocrates deleted the merged-convert-fixes branch March 8, 2019 15:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants