commercialhaskell / commercialhaskell/stack

`stack hoogle` fails in global project

Open
#2,526 4 comments 1 reaction 0 assignees View on GitHub
awaiting pull request component: hoogle type: discuss
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

```
~ $ 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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.