Skip to content

Conversation

michaelbjames
Copy link

An attempt to fix #362, albeit a bit rough.

Before this fix, if you ran hoogle generate --local=. on the hoogle repo you would get an error hseToItem failed, from trying and failing to parse the CHANGES.txt file. After this change, you will get that same message in the .warn file, but Hoogle will happily generate the rest of the database.

I will readily admit this is an inelegant fix. If a stray .txt file in the directory being scanned contains valid haskell on any line it will be slurped up by HSE. I think this is an acceptable tradeoff, considering the alternative is that every .txt file must contain valid HSE-parsable haskell on every line, otherwise Hoogle will not generate a database.

@DieracDelta
Copy link

DieracDelta commented Aug 28, 2025

Any chance this could be merged? I still run into this problem on various packages when trying to generate a local hoogle database from cabal haddock-project --all --hoogle && hoogle generate --local=.. The error is slightly different but has the same general idea:

Starting generate
[58/240] cmdargs... hoogle: hseToItem failed, pattern SPACE = 32
CallStack (from HasCallStack):
  error, called at src/Input/Haddock.hs:90:47 in hoogle-5.0.18.4-GxsWL116mJd2zdlPhZNZwh:Input.Haddock

Cherry picking this commit onto HEAD of master yields a successful database generation with a couple of warns.

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.

hoogle generate chokes on its own CHANGES.txt file
2 participants