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

Ghc more detailled missing symbols #1118

Merged

Conversation

guibou
Copy link
Contributor

@guibou guibou commented Nov 26, 2019

This pull request is related to #969, but is independent, and closes #1072.

We are using #969 to force haddock to fail when there is missing link on some ghc symbols. We have this in our CI process to ensure a bit of quality on our haddock documentation.

However, sometimes we cannot directly fix missing links. For example the link may be to an hidden module or some symbols not yet handled by haddock, such as #1070 and #1071.

This pull request changes haddock in a few ways:

  • missing link now display fully qualified symbol names. Instead of displaying missing link about Word8, it says Data.Word.Word8.
  • missing link are now displayed one per line. This results to a longer haddock output, but this is easier to read.
  • it introduces a flag --ignore-link-symbol which will ignore a specified missing link. This helps reducing output garbage and will ensure that haddock won't fail once Use the Ghc monad to emit warnings #969 is merged.

@guibou
Copy link
Contributor Author

guibou commented Nov 26, 2019

The CI issue seems unrelated to the change I've done.

@guibou
Copy link
Contributor Author

guibou commented Mar 23, 2020

@harpocrates hello,

I'd really like to have feedback on this change, at least know if I have a chance to get it merged or not.

Copy link
Collaborator

@harpocrates harpocrates 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 definitely a useful feature (and, as you observed, will be necessary in conjunction with your other PR). Eventually, I wonder if we'll also want some option to read in the symbols to ignore from a file. The only way to find out is to try it out. 😄

CI on the 8.8 branch should be working again. Do you have bandwidth to rebase? If not, let me know and I can take care of it for you.

The current formatting of the missing link destination does not really
help user to understand the reasons of the missing link.

To address this, I've changed the formatting in two ways:

- the missing link symbol name is now fully qualified. This way you
immediately know which haskell module cannot be linked. It is then easier
to understand why this module does not have documentation (hidden module
or broken documentation).
- one line per missing link, that's more readable now that symbol name
can be longer due to qualification.

For example, before haddock was listing missing symbol such as:

```
could not find link destinations for:
  Word8 Word16 mapMaybe
```

Now it is listed as:

```
could not find link destinations for:
  - Data.Word.Word8
  - Data.Word.Word16
  - Data.Maybe.mapMaybe
```
This argument can be used multiples time. A missing link to a symbol
listed by `--ignore-link-symbol` won't trigger "missing link" warning.
@harpocrates harpocrates force-pushed the ghc-more-detailled-missing-symbols branch from c476238 to 72cc1c3 Compare March 23, 2020 22:59
@harpocrates harpocrates merged commit f493817 into haskell:ghc-8.8 Mar 23, 2020
@guibou
Copy link
Contributor Author

guibou commented Mar 24, 2020

Thank you!

@treeowl
Copy link
Contributor

treeowl commented Sep 3, 2021

I can't seem to get this option recognized in GHC 9.0.1. Am I missing something?

@guibou
Copy link
Contributor Author

guibou commented Sep 3, 2021

I can't seem to get this option recognized in GHC 9.0.1. Am I missing something?

That's an haddock option.

@guibou guibou deleted the ghc-more-detailled-missing-symbols branch September 3, 2021 07:40
@treeowl
Copy link
Contributor

treeowl commented Sep 3, 2021

@guibou, okay, but when I stick it in {-# OPTIONS_HADDOCK #-} I'm told it's not recognized.

@guibou
Copy link
Contributor Author

guibou commented Sep 3, 2021

@guibou, okay, but when I stick it in {-# OPTIONS_HADDOCK #-} I'm told it's not recognized.

Haa, I tested, yes you are right. OPTIONS_HADDOCK seems to only recognize a list of settings, but it does not works as OPTIONS_GHC is, that's not command line options directly passed to haddock.

@guibou
Copy link
Contributor Author

guibou commented Sep 3, 2021

I opened #1424 to track this discussion.

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

Successfully merging this pull request may close these issues.

Add a flag to ignore warning based on symbol names
3 participants