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 ca9ceb1 commit 08ab452
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Stack/Types/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,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 08ab452

Please sign in to comment.