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

Commit 89f8d83

Browse files
authored
Merge pull request #41 from jneira/hie-bios-haskell-lsp-0.17
Merge branch 'master' (incoming 0.13 release including haskell-lsp-0.17)
2 parents 2ff3893 + 3dcedf8 commit 89f8d83

34 files changed

+598
-431
lines changed

.circleci/config.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ defaults: &defaults
2626
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}
2727
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }}
2828

29+
# - run:
30+
# name: Stack upgrade
31+
# command: stack upgrade
32+
2933
- run:
3034
name: Stack setup
3135
command: stack -j 2 --stack-yaml=${STACK_FILE} setup
@@ -36,7 +40,7 @@ defaults: &defaults
3640

3741
- run:
3842
name: Install Hoogle
39-
command: stack --stack-yaml=${STACK_FILE} install hoogle
43+
command: stack -j 1 --stack-yaml=${STACK_FILE} install hoogle
4044

4145
- run:
4246
name: Build (we need the exe for tests)

Changelog.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,86 @@
1+
# 0.13.0.0
2+
3+
- Bump resolvers and deps `lts-14.11` for GHC 8.6.5, and
4+
`nightly-2019-09-21` for nightyly build, the last one to support GHC
5+
8.6.5.
6+
7+
Key deps updated
8+
- brittany-0.12.1
9+
- floskell-0.10.1
10+
- hlint-2.2.3
11+
- hsimport-0.11.0
12+
13+
([#1419](https://github.com/haskell/haskell-ide-engine/pull/1419), by @alanz)
14+
15+
- Update haskell-lsp to 0.17
16+
([#1418](https://github.com/haskell/haskell-ide-engine/pull/1418), by @alanz)
17+
18+
- Add instructions about install cabal with stack in the README
19+
([#1414](https://github.com/haskell/haskell-ide-engine/pull/1414), by @jneira)
20+
21+
- Robust tests
22+
([#1413](https://github.com/haskell/haskell-ide-engine/pull/1413), by @alanz)
23+
24+
- Find and run cabal in user original $PATH
25+
([#1406](https://github.com/haskell/haskell-ide-engine/pull/1406), by @jneira)
26+
27+
- Add stack-install-cabal target and confirmation messages
28+
([#1405](https://github.com/haskell/haskell-ide-engine/pull/1405), by @jneira)
29+
30+
- Haskell lsp 0.16
31+
([#1402](https://github.com/haskell/haskell-ide-engine/pull/1402), by @alanz)
32+
33+
- Handling Windows specific delimiters in func tests
34+
([#1400](https://github.com/haskell/haskell-ide-engine/pull/1400), by @jneira)
35+
36+
- Fix more code actions in windows
37+
([#1399](https://github.com/haskell/haskell-ide-engine/pull/1399), by @jneira)
38+
39+
- Upgrade network to 3.0.1.1
40+
([#1395](https://github.com/haskell/haskell-ide-engine/pull/1395), by @jneira)
41+
42+
- Use the new key format in one line for azure cache
43+
([#1394](https://github.com/haskell/haskell-ide-engine/pull/1394), by @jneira)
44+
45+
- Fix code renaming in windows
46+
([#1392](https://github.com/haskell/haskell-ide-engine/pull/1392), by @jneira)
47+
48+
- Add CodeTriage badge
49+
([#1381](https://github.com/haskell/haskell-ide-engine/pull/1381), by @NickSeagull)
50+
51+
- Add support for building with cabal-3.0.0.0
52+
([#1379](https://github.com/haskell/haskell-ide-engine/pull/1379), by @jneira)
53+
54+
- Refactor backtick aware completion
55+
([#1377](https://github.com/haskell/haskell-ide-engine/pull/1377), by @fendor)
56+
57+
- Add different Contexts for Module, import etc...
58+
([#1375](https://github.com/haskell/haskell-ide-engine/pull/1375), by @fendor)
59+
60+
- Do not traverse into Generated bindings when creating TypeMap
61+
([#1372](https://github.com/haskell/haskell-ide-engine/pull/1372), by @fendor)
62+
63+
- Readme: Mention cabal configure and restarting HIE for troubleshooting
64+
([#1370](https://github.com/haskell/haskell-ide-engine/pull/1370), by @Infinisil)
65+
66+
- Split out completion from HieExtras
67+
([#1369](https://github.com/haskell/haskell-ide-engine/pull/1369), by @bubba)
68+
69+
- Remove cabal check from stack builds
70+
([#1368](https://github.com/haskell/haskell-ide-engine/pull/1368), by @ollef)
71+
72+
- Recommend Coc over LanguageClient-neovim
73+
([#1367](https://github.com/haskell/haskell-ide-engine/pull/1367), by @Avi-D-coder)
74+
75+
- Install: Fix broken stack-build target and fix cabal run help msg
76+
([#1363](https://github.com/haskell/haskell-ide-engine/pull/1363), by @fendor)
77+
78+
- Fix error message if outdated cabal dependency
79+
([#1361](https://github.com/haskell/haskell-ide-engine/pull/1361), by @fendor)
80+
81+
- Made hlint dependency properly depend on version of ghc.
82+
([#1355](https://github.com/haskell/haskell-ide-engine/pull/1355), by @LinuxUser404)
83+
184
# 0.12.0.0
285

386
- Monthly resolver bump, `lts-13.30` for GHC 8.6.5, and `nightly-2019-07-31` for

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,22 @@ The install-script can be invoked via `cabal` instead of `stack` with the comman
214214
cabal v2-run ./install.hs --project-file install/shake.project <target>
215215
```
216216

217-
Running the script with cabal on windows seems to have some issues and is currently not fully supported.
217+
Running the script with cabal on windows requires a cabal version greater or equal to `3.0.0.0`.
218218

219219
Unfortunately, it is still required to have `stack` installed so that the install-script can locate the `local-bin` directory (on Linux `~/.local/bin`) and copy the `hie` binaries to `hie-x.y.z`, which is required for the `hie-wrapper` to function as expected.
220220

221221
For brevity, only the `stack`-based commands are presented in the following sections.
222222

223+
##### Install cabal using stack
224+
225+
Although you can use hie for stack based projects (those which have a `stack.yaml` in the project base directory) without having cabal installed, you will need it for cabal based projects (with only a `<projectName>.cabal` file or a `cabal.project` one in the project base directory).
226+
227+
You can install an appropiate cabal version using stack by running:
228+
229+
```bash
230+
stack ./install.hs stack-install-cabal
231+
```
232+
223233
##### Install specific GHC Version
224234

225235
Install **Nightly** (and hoogle docs):

app/MainHie.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ run opts = do
129129
progName <- getProgName
130130
logm $ "Run entered for HIE(" ++ progName ++ ") " ++ version
131131
logm $ "Current directory:" ++ d
132+
args <- getArgs
133+
logm $ "args:" ++ show args
132134

133135
let initOpts = defaultCradleOpts { cradleOptsVerbosity = verbosity }
134136
verbosity = if optBiosVerbose opts then Verbose else Silent

haskell-ide-engine.cabal

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: haskell-ide-engine
2-
version: 1.0.0.0
2+
version: 0.13.0.0
33
synopsis: Provide a common engine to power any Haskell IDE
44
description: Please see README.md
55
homepage: http://github.com/githubuser/haskell-ide-engine#readme
@@ -70,8 +70,8 @@ library
7070
, gitrev >= 1.1
7171
, haddock-api
7272
, haddock-library
73-
, haskell-lsp == 0.16.*
74-
, haskell-lsp-types == 0.16.*
73+
, haskell-lsp == 0.17.*
74+
, haskell-lsp-types == 0.17.*
7575
, haskell-src-exts
7676
, hie-plugin-api
7777
, hoogle >= 5.0.13
@@ -204,7 +204,7 @@ test-suite unit-test
204204
, free
205205
, ghc
206206
, haskell-ide-engine
207-
, haskell-lsp-types == 0.16.*
207+
, haskell-lsp-types == 0.17.*
208208
, hie-test-utils
209209
, hie-plugin-api
210210
, hoogle > 5.0.11
@@ -290,10 +290,10 @@ test-suite func-test
290290
, data-default
291291
, directory
292292
, filepath
293-
, lsp-test >= 0.6.0.0
293+
, lsp-test >= 0.8.0.0
294294
, haskell-ide-engine
295-
, haskell-lsp-types == 0.16.*
296-
, haskell-lsp == 0.16.*
295+
, haskell-lsp-types == 0.17.*
296+
, haskell-lsp == 0.17.*
297297
, hie-test-utils
298298
, hie-plugin-api
299299
, hspec

hie-plugin-api/hie-plugin-api.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: hie-plugin-api
2-
version: 0.12.0.0
2+
version: 0.13.0.0
33
synopsis: Haskell IDE API for plugin communication
44
license: BSD3
55
license-file: LICENSE
@@ -51,7 +51,7 @@ library
5151
, ghc
5252
, hie-bios
5353
, ghc-project-types >= 5.9.0.0
54-
, haskell-lsp == 0.16.*
54+
, haskell-lsp == 0.17.*
5555
, hslogger
5656
, unliftio
5757
, monad-control

install/hie-install.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ library
2121
build-depends: base >= 4.9 && < 5
2222
, shake == 0.17.8
2323
, directory
24+
, filepath
2425
, extra
2526
, text
2627
default-extensions: LambdaCase

install/src/Cabal.hs

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ import Print
1717
import Env
1818
import Stack
1919

20-
2120
execCabal :: CmdResult r => [String] -> Action r
22-
execCabal = command [] "cabal"
21+
execCabal = execCabalWithOriginalPath
2322

2423
execCabal_ :: [String] -> Action ()
25-
execCabal_ = command_ [] "cabal"
24+
execCabal_ = execCabalWithOriginalPath
25+
26+
execCabalWithOriginalPath :: CmdResult r => [String] -> Action r
27+
execCabalWithOriginalPath = withoutStackCachedBinaries . (command [] "cabal")
2628

2729
cabalBuildData :: Action ()
2830
cabalBuildData = do
@@ -57,22 +59,32 @@ cabalInstallHie versionNumber = do
5759
, "--overwrite-policy=always"
5860
]
5961
++ installMethod
60-
liftIO $ do
61-
copyFile (localBin </> "hie" <.> exe)
62-
(localBin </> "hie-" ++ versionNumber <.> exe)
63-
copyFile (localBin </> "hie" <.> exe)
64-
(localBin </> "hie-" ++ dropExtension versionNumber <.> exe)
6562

66-
installCabal :: Action ()
67-
installCabal = do
63+
let minorVerExe = "hie-" ++ versionNumber <.> exe
64+
majorVerExe = "hie-" ++ dropExtension versionNumber <.> exe
65+
66+
liftIO $ do
67+
copyFile (localBin </> "hie" <.> exe) (localBin </> minorVerExe)
68+
copyFile (localBin </> "hie" <.> exe) (localBin </> majorVerExe)
69+
70+
printLine $ "Copied executables "
71+
++ ("hie-wrapper" <.> exe) ++ ", "
72+
++ ("hie" <.> exe) ++ ", "
73+
++ majorVerExe ++ " and "
74+
++ minorVerExe
75+
++ " to " ++ localBin
76+
77+
installCabalWithStack :: Action ()
78+
installCabalWithStack = do
6879
-- try to find existing `cabal` executable with appropriate version
69-
cabalExeOk <- do
70-
c <- liftIO (findExecutable "cabal")
71-
when (isJust c) checkCabal
72-
return $ isJust c
80+
mbc <- withoutStackCachedBinaries (liftIO (findExecutable "cabal"))
7381

74-
-- install `cabal-install` if not already installed
75-
unless cabalExeOk $ execStackShake_ ["install", "cabal-install"]
82+
case mbc of
83+
Just c -> do
84+
checkCabal
85+
printLine "There is already a cabal executable in $PATH with the required minimum version."
86+
-- install `cabal-install` if not already installed
87+
Nothing -> execStackShake_ ["install", "cabal-install"]
7688

7789
-- | check `cabal` has the required version
7890
checkCabal :: Action ()
@@ -106,7 +118,7 @@ cabalInstallNotSuportedFailMsg =
106118
-- | Error message when the `cabal` binary is an older version
107119
cabalInstallIsOldFailMsg :: String -> String
108120
cabalInstallIsOldFailMsg cabalVersion =
109-
"The `cabal` executable is outdated.\n"
121+
"The `cabal` executable found in $PATH is outdated.\n"
110122
++ "found version is `"
111123
++ cabalVersion
112124
++ "`.\n"

install/src/Help.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Env
1010
import Print
1111
import Version
1212
import BuildSystem
13+
import Cabal
1314

1415
printUsage :: Action ()
1516
printUsage = do
@@ -83,6 +84,7 @@ helpMessage versions@BuildableVersions {..} = do
8384
, stackTarget buildAllTarget
8485
, stackTarget buildDataTarget
8586
]
87+
++ (if isRunFromStack then [stackTarget installCabalTarget] else [])
8688
++ map (stackTarget . hieTarget) stackVersions
8789

8890
cabalTargets =
@@ -136,6 +138,12 @@ cabalGhcsTarget =
136138
, "Show all GHC versions that can be installed via `cabal-build` and `cabal-build-all`."
137139
)
138140

141+
installCabalTarget :: TargetDescription
142+
installCabalTarget =
143+
( "install-cabal"
144+
, "Install the cabal executable. It will install the required minimum version for hie (currently " ++ versionToString requiredCabalVersion ++ ") if it isn't already present in $PATH"
145+
)
146+
139147
-- | Creates a message of the form "a, b, c and d", where a,b,c,d are GHC versions.
140148
-- If there is no GHC in the list of `hieVersions`
141149
allVersionMessage :: [String] -> String

install/src/HieInstall.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ defaultMain = do
6363
want ["short-help"]
6464
-- general purpose targets
6565
phony "submodules" updateSubmodules
66-
phony "cabal" installCabal
66+
phony "cabal" installCabalWithStack
6767
phony "short-help" shortHelpMessage
6868
phony "all" shortHelpMessage
6969
phony "help" (helpMessage versions)
@@ -91,6 +91,7 @@ defaultMain = do
9191
)
9292

9393
-- stack specific targets
94+
when isRunFromStack (phony "stack-install-cabal" (need ["cabal"]))
9495
phony "stack-build" (need (reverse $ map ("stack-hie-" ++) hieVersions))
9596
phony "stack-build-all" (need ["build-data", "build"])
9697
phony "stack-build-data" $ do
@@ -116,9 +117,9 @@ defaultMain = do
116117
forM_
117118
ghcVersions
118119
(\version -> phony ("cabal-hie-" ++ version) $ do
119-
validateCabalNewInstallIsSupported
120120
need ["submodules"]
121121
need ["cabal"]
122+
validateCabalNewInstallIsSupported
122123
cabalBuildHie version
123124
cabalInstallHie version
124125
)

0 commit comments

Comments
 (0)