Skip to content

Commit

Permalink
When a cabal file can't be found, warn that extra-deps could be the p…
Browse files Browse the repository at this point in the history
…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 #3806
  • Loading branch information
MaxGabriel committed Jan 25, 2018
1 parent 2631803 commit fa3ffbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Other enhancements:
* The build progress bar reports names of packages currently building.
* `stack setup --verbose` causes verbose output of GHC configure process.
See [#3716](https://github.com/commercialhaskell/stack/issues/3716)
* Improve the error message when an `extra-dep` from a path or git reference can't be found
See [#3808](https://github.com/commercialhaskell/stack/pull/3808)

Bug fixes:
* 1.6.1 introduced a change that made some precompiled cache files use
Expand Down
7 changes: 4 additions & 3 deletions src/Stack/Types/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ instance Show PackageException where
]
show (PackageNoCabalFileFound dir) = concat
[ "Stack looks for packages in the directories configured in"
, " the 'packages' variable defined in your stack.yaml\n"
, "The current entry points to " ++ toFilePath dir ++
" but no .cabal file could be found there."
, " the 'packages' and 'extra-deps' fields defined in your stack.yaml\n"
, "The current entry points to "
, toFilePath dir
, " but no .cabal or package.yaml file could be found there."
]
show (PackageMultipleCabalFilesFound dir files) =
"Multiple .cabal files found in directory " ++
Expand Down

0 comments on commit fa3ffbe

Please sign in to comment.