From fa3ffbe8beac8143f2be3bfcdf29741456b2231e Mon Sep 17 00:00:00 2001 From: Maximilian Tagher Date: Thu, 25 Jan 2018 08:32:28 -0800 Subject: [PATCH] When a cabal file can't be found, warn that extra-deps could be the problem 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 --- ChangeLog.md | 2 ++ src/Stack/Types/Package.hs | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 7169bf5e2c..0a1d1eebb5 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -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 diff --git a/src/Stack/Types/Package.hs b/src/Stack/Types/Package.hs index 8591fe40b1..81313e7354 100644 --- a/src/Stack/Types/Package.hs +++ b/src/Stack/Types/Package.hs @@ -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 " ++