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

Confusing error message when a cabal file for an extra-dep can't be found #3806

Closed
MaxGabriel opened this issue Jan 24, 2018 · 1 comment · Fixed by #3808
Closed

Confusing error message when a cabal file for an extra-dep can't be found #3806

MaxGabriel opened this issue Jan 24, 2018 · 1 comment · Fixed by #3808

Comments

@MaxGabriel
Copy link
Contributor

MaxGabriel commented Jan 24, 2018

General summary/comments (optional)

When the cabal file for an extra-dep can't be found, stack suggests the problem is with the packages field, not extra-deps.

Steps to reproduce

For example:

  1. Add a reference to a repo without a cabal file to your extra-deps (see YAML)
  2. Run command stack build.
# A fork of amazonka, which is a mega-repo, so the root directory doesn't have a cabal file
extra-deps:
  - git: https://github.com/tvision-insights/amazonka.git
    commit: 9d914189042d6d31ffee912436ddfacde08f1b50

Expected

The user is told which dependency the cabal file couldn't be found for, or at least that an extra-dep was the problem, or that it could be an extra-dep that is the problem.

Actual

Stack implies that my packages field is the problem with this message:

Stack looks for packages in the directories configured in the 'packages' variable defined in your stack.yaml

(See #2729)

Stack version

$ stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository, upgraded via stack upgrade

Potential fixes:

  • Quick fix: Modify the message to mention extra-deps
  • Potentially better: pass the package being searched for down so that the error message can be more detailed. I think usually this will be unnecessary, because the path itself is probably much more helpful for non-git repo downloads.
@mgsloan
Copy link
Contributor

mgsloan commented Jan 25, 2018

Makes sense. I suppose the quick fix would be to have it say "packages or extra-deps". PRs appreciated!

MaxGabriel added a commit to MaxGabriel/stack that referenced this issue Jan 25, 2018
…roblem too.

* Also: slight refactor to use only `concat` instead of ++ in the error message
* Also: mention that a package.yaml file would also be accepted
	* The code that throws this is only searching for a .cabal file, but it runs hpack on the directory immediately before that to generate a cabal file, so it's effectively looking for a package.yaml file as well

Closes commercialhaskell#3806
MaxGabriel added a commit to MaxGabriel/stack that referenced this issue Jan 25, 2018
…roblem too.

* Also: slight refactor to use only `concat` instead of ++ in the error message
* Also: mention that a package.yaml file would also be accepted
	* The code that throws this is only searching for a .cabal file, but it runs hpack on the directory immediately before that to generate a cabal file, so it's effectively looking for a package.yaml file as well

Closes commercialhaskell#3806
MaxGabriel added a commit to MaxGabriel/stack that referenced this issue Jan 25, 2018
…roblem too.

* Also: slight refactor to use only `concat` instead of ++ in the error message
* Also: mention that a package.yaml file would also be accepted
	* The code that throws this is only searching for a .cabal file, but it runs hpack on the directory immediately before that to generate a cabal file, so it's effectively looking for a package.yaml file as well

Closes commercialhaskell#3806
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