hoogle icon indicating copy to clipboard operation
hoogle copied to clipboard

"invalid spreadNames" when many packages

Open kenta2 opened this issue 6 years ago • 5 comments

running hoogle generate --local on about 7000 packages results in

Writing types... hoogle: Invalid spreadNames

Digging a bit further into spreadNames (Output/Types.hs) finds that length xs in this situation is 67331, exceeding the maximum for the Word16 inside of the Name type.

kenta2 avatar Jan 26 '20 15:01 kenta2

Thanks for the report. I'm rather surprised that you have 7000 packages! Is that a consequence of auto generated code? Or are you indexing all of Hackage? Splitting each module into its own package? Or fundamentally, do you just have a lot of code? I think that spread names only really cares about the number of type constructors, and a standard build of Stackage has 28783 of them.

ndmitchell avatar Feb 02 '20 17:02 ndmitchell

This error results from indexing a significant portion of Hackage.

kenta2 avatar Feb 04 '20 23:02 kenta2

The submitted pull request works for me locally, but for production, we probably want the database to be versioned indicating a new schema so tools don't fail reading incompatible databases. Also probably want tools for converting databases.

kenta2 avatar Feb 04 '20 23:02 kenta2

I changed the code for "sizeOf" for "instance Storable Fingerprint" because I suspect there is a bug there (the old size would have been correct if sizeOf were expressed in bits (64 bits), but it's actually bytes. However, I'm not really sure if that was the reason for "64".

kenta2 avatar Feb 04 '20 23:02 kenta2

Yep, I think that sizeOf was totally dubious. We probably just padded the arrays by a huge chunk for no good reason. Fortunately the size consumed by this information was small enough not to matter. I've merged the PR, and will bump the 3rd digit with the next release. Would you like a release sooner?

ndmitchell avatar May 24 '20 19:05 ndmitchell