4

Following up from How to exclude dependencies when building haddocks? I'm stuck in the following loop:

  1. Run the following command: stack haddock --no-haddock-deps webservice
  2. Wait for the webservice library to be built
  3. Haddock then starts processing from the very first source file
  4. Haddock fails on some trivial parse error related to comments
  5. Fix such parse errors
  6. Go to step 1

Is there any way to get stack/haddock to start from where it errored out, without going through steps (2) and (3) above?

Saurabh Nanda
  • 6,373
  • 5
  • 31
  • 60
  • Does stack not cache `webservice` in this case? It certainly does if you just once `stack build` the project, doesn't it? If not, then this sounds like one more reason to use `cabal` instead during development. I say this often... `stack` is a great _release tool_, but IMO less than optimal for development. – leftaroundabout Jul 26 '18 at 07:21
  • 1
    if you're writing haddocks for a module deep within the module hierarchy, it change the source file, which triggers recompilation of a lot of files. – Saurabh Nanda Jul 26 '18 at 07:59
  • Yeah but surely not files _from another library_? – leftaroundabout Jul 26 '18 at 08:02
  • I think that you can get the comment parse errors a bit earlier if you add `-haddock` to your ghc options. To shorten the build time you can try `-fno-code`. – sjakobi Jul 27 '18 at 08:55
  • 1
    `-fno-code` doesn't really work. It "builds" the entire project, but aborts with the following before haddocks can be built - `Warning: the following files would be used as linker inputs, but linking is not being done:` – Saurabh Nanda Jul 27 '18 at 16:39
  • @SaurabhNanda: You may be interested in the ongoing [Hi Haddock GSoC project](https://summerofcode.withgoogle.com/organizations/5706672807346176/#4975710121230336). If all goes well, haddock generation will soon no longer require rebuilding the library. – sjakobi Jul 27 '18 at 18:17
  • Not strictly what I think your after, but may still be helpful to you: use stacks `--file-watch` to ease your suffering somewhat. – fredefox Jul 27 '18 at 19:26

0 Answers0