commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
4k stars 843 forks source link

`stack hoogle` fails in global project #2526

Open sjakobi opened 8 years ago

sjakobi commented 8 years ago
~ $ 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)

sjakobi commented 8 years ago

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

sjakobi commented 8 years ago

@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

mgsloan commented 8 years ago

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

plaidfinch commented 6 years ago

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