Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 0cb2591

Browse files
committed
Add error message to install.hs suggesting to clean workspace
1 parent c4a9e7c commit 0cb2591

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

install.hs

+17-5
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ type VersionNumber = String
3030
type GhcPath = String
3131

3232
-- |Defines all different hie versions that are buildable.
33-
-- If they are edited,
33+
-- If they are edited,
3434
hieVersions :: [VersionNumber]
3535
hieVersions =
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.
4141
mostRecentHieVersion :: VersionNumber
4242
mostRecentHieVersion = 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 ()
148148
buildHie 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

153165
installHie :: VersionNumber -> Action ()
154166
installHie 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`
238250
getLocalInstallRoot :: VersionNumber -> Action FilePath
239251
getLocalInstallRoot hieVersion = do

shake.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Used to provide a different environment for the shake build script
2-
resolver: lts-12.25 # GHC 8.4.4
2+
resolver: lts-13.4 # GHC 8.6.3, shake 0.17.4
33
packages:
44
- .
55

66
nix:
7-
packages: [ zlib ]
7+
packages: [ zlib ]

0 commit comments

Comments
 (0)