Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haddock-project command #8162

Merged
merged 19 commits into from
Jun 13, 2022
Merged

haddock-project command #8162

merged 19 commits into from
Jun 13, 2022

Conversation

coot
Copy link
Collaborator

@coot coot commented May 24, 2022

Fixes #7669, also fixes --with-haddock support which is useful when testing a newer version of haddock than the one distributed with ghc.


Please include the following checklist in your PR:

Please also shortly describe how you tested your change. Bonus points for added tests!

@coot
Copy link
Collaborator Author

coot commented May 24, 2022

This PR can be reviewed patch by patch. Currently it's missing:

  • hoogle support
  • hiding modules from dependencies in the main page; and
  • support quickjump for installed packages
  • test how it integrates with:
--haddock-html-location 'https://hackage.haskell.org/package/$pkg-$version/docs'

@coot coot force-pushed the coot/haddocks branch 2 times, most recently from 8b1239e to c3668b9 Compare May 25, 2022 07:08
@Kleidukos Kleidukos self-requested a review May 25, 2022 18:52
@coot coot force-pushed the coot/haddocks branch from c3668b9 to 024d9fe Compare May 28, 2022 05:53
@coot coot force-pushed the coot/haddocks branch from 024d9fe to 6e90609 Compare May 29, 2022 06:54
@coot coot marked this pull request as ready for review May 29, 2022 06:55
@coot coot force-pushed the coot/haddocks branch 3 times, most recently from 6bacfe5 to fce52ba Compare May 30, 2022 06:51
@Mikolaj
Copy link
Member

Mikolaj commented May 30, 2022

I think it's the same Validate / Validate windows-latest ghc-8.0.2 (pull_request) job failing non-deterministically in may PRs (though the log details differ from time to time). Let's keep track and disable it if it repeats. For now, let me restart the failing jobs.

Edit: no, actually last time it was Validate windows-latest ghc-8.6.5 that failed.

@Mikolaj Mikolaj self-requested a review May 30, 2022 17:27
@Mikolaj
Copy link
Member

Mikolaj commented May 30, 2022

This time the error at least seems related to haddock...

@coot coot force-pushed the coot/haddocks branch 2 times, most recently from 46e33c6 to ee40652 Compare June 4, 2022 10:07
@coot
Copy link
Collaborator Author

coot commented Jun 4, 2022

All tests are green 🟢

@Mikolaj
Copy link
Member

Mikolaj commented Jun 4, 2022

All tests are green green_circle

Congrats. We'll review RSN.

Copy link
Member

@Kleidukos Kleidukos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a big PR! Thank you very much for this work. :)

@Kleidukos
Copy link
Member

@Mikolaj I would be most comfortable if we could advertise this for the next release candidate of 3.8 :)

@ulysses4ever
Copy link
Collaborator

A little late bikeshedding here. I'm not a big fan of flags/commands differing in one letter, e.g. haddock vs. haddocks. Not only it's easy to misspell, but it's harder to remember the difference. I'd prefer it be called something like haddock-project.

This is not a hard stop for me, no way. Wanted to throw it in to see if anyone is sympathetic to the idea.

@Kleidukos
Copy link
Member

Indeed there is merit to this review

@Mikolaj
Copy link
Member

Mikolaj commented Jun 4, 2022

@Mikolaj I would be most comfortable if we could advertise this for the next release candidate of 3.8 :)

How likely is this to break things not related to haddock?

@Mikolaj Mikolaj added this to the Considered for 3.8 milestone Jun 4, 2022
@Kleidukos
Copy link
Member

@Mikolaj It's a thousand lines PR, and since we can't easily rollback stuff like a SAAS, I'd rather have our beta-testers try it out before we settle on the final release. ;)

@gbaz
Copy link
Collaborator

gbaz commented Jun 4, 2022

I think the timing is wrong for the first 3.8 release sadly. We declared it was feature complete over a month ago, and we've released a candidate that, barring urgent bug fixes or regressions, is intended to be the same as the final 3.8 release.

This work looks really useful and I'm excited to have it in. But I think, given the size involved, and the need for giving people time to really test and use such functionality, that this should be milestoned for the following release of cabal-install.

@Kleidukos
Copy link
Member

Sorry my English was at fault here, my preoccupation was to have this feature beta-tested before shipped in a release. The fact that it's not 3.8 is not a problem, but I feared that there wouldn't be another RC if this feature was integrated into 3.8

@merijn
Copy link
Collaborator

merijn commented Jun 13, 2022

I don't have sufficient rights to add a label, so I'll just say it's ready :)

Did it for you :)

coot added 19 commits June 13, 2022 10:12
Added:

* `haddockIndex`: passed as '--use-index' to 'haddock'
* `haddockBaseUrl` : passed as '--base-url' to haddock'
This is useful for passing arguments to `haddock-project` command which
will create haddocks for all the components, together with a consistent
index.
We need 'renderArgs' to work when we create an index. In this case some
of the options will not be set.
Added arguments:
* 'argGenContents': haddocks' '--gen-contents'
* 'argGenIndex': haddocks' '--gen-index'
* 'argPrologueFile': haddocks' '--prologue' but unlike '--argPrlogue' it
  passes the file name not the prologue text itself.
The 'haddock-project' command can be used to create haddocks of all
components together with indexes (html, quickjump) and the content page.
This allows to test against a newer version of haddock than one that
comes with `ghc`, even with head of `haddock` repository.
It was broken in various ways :/

* The CmdHaddock (and CmdHaddockProject) have to restore the paths set with
  'haddockProgramPath' (or 'haddockProjectProgramPath');
* haddock is not by default in 'ProgramDb'; We need to add it first,
  otherwise 'reconfigure' will not update its path.
* 'setupHsHaddockFlags', need to store haddock location in
  'haddockProgramPaths.

This patch also adds 'haddockProjectProgramPath' and
'haddockProjectProgramArgs' to 'HaddockProjectFlags' which are passed to
'CmdHaddockProject'.
…mand

Haddock-2.26.1 allows to configure whether modules from a given interface
file should be visible on the generated content page.  We make visible
only modules which come from local packages.
Generated haddocks will have valid links to packages distributed with
GHC, e.g. `base`, `bytestring`, `array`, etc.
It is supported at least from `haddock-2.16`.
By passing `--haddock-html-location` one can link to haddocks to
documentation published on hackage.  However one can use it or
`--base-url`.  The latter will build self contained directory of haddock
documentation.
@mergify mergify bot merged commit c024065 into haskell:master Jun 13, 2022
@Mikolaj
Copy link
Member

Mikolaj commented Jun 13, 2022

I don't have sufficient rights to add a label, so I'll just say it's ready :)

Apologies, that's an oversight. It will be an honour for our team if you accept the repo invite I've just sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Tell Mergify Bot to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use new haddock multi-package support
7 participants