@@ -30,13 +30,13 @@ type VersionNumber = String
30
30
type GhcPath = String
31
31
32
32
-- | Defines all different hie versions that are buildable.
33
- -- If they are edited,
33
+ -- If they are edited,
34
34
hieVersions :: [VersionNumber ]
35
35
hieVersions =
36
36
[" 8.2.1" , " 8.2.2" , " 8.4.2" , " 8.4.3" , " 8.4.4" , " 8.6.1" , " 8.6.2" , " 8.6.3" ]
37
37
38
38
-- | Most recent version of hie.
39
- -- Important for `dist`, the `hie-wrapper` of the most recent hie
39
+ -- Important for `dist`, the `hie-wrapper` of the most recent hie
40
40
-- will be copied to the tar-archive.
41
41
mostRecentHieVersion :: VersionNumber
42
42
mostRecentHieVersion = last hieVersions
@@ -108,7 +108,7 @@ buildDist = do
108
108
109
109
-- if the most recent hie-* version is copied,
110
110
-- copy it again as the default hie version
111
- -- Also, add its hie-wrapper to the tar archive
111
+ -- Also, add its hie-wrapper to the tar archive
112
112
when (hieVersion == mostRecentHieVersion) $ do
113
113
copyFile' (localInstallRoot </> " bin" </> hieWrapper)
114
114
(temporaryDir </> hieWrapper)
@@ -148,7 +148,19 @@ buildHie :: VersionNumber -> Action ()
148
148
buildHie versionNumber = do
149
149
when (versionNumber `elem` [" hie-8.2.2" , " hie-8.2.1" ])
150
150
$ execStackWithYaml_ versionNumber [" install" , " happy" ]
151
- execStackWithYaml_ versionNumber [" build" ]
151
+ (execStackWithYaml_ versionNumber [" build" ]) `actionOnException`
152
+ liftIO (putStrLn buildFailMsg)
153
+
154
+ buildFailMsg :: String
155
+ buildFailMsg =
156
+ let starsLine = " \n ******************************************************************\n "
157
+ in
158
+ starsLine
159
+ ++ " building failed, "
160
+ ++ " try running `stack clean` and restart the build\n "
161
+ ++ " if this does not work, open an issue at \n "
162
+ ++ " https://github.com/haskell/haskell-ide-engine"
163
+ ++ starsLine
152
164
153
165
installHie :: VersionNumber -> Action ()
154
166
installHie versionNumber = do
@@ -233,7 +245,7 @@ getGhcPath = do
233
245
return $ trim ghc'
234
246
235
247
-- | Read the local install root of the stack project specified by the VersionNumber
236
- -- Returns the filepath of the local install root.
248
+ -- Returns the filepath of the local install root.
237
249
-- Equal to the command `stack path --local-install-root`
238
250
getLocalInstallRoot :: VersionNumber -> Action FilePath
239
251
getLocalInstallRoot hieVersion = do
0 commit comments