aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralexwl <alexey.a.kiryushin@gmail.com>2019-08-03 19:59:18 +0300
committeralexwl <alexey.a.kiryushin@gmail.com>2019-08-03 19:59:18 +0300
commit611368eb780d9a2d5d0476cd9e00da2f0b69a647 (patch)
treed3850759d20f5a50e934d6c015ade5f9efd7321d /src
parenta8d0ab9c9a5cd1a72f52a5d05523e040acc7a0dc (diff)
Fail immediately when a GHC mismatch is detected. Closes #40.
Diffstat (limited to 'src')
-rw-r--r--src/HaskellCodeExplorer/PackageInfo.hs18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/HaskellCodeExplorer/PackageInfo.hs b/src/HaskellCodeExplorer/PackageInfo.hs
index 07f974e..dbfbfc7 100644
--- a/src/HaskellCodeExplorer/PackageInfo.hs
+++ b/src/HaskellCodeExplorer/PackageInfo.hs
@@ -153,16 +153,14 @@ createPackageInfo packageDirectoryPath mbDistDirRelativePath sourceCodePreproces
let currentPackageId = HCE.PackageId (T.pack packageName) packageVersion
unless
(take 3 (versionBranch packageCompilerVersion) ==
- take 3 (versionBranch ghcVersion)) $
- logInfoN $
- T.concat
- [ "GHC version mismatch. haskell-code-indexer: "
- , T.pack $ showVersion ghcVersion
- , ", package: "
- , T.pack $ showVersion packageCompilerVersion
- , ". "
- , "The indexing might fail."
- ]
+ take 3 (versionBranch ghcVersion)) $ do
+ logErrorN $ T.concat
+ [ "GHC version mismatch. haskell-code-indexer: "
+ , T.pack $ showVersion ghcVersion
+ , ", package: "
+ , T.pack $ showVersion packageCompilerVersion
+ ]
+ liftIO exitFailure
logInfoN $ T.append "Indexing " $ HCE.packageIdToText currentPackageId
let buildComponents =
L.map