commercialhaskell / commercialhaskell/stack
Does `stack ide targets` require a build plan?
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
### General summary/comments (optional)
It seems that `stack ide targets` requires first downloading a build plan and possibly running `stack setup` before it outputs the available targets (when you might want to get the list of targets first so you can build a specific one, said building should then fetch the build plan).
### Steps to reproduce
1. Get a stack-based project with a build plan you haven't used before (i.e. not found in `~/.stack/build-plan/`).
* Bonus points: try using either system-ghc or don't run `stack setup` so that `stack` can't find the version of `ghc` it wants.
2. Run `stack ide targets`
### Expected
List of available targets is printed out, e.g.
```bash
$stack ide targets
yesod:lib
yesod-auth:lib
yesod-auth-oauth:lib
yesod-bin:exe:yesod
yesod-core:lib
yesod-core:test:test-routes
yesod-core:test:tests
yesod-core:bench:widgets
yesod-eventsource:lib
yesod-form:lib
yesod-form:test:test
yesod-newsfeed:lib
yesod-persistent:lib
yesod-persistent:test:test
yesod-sitemap:lib
yesod-static:lib
yesod-static:test:tests
yesod-test:lib
yesod-test:test:test
yesod-websockets:lib
```
### Actual
```bash
$stack ide targets
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading timestamp
Downloading snapshot
Downloading mirrors
Cannot update index (no local copy)
Downloading index
Updated package list downloaded
Populated index cache.
No compiler found, expected minor version match with ghc-8.0.2 (x86_64) (based on resolver setting in /home/ivan/Haskell/yesod/stack.yaml).
To install the correct GHC into /home/ivan/.stack/programs/x86_64-linux/, try running "stack setup" or use the "--install-ghc" flag. To use your system GHC installation, run "stack config set system-ghc --global true", or use the "--system-ghc" flag.
```
### Stack version
```
$stack --version | head -1
Version 1.5.1 x86_64
```
### Method of installation
NixOS system install.
Contributor guide
Assessment
This issue has not been assessed yet.