@@ -30,13 +30,13 @@ type VersionNumber = String
3030type GhcPath = String
3131
3232-- | Defines all different hie versions that are buildable.
33- -- If they are edited,
33+ -- If they are edited,
3434hieVersions :: [VersionNumber ]
3535hieVersions =
3636 [" 8.2.1" , " 8.2.2" , " 8.4.2" , " 8.4.3" , " 8.4.4" , " 8.6.1" , " 8.6.2" , " 8.6.3" ]
3737
3838-- | 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
4040-- will be copied to the tar-archive.
4141mostRecentHieVersion :: VersionNumber
4242mostRecentHieVersion = last hieVersions
@@ -108,7 +108,7 @@ buildDist = do
108108
109109 -- if the most recent hie-* version is copied,
110110 -- 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
112112 when (hieVersion == mostRecentHieVersion) $ do
113113 copyFile' (localInstallRoot </> " bin" </> hieWrapper)
114114 (temporaryDir </> hieWrapper)
@@ -148,7 +148,19 @@ buildHie :: VersionNumber -> Action ()
148148buildHie versionNumber = do
149149 when (versionNumber `elem` [" hie-8.2.2" , " hie-8.2.1" ])
150150 $ 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
152164
153165installHie :: VersionNumber -> Action ()
154166installHie versionNumber = do
@@ -233,7 +245,7 @@ getGhcPath = do
233245 return $ trim ghc'
234246
235247-- | 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.
237249-- Equal to the command `stack path --local-install-root`
238250getLocalInstallRoot :: VersionNumber -> Action FilePath
239251getLocalInstallRoot hieVersion = do
0 commit comments