Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge lastest hie-bios (with incoming master release 0.13) #4

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
92f0aa6
Fix code renaming in windows (#1392)
jneira Sep 25, 2019
b6de0a7
Use the new key format in one line
jneira Sep 26, 2019
1267d2b
Merge pull request #1394 from jneira/azure-one-line-cache
jneira Sep 30, 2019
e2396f7
Extract extractTerm to extend handling of win delims
jneira Sep 30, 2019
3efbee3
Fix extractImportableTerm for windows handling os specific delims
jneira Sep 30, 2019
38cf06b
Fix extractModuleName for windows handling os specific delims
jneira Sep 30, 2019
8cc09e6
Move extractTerm to HieExtras and reuse it
jneira Sep 30, 2019
9feb2eb
Merge pull request #1399: Fix more code actions in windows
jneira Sep 30, 2019
5385087
Handling Windows specific delimiters in func tests (#1400)
jneira Oct 1, 2019
2060ffb
Use haskell-lsp(-types) 0.16
alanz Oct 3, 2019
c281205
Fix GHC 8.2.2 build
alanz Oct 4, 2019
7e36aa3
Merge pull request #1402 from alanz/haskell-lsp-0.16
alanz Oct 4, 2019
2ca7474
Add confirmation messages to install cabal and install hie with cabal
jneira Oct 8, 2019
fcb30e1
Add stack-install-cabal target
jneira Oct 8, 2019
25678ff
Merge pull request #1405 from jneira/stack-install-cabal
fendor Oct 8, 2019
d5c50b9
Install and run cabal found in user original $PATH
jneira Oct 9, 2019
5e21628
Some refactorings
jneira Oct 10, 2019
0037450
Remove unused import
jneira Oct 10, 2019
da3f777
Validate cabal after trying to install it
jneira Oct 10, 2019
d1e442b
Take in account local cache dir
jneira Oct 11, 2019
5c58cd8
Making tests more robust
alanz Oct 13, 2019
b5e388a
Correct stack local install path and use a more precise name for the …
jneira Oct 14, 2019
78ec15d
Use current stack exe for circleci tests
alanz Oct 14, 2019
5e58c51
Tweak test names
alanz Oct 14, 2019
8046e48
Explicitly log the args passed to MainHie
alanz Oct 14, 2019
53acb90
Merge pull request #1406 from jneira/stack-install-cabal
jneira Oct 15, 2019
dbff14b
Revert to stack 1.9.3
alanz Oct 15, 2019
7ab685b
Add instructions about install cabal with stack
jneira Oct 16, 2019
623f8f6
Merge pull request #1414 from haskell/jneira-update-readme
jneira Oct 16, 2019
414bbee
Merge pull request #1413 from alanz/robust-tests
alanz Oct 16, 2019
60c0df2
Update haskell-lsp to 0.17
alanz Oct 20, 2019
3ec201f
Merge pull request #1418 from alanz/haskell-lsp-0.17
lukel97 Oct 21, 2019
172a557
Merge branch 'master' using haskell-lsp-0.17
jneira Oct 21, 2019
e53b221
Bump resolvers and deps
alanz Oct 21, 2019
41cfce0
Clean up comment from yaml file
alanz Oct 21, 2019
f561472
Integrate changes from hie-bios
jneira Oct 22, 2019
627bf2d
Prevent CircleCI OOM on "Install Hoogle" step
alanz Oct 22, 2019
f478edd
Merge pull request #1419 from alanz/bump-resolvers
alanz Oct 22, 2019
3a17fce
Preparing 0.13 release
alanz Oct 22, 2019
38a6feb
Merge pull request #1421 from alanz/prepare-0.13
lukel97 Oct 23, 2019
582ff05
Add intermediate progress report notification
jneira Oct 23, 2019
1cf6ab7
Correct progress title of second request
jneira Oct 23, 2019
3dcedf8
Merge branch 'master' (incoming 0.13 release)
jneira Oct 23, 2019
89f8d83
Merge pull request #41 from jneira/hie-bios-haskell-lsp-0.17
fendor Oct 23, 2019
b95c9dc
Merge branch 'hie-bios' into cabal-helper-helper
jneira Oct 23, 2019
8222708
Bump up cabal-helper to master
jneira Oct 23, 2019
9c58f50
Ignore cabal.project.freeze
jneira Oct 23, 2019
79b8c3f
Add clock-0.7.2 to stack-8.6.5.yaml
jneira Oct 23, 2019
baee740
Remove unused import that caused build error with stack
jneira Oct 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ defaults: &defaults
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }}

# - run:
# name: Stack upgrade
# command: stack upgrade

- run:
name: Stack setup
command: stack -j 2 --stack-yaml=${STACK_FILE} setup
Expand All @@ -36,7 +40,7 @@ defaults: &defaults

- run:
name: Install Hoogle
command: stack --stack-yaml=${STACK_FILE} install hoogle
command: stack -j 1 --stack-yaml=${STACK_FILE} install hoogle

- run:
name: Build (we need the exe for tests)
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
/test/testdata/wErrorTest/stack.yaml
TAGS
cabal-dev/
cabal.project.freeze
cabal.sandbox.config
dist-newstyle/
dist
Expand Down
83 changes: 83 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,86 @@
# 0.13.0.0

- Bump resolvers and deps `lts-14.11` for GHC 8.6.5, and
`nightly-2019-09-21` for nightyly build, the last one to support GHC
8.6.5.

Key deps updated
- brittany-0.12.1
- floskell-0.10.1
- hlint-2.2.3
- hsimport-0.11.0

([#1419](https://github.com/haskell/haskell-ide-engine/pull/1419), by @alanz)

- Update haskell-lsp to 0.17
([#1418](https://github.com/haskell/haskell-ide-engine/pull/1418), by @alanz)

- Add instructions about install cabal with stack in the README
([#1414](https://github.com/haskell/haskell-ide-engine/pull/1414), by @jneira)

- Robust tests
([#1413](https://github.com/haskell/haskell-ide-engine/pull/1413), by @alanz)

- Find and run cabal in user original $PATH
([#1406](https://github.com/haskell/haskell-ide-engine/pull/1406), by @jneira)

- Add stack-install-cabal target and confirmation messages
([#1405](https://github.com/haskell/haskell-ide-engine/pull/1405), by @jneira)

- Haskell lsp 0.16
([#1402](https://github.com/haskell/haskell-ide-engine/pull/1402), by @alanz)

- Handling Windows specific delimiters in func tests
([#1400](https://github.com/haskell/haskell-ide-engine/pull/1400), by @jneira)

- Fix more code actions in windows
([#1399](https://github.com/haskell/haskell-ide-engine/pull/1399), by @jneira)

- Upgrade network to 3.0.1.1
([#1395](https://github.com/haskell/haskell-ide-engine/pull/1395), by @jneira)

- Use the new key format in one line for azure cache
([#1394](https://github.com/haskell/haskell-ide-engine/pull/1394), by @jneira)

- Fix code renaming in windows
([#1392](https://github.com/haskell/haskell-ide-engine/pull/1392), by @jneira)

- Add CodeTriage badge
([#1381](https://github.com/haskell/haskell-ide-engine/pull/1381), by @NickSeagull)

- Add support for building with cabal-3.0.0.0
([#1379](https://github.com/haskell/haskell-ide-engine/pull/1379), by @jneira)

- Refactor backtick aware completion
([#1377](https://github.com/haskell/haskell-ide-engine/pull/1377), by @fendor)

- Add different Contexts for Module, import etc...
([#1375](https://github.com/haskell/haskell-ide-engine/pull/1375), by @fendor)

- Do not traverse into Generated bindings when creating TypeMap
([#1372](https://github.com/haskell/haskell-ide-engine/pull/1372), by @fendor)

- Readme: Mention cabal configure and restarting HIE for troubleshooting
([#1370](https://github.com/haskell/haskell-ide-engine/pull/1370), by @Infinisil)

- Split out completion from HieExtras
([#1369](https://github.com/haskell/haskell-ide-engine/pull/1369), by @bubba)

- Remove cabal check from stack builds
([#1368](https://github.com/haskell/haskell-ide-engine/pull/1368), by @ollef)

- Recommend Coc over LanguageClient-neovim
([#1367](https://github.com/haskell/haskell-ide-engine/pull/1367), by @Avi-D-coder)

- Install: Fix broken stack-build target and fix cabal run help msg
([#1363](https://github.com/haskell/haskell-ide-engine/pull/1363), by @fendor)

- Fix error message if outdated cabal dependency
([#1361](https://github.com/haskell/haskell-ide-engine/pull/1361), by @fendor)

- Made hlint dependency properly depend on version of ghc.
([#1355](https://github.com/haskell/haskell-ide-engine/pull/1355), by @LinuxUser404)

# 0.12.0.0

- Monthly resolver bump, `lts-13.30` for GHC 8.6.5, and `nightly-2019-07-31` for
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,22 @@ The install-script can be invoked via `cabal` instead of `stack` with the comman
cabal v2-run ./install.hs --project-file install/shake.project <target>
```

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

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.

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

##### Install cabal using stack

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).

You can install an appropiate cabal version using stack by running:

```bash
stack ./install.hs stack-install-cabal
```

##### Install specific GHC Version

Install **Nightly** (and hoogle docs):
Expand Down
2 changes: 2 additions & 0 deletions app/MainHie.hs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ run opts = do
progName <- getProgName
logm $ "Run entered for HIE(" ++ progName ++ ") " ++ version
logm $ "Current directory:" ++ d
args <- getArgs
logm $ "args:" ++ show args

let initOpts = defaultCradleOpts { cradleOptsVerbosity = verbosity }
verbosity = if optBiosVerbose opts then Verbose else Silent
Expand Down
14 changes: 7 additions & 7 deletions haskell-ide-engine.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: haskell-ide-engine
version: 1.0.0.0
version: 0.13.0.0
synopsis: Provide a common engine to power any Haskell IDE
description: Please see README.md
homepage: http://github.com/githubuser/haskell-ide-engine#readme
Expand Down Expand Up @@ -69,8 +69,8 @@ library
, gitrev >= 1.1
, haddock-api
, haddock-library
, haskell-lsp == 0.16.*
, haskell-lsp-types == 0.16.*
, haskell-lsp == 0.17.*
, haskell-lsp-types == 0.17.*
, haskell-src-exts
, hie-plugin-api
, hoogle >= 5.0.13
Expand Down Expand Up @@ -203,7 +203,7 @@ test-suite unit-test
, free
, ghc
, haskell-ide-engine
, haskell-lsp-types == 0.16.*
, haskell-lsp-types == 0.17.*
, hie-test-utils
, hie-plugin-api
, hoogle > 5.0.11
Expand Down Expand Up @@ -289,10 +289,10 @@ test-suite func-test
, data-default
, directory
, filepath
, lsp-test >= 0.6.0.0
, lsp-test >= 0.8.0.0
, haskell-ide-engine
, haskell-lsp-types == 0.16.*
, haskell-lsp == 0.16.*
, haskell-lsp-types == 0.17.*
, haskell-lsp == 0.17.*
, hie-test-utils
, hie-plugin-api
, hspec
Expand Down
1 change: 0 additions & 1 deletion hie-plugin-api/Haskell/Ide/Engine/Cradle.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import Data.Function ((&))
import qualified Data.List.NonEmpty as NonEmpty
import Data.List.NonEmpty (NonEmpty)
import System.FilePath
import System.Directory
import qualified Data.Map as M
import Data.List (inits, sortOn, isPrefixOf, find)
import Data.Maybe (listToMaybe)
Expand Down
4 changes: 2 additions & 2 deletions hie-plugin-api/hie-plugin-api.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: hie-plugin-api
version: 0.12.0.0
version: 0.13.0.0
synopsis: Haskell IDE API for plugin communication
license: BSD3
license-file: LICENSE
Expand Down Expand Up @@ -52,7 +52,7 @@ library
, hie-bios
, ghc-project-types >= 5.9.0.0
, cabal-helper
, haskell-lsp == 0.16.*
, haskell-lsp == 0.17.*
, hslogger
, unliftio
, monad-control
Expand Down
1 change: 1 addition & 0 deletions install/hie-install.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ library
build-depends: base >= 4.9 && < 5
, shake == 0.17.8
, directory
, filepath
, extra
, text
default-extensions: LambdaCase
Expand Down
46 changes: 29 additions & 17 deletions install/src/Cabal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ import Print
import Env
import Stack


execCabal :: CmdResult r => [String] -> Action r
execCabal = command [] "cabal"
execCabal = execCabalWithOriginalPath

execCabal_ :: [String] -> Action ()
execCabal_ = command_ [] "cabal"
execCabal_ = execCabalWithOriginalPath

execCabalWithOriginalPath :: CmdResult r => [String] -> Action r
execCabalWithOriginalPath = withoutStackCachedBinaries . (command [] "cabal")

cabalBuildData :: Action ()
cabalBuildData = do
Expand Down Expand Up @@ -57,22 +59,32 @@ cabalInstallHie versionNumber = do
, "--overwrite-policy=always"
]
++ installMethod
liftIO $ do
copyFile (localBin </> "hie" <.> exe)
(localBin </> "hie-" ++ versionNumber <.> exe)
copyFile (localBin </> "hie" <.> exe)
(localBin </> "hie-" ++ dropExtension versionNumber <.> exe)

installCabal :: Action ()
installCabal = do
let minorVerExe = "hie-" ++ versionNumber <.> exe
majorVerExe = "hie-" ++ dropExtension versionNumber <.> exe

liftIO $ do
copyFile (localBin </> "hie" <.> exe) (localBin </> minorVerExe)
copyFile (localBin </> "hie" <.> exe) (localBin </> majorVerExe)

printLine $ "Copied executables "
++ ("hie-wrapper" <.> exe) ++ ", "
++ ("hie" <.> exe) ++ ", "
++ majorVerExe ++ " and "
++ minorVerExe
++ " to " ++ localBin

installCabalWithStack :: Action ()
installCabalWithStack = do
-- try to find existing `cabal` executable with appropriate version
cabalExeOk <- do
c <- liftIO (findExecutable "cabal")
when (isJust c) checkCabal
return $ isJust c
mbc <- withoutStackCachedBinaries (liftIO (findExecutable "cabal"))

-- install `cabal-install` if not already installed
unless cabalExeOk $ execStackShake_ ["install", "cabal-install"]
case mbc of
Just c -> do
checkCabal
printLine "There is already a cabal executable in $PATH with the required minimum version."
-- install `cabal-install` if not already installed
Nothing -> execStackShake_ ["install", "cabal-install"]

-- | check `cabal` has the required version
checkCabal :: Action ()
Expand Down Expand Up @@ -106,7 +118,7 @@ cabalInstallNotSuportedFailMsg =
-- | Error message when the `cabal` binary is an older version
cabalInstallIsOldFailMsg :: String -> String
cabalInstallIsOldFailMsg cabalVersion =
"The `cabal` executable is outdated.\n"
"The `cabal` executable found in $PATH is outdated.\n"
++ "found version is `"
++ cabalVersion
++ "`.\n"
Expand Down
8 changes: 8 additions & 0 deletions install/src/Help.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Env
import Print
import Version
import BuildSystem
import Cabal

printUsage :: Action ()
printUsage = do
Expand Down Expand Up @@ -83,6 +84,7 @@ helpMessage versions@BuildableVersions {..} = do
, stackTarget buildAllTarget
, stackTarget buildDataTarget
]
++ (if isRunFromStack then [stackTarget installCabalTarget] else [])
++ map (stackTarget . hieTarget) stackVersions

cabalTargets =
Expand Down Expand Up @@ -136,6 +138,12 @@ cabalGhcsTarget =
, "Show all GHC versions that can be installed via `cabal-build` and `cabal-build-all`."
)

installCabalTarget :: TargetDescription
installCabalTarget =
( "install-cabal"
, "Install the cabal executable. It will install the required minimum version for hie (currently " ++ versionToString requiredCabalVersion ++ ") if it isn't already present in $PATH"
)

-- | Creates a message of the form "a, b, c and d", where a,b,c,d are GHC versions.
-- If there is no GHC in the list of `hieVersions`
allVersionMessage :: [String] -> String
Expand Down
5 changes: 3 additions & 2 deletions install/src/HieInstall.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ defaultMain = do
want ["short-help"]
-- general purpose targets
phony "submodules" updateSubmodules
phony "cabal" installCabal
phony "cabal" installCabalWithStack
phony "short-help" shortHelpMessage
phony "all" shortHelpMessage
phony "help" (helpMessage versions)
Expand Down Expand Up @@ -91,6 +91,7 @@ defaultMain = do
)

-- stack specific targets
when isRunFromStack (phony "stack-install-cabal" (need ["cabal"]))
phony "stack-build" (need (reverse $ map ("stack-hie-" ++) hieVersions))
phony "stack-build-all" (need ["build-data", "build"])
phony "stack-build-data" $ do
Expand All @@ -116,9 +117,9 @@ defaultMain = do
forM_
ghcVersions
(\version -> phony ("cabal-hie-" ++ version) $ do
validateCabalNewInstallIsSupported
need ["submodules"]
need ["cabal"]
validateCabalNewInstallIsSupported
cabalBuildHie version
cabalInstallHie version
)
Expand Down
Loading