Stack: `stack hoogle` fails in global project

Created on 22 Aug 2016  路  4Comments  路  Source: commercialhaskell/stack

~ $ stack hoogle Conduit
Run from outside a project, using implicit global project config
Using resolver: nightly-2016-08-06 from implicit global project's config file: /home/simon/.stack/global-project/stack.yaml
No Hoogle database yet. Automatically building haddocks and hoogle database (use --no-setup to disable) ...
Run from outside a project, using implicit global project config
Using resolver: nightly-2016-08-06 from implicit global project's config file: /home/simon/.stack/global-project/stack.yaml
Error parsing targets: The specified targets matched no packages.
Perhaps you need to run 'stack init'?

It looks like stack hoogle tries to build the haddocks but has no build target. Given that one can e.g. open haddocks (with stack haddock --open) from the global project, maybe stack hoogle could detect when it's in the global project and skip the haddock generation step?

If having a local project is a strict requirement, stack hoogle should at least fail more gracefully in the global project.

(Ping @chrisdone)

awaiting pull request hoogle discuss

Most helpful comment

Instead of special casing "global project", it should just be a special case for projects with no local packages.

All 4 comments

BTW I have created a new label component: hoogle for issues with stack hoogle.

@chrisdone agrees that stack hoogle should be available in the global project:

From slack:

i agree we need a bit of special logic for the global case

Instead of special casing "global project", it should just be a special case for projects with no local packages.

I just ran into precisely this issue. Is there any word on how this might be fixed?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

silky picture silky  路  3Comments

rrnewton picture rrnewton  路  4Comments

sjakobi picture sjakobi  路  3Comments

cybaj picture cybaj  路  3Comments

Cosmius picture Cosmius  路  3Comments