Skip to content
Snippets Groups Projects
Commit cf9a5ba9 authored by Hannes Siebenhandl's avatar Hannes Siebenhandl
Browse files

Print error message if no freeze file can be found

parent afcf5e23
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,7 @@ import Distribution.ReadE
import qualified Data.Set as S
import System.Directory
( getCurrentDirectory )
( getCurrentDirectory, doesFileExist )
-------------------------------------------------------------------------------
-- Command
......@@ -304,8 +304,18 @@ depsFromNewFreezeFile verbosity mprojectFile = do
let ucnstrs = map fst . projectConfigConstraints . projectConfigShared
$ projectConfig
deps = userConstraintsToDependencies ucnstrs
freezeFile = distProjectFile distDirLayout "freeze"
freezeFileExists <- doesFileExist freezeFile
unless freezeFileExists $
die' verbosity $
"Couldn't find a freeze file expected at: " ++ freezeFile ++ "\n\n"
++ "We are looking for this file because you supplied '--project-file' or '--v2-freeze-file'. "
++ "When one of these flags is given, we try to read the dependencies from a freeze file. "
++ "If it is undesired behaviour, you should not use these flags, otherwise please generate "
++ "a freeze file via 'cabal freeze'."
debug verbosity $
"Reading the list of dependencies from the new-style freeze file " ++ distProjectFile distDirLayout "freeze"
"Reading the list of dependencies from the new-style freeze file " ++ freezeFile
return deps
-- | Read the list of dependencies from the package description.
......
......@@ -23,4 +23,6 @@ Outdated dependencies:
template-haskell ==2.3.0.0 (latest: 2.3.0.1)
binary ==0.8.5.0 (latest: 0.8.6.0)
# cabal outdated
cabal: Couldn't find a freeze file expected at: <ROOT>/cabal.project.missing.freeze.freezeWe are looking for this file because you supplied '--project-file' or '--v2-freeze-file'. When one of these flags is given, we try to read the dependencies from a freeze file. If it is undesired behaviour, you should not use these flags, otherwise please generate a freeze file via 'cabal freeze'
cabal: Couldn't find a freeze file expected at: <ROOT>/cabal.project.missing.freeze.freeze
We are looking for this file because you supplied '--project-file' or '--v2-freeze-file'. When one of these flags is given, we try to read the dependencies from a freeze file. If it is undesired behaviour, you should not use these flags, otherwise please generate a freeze file via 'cabal freeze'.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment