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

hoogle generate chokes on its own CHANGES.txt file #362

Open
filterfish opened this issue Nov 13, 2020 · 3 comments · May be fixed by #375
Open

hoogle generate chokes on its own CHANGES.txt file #362

filterfish opened this issue Nov 13, 2020 · 3 comments · May be fixed by #375

Comments

@filterfish
Copy link

Sorry that the title sounds like a tabloid newspaper headline but I couldn't think of anything else!

If I run the following command

hoogle generate --database=default.hoo --local=~HOME/.cabal/store/ghc-8.8.3/hoogle-5.0.18-49c45236e55e64b13b4bc02e45c0a98f2ba025846800562043c89b44dfe8c287/share/doc/

hoogle fails with the following:

Starting generate
[1/2] CHANGES... 0.01shoogle: hseToItem failed, Add mode = embed support
CallStack (from HasCallStack):
  error, called at src/Input/Haddock.hs:89:47 in hoogle-5.0.18-2ca429a1cd3458b1986ef981580c2f8fdf5c05edfd5cc1776345a6a9b450e5e4:Input.Haddock

This confused me at first because I thought I needed use "embed" mode but it turns out that if I remove the CHANGES.txt file from the directory it works properly. So after a bit of digging I narrowed it down to a single line in that file: line 269 (commit #4bd66888 which is the current master). The offending line is:

Add mode=embed support

I see on #355 you mention that the method you use to search for .txt files is not very robust but do you have any thoughts about how best to handle this in the long term?

@ndmitchell
Copy link
Owner

What does the doc folder contain within it? Are CHANGES.txt and hoogle.txt at the same level of the directory hierarchy. I don't really use local generation of Hoogle databases, so don't have much opinion on what the right way to do it is - it needs someone to figure out the use case, and then make it work.

@filterfish
Copy link
Author

filterfish commented Nov 25, 2020

Yeah the CHANGES.txt file is in share/doc/html. I would argue, certainly in the short term, that CHANGES.txt shouldn't be in share/doc/html, it should be one level up with LICENSE.

In the longer term can hoogle simply read the text file named after the package name. I've just checked every package installed on my machine and they all conform to that pattern though the number of packages on my machine is a small sample compared to every package on hackage.

@michaelbjames
Copy link

This could also be addressed by changing the hard-fail on https://github.com/ndmitchell/hoogle/blob/master/src/Input/Haddock.hs#L89 to a log message. That may be the easiest fix.

@michaelbjames michaelbjames linked a pull request Jul 22, 2021 that will close this issue
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 a pull request may close this issue.

3 participants