commercialhaskell / commercialhaskell/stack
`stack hoogle`: Don’t abort when `--no-setup` is provided and a Hoogle database doesn’t exist
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
By default, `stack hoogle` automatically runs `stack haddock` and builds a Hoogle database if one has never been built for the current project. It recommends using the `--no-setup` flag to disable that behavior, but `--no-setup` is actually completely useless, since it just makes the command do absolutely nothing:
```
$ stack hoogle --no-setup -- --help
No Hoogle database. Not building one due to --no-setup
fish: 'stack hoogle --no-setup -- --he…' terminated by signal SIGHUP (Terminal hung up)
```
I don’t really see how that behavior is very useful, personally, but I *do* often want the other behavior: blindly charge ahead even if a database doesn’t exist. The problem with `stack hoogle` is that it always tries to build the current project, and if the build fails, then the whole command fails. But often I really do want to build a Hoogle database even though my project doesn’t currently build: I want documentation for my dependencies!
Personally, I think `--no-setup` should not just exit if a database doesn’t exist so that I can run `stack haddock --dependencies-only && stack hoogle --no-setup -- generate --local` myself if I want to, even if my project doesn’t compile. Barring that, I’d like some other `--force`-like argument to override the current behavior.
Contributor guide
Assessment
This issue has not been assessed yet.