ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
753 stars 137 forks source link

Packages not found #142

Closed chrisdone closed 7 years ago

chrisdone commented 8 years ago

I just tried this out with the latest master on hoogle and I got this curious message:

[181/237] xml... 0.02s
[182/237] zlib... 0.03s
Packages not found: abstract-deque abstract-par arb-fft attoparsec-enumerator blaze-html blaze-textual bytestring-builder bytestring-mmap cassava cgi criterion cryptohash curl diagrams enumerator erf extensible-exceptions Glob hastache hostname hslogger hspec hspec-core hspec-discover hspec-expectations HUnit ieee754 math-functions mime-mail monad-par monad-par-extras MonadCatchIO-transformers monads-tf multipart nats network-info postgresql-libpq quickcheck-io regex-base regex-posix regex-tdfa-rc rts setenv statistics tasty tasty-quickcheck test-framework test-framework-hunit test-framework-quickcheck2 time-locale-compat timezone-series transformers-compat unbounded-delays vector-binary-instances vector-th-unbox
Found 58 warnings when processing items
Reodering items... 0.02s
Writing tags... 0.12s
Writing names... 0.23s
Writing types... 0.83s
Took 12.91s

Why weren't these ones found?

ndmitchell commented 8 years ago

It does ghc-pkg and then looks for the docs where the haddock field points (on a mobile, so I can't see the precise fields). Did you install haddock/Hoogle for each of those packages? Were they installed with stack or cabal? If stack, have you upgraded?

chrisdone commented 8 years ago

I ran stack haddock, but let me upgrade stack, that might be the cause.

ndmitchell commented 8 years ago

Also, any chance they are what your test suite requires but not your exe/lib? Makes no difference to Hoogle, but might to stack.

ndmitchell commented 8 years ago

@chrisdone, how did the upgrade work? Do you still have issues?

rvion commented 8 years ago

@ndmitchell

I just experiences a similar behaviour:

[...]
[129/165] word8... 0.02s
[130/165] xhtml... 0.08s
[131/165] yaml... 0.02s
[132/165] zlib... 0.04s
Packages not found: ansi-wl-pprint apply-refact bytestring-builder cabal-helper cereal cpphs djinn-ghc djinn-lib either extra fclabels ghc-exactprint ghc-mod ghc-syb-utils haskell-src-exts hlint hscolour monad-journal MonadRandom nats optparse-applicative pipes polyparse refact rts split strict stylish-haskell temporary temporary-rc transformers-compat uniplate utf8-string
Found 46 warnings when processing items
Reodering items... 0.01s
Writing tags... 0.09s
Writing names... 0.16s
Writing types... 0.63s
Took 9.71s

my guess is that those Packages not found are those I installed manually via stack install (e.g. stack install hlint) Since they are not related to my build plan, stack haddock didn't generate documentation for them.

ndmitchell commented 8 years ago

That makes sense, so if you want them installing, you'd need to talk to stack people - I'm not sure what it should do though. Were you hoping for docs for everything that goes into this package? Everything you've ever installed?

rvion commented 8 years ago

I think it is doing the right thing as of now.

Indeed stack haddock only asks stack to generate haddock for direct project dependencies, not for the whole snapshot.

if I want to generate doc for those other packages installed, but not in the dependency tree, I can still do

stack build --haddock \
  ansi-wl-pprint apply-refact bytestring-builder cabal-helper cereal cpphs djinn-ghc djinn-lib either extra fclabels ghc-exactprint ghc-mod ghc-syb-utils haskell-src-exts hlint hscolour monad-journal MonadRandom nats optparse-applicative pipes polyparse refact rts split strict stylish-haskell temporary temporary-rc transformers-compat uniplate utf8-string

And just copy-paste the list given by your command :)

rvion commented 8 years ago

A possible resolution to that could be to improve the error message:

ndmitchell commented 8 years ago

Or I could take a --stack command line and run stack build --haddock on all the things in the package DB. It's mostly a case of figuring out what users want. Do they want docs for this project? Docs for all projects that they directly depend on? Docs for everything they've ever installed?

chrisdone commented 8 years ago

@ndmitchell Indeed, nothing changed but @rvion's explanation clears up why.

My motivation for trying this out, apart from because I want it for myself, was to see what would be necessary to have a stack hoogle single command to do this. So it seems that such a command could run:

$ stack haddock <every> <package> <available> 
$ stack exec -- hoogle generate --local

What do you think?

chrisdone commented 8 years ago

This issue might be helpful https://github.com/commercialhaskell/stack/issues/1479 in serving this purpose.

ndmitchell commented 8 years ago

Thanks @chrisdone - seems entirely reasonable.

ndmitchell commented 8 years ago

I should use this ticket to make the message clearer, so users can answer their own questions. Not sure there's much more required than that.

ndmitchell commented 7 years ago

I still think its worth improving the error message, so leaving this open for now.

ndmitchell commented 7 years ago

Error message improved.