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

Typos in extra-deps aren't detected #1521

Closed
mgsloan opened this issue Dec 16, 2015 · 1 comment
Closed

Typos in extra-deps aren't detected #1521

mgsloan opened this issue Dec 16, 2015 · 1 comment

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Dec 16, 2015

Noticed this while helping L8D in #haskell

Repro:

  1. stack new issue1521
  2. cd issue1521
  3. Add hspec >= 2.2.1 to the test-suite build-depends
  4. Add the following to extra-deps:
- hspec-2.2.1 
- hspec-core-2.2.1 
- hspec-discover-2.2.1 
- hspec-epectations-0.7.2 

(Note the mis-spelled hspec-epectations)
5) stack test
6) Get this error:

While constructing the BuildPlan the following exceptions were encountered:

--  Failure when adding dependencies:    
      hspec-core: needed (==2.2.1), couldn't resolve its dependencies
      hspec-expectations: needed (==0.7.2.*), 0.7.1 found (latest applicable is 0.7.2)
    needed for package: hspec-2.2.1

--  Failure when adding dependencies:    
      hspec-expectations: needed (==0.7.2.*), 0.7.1 found (latest applicable is 0.7.2)
    needed for package: hspec-core-2.2.1

--  Failure when adding dependencies:    
      hspec: needed (>=2.2.1), couldn't resolve its dependencies
    needed for package: issue1521-0.1.0.0
@mgsloan mgsloan added this to the P1: Must milestone Dec 16, 2015
@borsboom borsboom modified the milestones: P2: Should, P1: Must Dec 21, 2015
luigy added a commit to luigy/stack that referenced this issue Feb 29, 2016
* it should now detect typos commercialhaskell#1521
  (package suggestions will be added in another PR)
luigy added a commit to luigy/stack that referenced this issue Feb 29, 2016
* it should now detect typos commercialhaskell#1521
  (package suggestions will be added in another PR)
@mgsloan mgsloan modified the milestones: P3: Optional, P2: Should Oct 24, 2016
mgsloan added a commit that referenced this issue Oct 24, 2016
@mgsloan
Copy link
Contributor Author

mgsloan commented Oct 24, 2016

In review of #1858 , this is actually quite tricky. The problem is that extra-deps might be fulfilled by packages globally installed. (e.g. docker container). Even then, we cannot be sure that it's missing in a way that should be a build failure, so it must just be a warning.

The solution here is to check if the extra-dep is already installed. If it isn't already installed, check if it is in the hackage index. If it isn't, then the warning is yielded. For this repro, it looks like this:

Warning: Some extra-deps are neither installed or in the index:
    * hspec-epectations0.7.2

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for hspec-2.2.1:
    hspec-expectations-0.7.1 must match ==0.7.2.* (latest applicable is 0.7.2)
needed due to issue1521-0.1.0.0 -> hspec-2.2.1

In the dependencies for hspec-core-2.2.1:
    hspec-expectations-0.7.1 must match ==0.7.2.* (latest applicable is 0.7.2)
needed due to issue1521-0.1.0.0 -> hspec-core-2.2.1

Plan construction failed.
*** Exception: ExitFailure 1

@mgsloan mgsloan closed this as completed Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants