Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display information on why a snapshot was rejected? #381

Closed
snoyberg opened this issue Jun 23, 2015 · 5 comments
Closed

Display information on why a snapshot was rejected? #381

snoyberg opened this issue Jun 23, 2015 · 5 comments
Assignees
Milestone

Comments

@snoyberg
Copy link
Contributor

Currently, stack init doesn't tell you why a snapshot won't work, at least not by default. If you run with --verbose, you get much more information. So the discussion point is: should we display that information by default? The downside would be possibly overwhelming levels of output, but I think we could manage that somehow.

@snoyberg snoyberg added this to the 0.2.0.0 milestone Jun 23, 2015
@rvion
Copy link
Contributor

rvion commented Jun 23, 2015

I think we should.

  • stack init will not be run a lot by new users.
  • Haskell users tend not to like magic too much
  • people for whom stack init fails won't probably rerun the command with --verbose
  • Failing without error messages is just annoying more generally

@snoyberg
Copy link
Contributor Author

OK, I've implemented this, sample output:

Basing on cabal files:
- /home/vagrant/Desktop/stack/stack.cabal
- /home/vagrant/Desktop/stack/new-template/new-template.cabal

Checking against build plan lts-2.9

* Build plan did not match your requirements:
    optparse-simple version 0.0.2 found
    - stack requires >=0.0.3

    path not found
    - stack requires -any && -any && >=0.5.1


Checking against build plan lts-1.9

* Build plan did not match your requirements:
    attoparsec version 0.12.1.3 found
    - stack requires >=0.12.1.5

    bifunctors version 4.2 found
    - stack requires >=4.2.1

    conduit-combinators version 0.3.0.6 found
    - stack requires >=0.3.1

    conduit-extra version 1.1.6.2 found
    - stack requires -any && -any && >=1.1.7.1

    exceptions version 0.6.1 found
    - stack requires -any && -any && >=0.8.0.2

    fast-logger version 2.2.3 found
    - stack requires >=2.3.1

    hashable version 1.2.3.1 found
    - stack requires -any && >=1.2.3.2

@rvion
Copy link
Contributor

rvion commented Jun 24, 2015

nice :)

2 minor things:

  • Should we add a final sentence: Try changing dependencies in your *.cabal files or add extra-deps in your stack.yml file?
  • should we be a bit more explicit at the cost of being a bit more verbose ?
    • fast-logger version 2.2.3 found in snapshot
    • cabal files require -any && -any && >=0.8.0.2

It might help new users to understand what is going one.

@snoyberg
Copy link
Contributor Author

I think the recommendations already given at the end (which I didn't include in this copy-paste since they haven't changed) are best. I'd be surprised if a user was uncertain about where the dependency ranges are coming from, since that's the only place it can come from and we already mentioned the .cabal files explicitly earlier. And "in snapshot" is more likely to confuse than anything else; we already stated which build plan it is (lts-2.9, etc) just before giving the mismatches.

@rvion
Copy link
Contributor

rvion commented Jun 24, 2015

ok 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants