diff --git a/.circleci/config.yml b/.circleci/config.yml index 34660a77d..e4e38d3d8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,9 +22,9 @@ defaults: &defaults - restore_cache: keys: - - stack-cache-12-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} - - stack-cache-12-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }} - - stack-cache-12-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }} + - stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} + - 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 setup @@ -59,7 +59,7 @@ defaults: &defaults command: rm -fr ~/.cache/cabal-helper - save_cache: - key: stack-cache-12-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }} + key: stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }} paths: - ~/.stack - ~/.cache @@ -81,7 +81,7 @@ defaults: &defaults path: test-logs - save_cache: - key: stack-cache-12-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }} + key: stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }} paths: - ~/.stack - ~/.cache @@ -94,7 +94,7 @@ defaults: &defaults - ~/build/submodules/cabal-helper/.stack-work - save_cache: - key: stack-cache-12-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} + key: stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} paths: - ~/.stack - ~/.cache @@ -168,7 +168,7 @@ jobs: command: git submodule update --recursive --init - restore-cache: keys: - - cabal-12-{{ arch }}-{{ .Environment.CIRCLE_JOB }} + - cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }} - run: name: Cabal version command: cabal --version @@ -182,7 +182,7 @@ jobs: name: Build command: cabal new-build -j2 - save_cache: - key: cabal-12-{{ arch }}-{{ .Environment.CIRCLE_JOB }} + key: cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }} paths: - ~/.cabal diff --git a/Makefile b/Makefile index 896fc0b74..58aef7b1c 100644 --- a/Makefile +++ b/Makefile @@ -174,7 +174,7 @@ icu-macos-fix-build: # ------------------------------------------------------ -HIE_GIT_REF:=$(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match) +HIE_GIT_REF:=$(shell git describe --tags) HIE_DIST_NAME:=hie-${HIE_GIT_REF}-`uname -m`-`uname -s` HIE_DIST_DIR:=/tmp/${HIE_DIST_NAME} ## Creates a tarball containing all the hie binaries @@ -189,9 +189,13 @@ dist: stack --stack-yaml=stack-8.4.3.yaml build cp .stack-work/install/*/*/8.4.3/bin/hie ${HIE_DIST_DIR}/hie-8.4.3 stack --stack-yaml=stack-8.4.4.yaml build - cp .stack-work/install/*/*/8.4.4/bin/hie ${HIE_DIST_DIR}/hie cp .stack-work/install/*/*/8.4.4/bin/hie ${HIE_DIST_DIR}/hie-8.4.4 - cp .stack-work/install/*/*/8.4.4/bin/hie-wrapper ${HIE_DIST_DIR}/hie-wrapper + stack --stack-yaml=stack-8.6.1.yaml build + cp .stack-work/install/*/*/8.6.1/bin/hie ${HIE_DIST_DIR}/hie-8.6.1 + stack --stack-yaml=stack-8.6.2.yaml build + cp .stack-work/install/*/*/8.6.2/bin/hie ${HIE_DIST_DIR}/hie-8.6.2 + cp .stack-work/install/*/*/8.6.2/bin/hie ${HIE_DIST_DIR}/hie + cp .stack-work/install/*/*/8.6.2/bin/hie-wrapper ${HIE_DIST_DIR}/hie-wrapper tar -czf ${HIE_DIST_NAME}.tar.gz -C ${HIE_DIST_DIR} . rm -r ${HIE_DIST_DIR} .PHONY: dist diff --git a/stack.yaml b/stack.yaml index d4a307895..8306a0b5f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,34 +1,52 @@ -resolver: lts-12.20 # GHC 8.4.4 +resolver: nightly-2018-12-01 # GHC 8.6.2 packages: - . - hie-plugin-api extra-deps: -- ./submodules/brittany - ./submodules/HaRe +- ./submodules/brittany +- ./submodules/cabal-helper - ./submodules/ghc-mod - ./submodules/ghc-mod/core -- ./submodules/cabal-helper -# - brittany-0.11.0.0 +- apply-refact-0.6.0.0 +- butcher-1.3.2.1 - cabal-plan-0.4.0.0 - constrained-dynamic-0.1.0.0 -- ghc-exactprint-0.5.8.2 -- haddock-api-2.20.0 -- haddock-library-1.6.0 -- haskell-lsp-0.8.0.1 -- haskell-lsp-types-0.8.0.1 +- ekg-json-0.1.0.6 +- ekg-wai-0.1.0.3 +- haddock-api-2.21.0 - hsimport-0.8.6 +- monad-memo-0.4.1 +- multistate-0.8.0.1 +- resolv-0.1.1.2 - lsp-test-0.5.0.2 - pretty-show-1.8.2 - syz-0.2.0.0 - temporary-1.2.1.1 +- yaml-0.8.32 + + + flags: haskell-ide-engine: pedantic: true hie-plugin-api: pedantic: true + # ekg-core: + # allow-newer: true + # ekg-json: + # allow-newer: true + # ekg-wai: + # allow-newer: true + # base: + # allow-newer: true + # process: + # allow-newer: true + +# allow-newer: true nix: packages: [ icu libcxx zlib ] diff --git a/test/functional/DiagnosticsSpec.hs b/test/functional/DiagnosticsSpec.hs index 4d268a296..95f941cd3 100644 --- a/test/functional/DiagnosticsSpec.hs +++ b/test/functional/DiagnosticsSpec.hs @@ -17,7 +17,7 @@ import Utils spec :: Spec spec = describe "diagnostics providers" $ do - describe "diagnostics triggers" $ do + describe "diagnostics triggers" $ it "runs diagnostics on save" $ runSession hieCommandExamplePlugin codeActionSupportCaps "test/testdata" $ do -- runSessionWithConfig logConfig hieCommandExamplePlugin codeActionSupportCaps "test/testdata" $ do diff --git a/test/functional/FunctionalCodeActionsSpec.hs b/test/functional/FunctionalCodeActionsSpec.hs index a82eed3e8..c13c130d4 100644 --- a/test/functional/FunctionalCodeActionsSpec.hs +++ b/test/functional/FunctionalCodeActionsSpec.hs @@ -186,11 +186,10 @@ spec = describe "code actions" $ do -- ignore the first empty hlint diagnostic publish [_,diag:_] <- count 2 waitForDiagnostics - if ghcVersion == GHC86 - then - liftIO $ diag ^. L.message `shouldSatisfy` T.isPrefixOf "Could not load module ‘Codec.Compression.GZip’" - else - liftIO $ diag ^. L.message `shouldSatisfy` T.isPrefixOf "Could not find module ‘Codec.Compression.GZip’" + let preds = [ T.isPrefixOf "Could not load module ‘Codec.Compression.GZip’" + , T.isPrefixOf "Could not find module ‘Codec.Compression.GZip’" + ] + in liftIO $ diag ^. L.message `shouldSatisfy` \x -> any (\f -> f x) preds mActions <- getAllCodeActions doc let allActions = map fromAction mActions diff --git a/test/functional/Main.hs b/test/functional/Main.hs index 47d4737e8..fe7216100 100644 --- a/test/functional/Main.hs +++ b/test/functional/Main.hs @@ -1,11 +1,17 @@ module Main where -import Test.Hspec +import Control.Monad.IO.Class +import Language.Haskell.LSP.Test import qualified FunctionalSpec -import TestUtils +import Test.Hspec +import TestUtils main :: IO () main = do setupStackFiles + -- run a test session to warm up the cache to prevent timeouts in other tests + putStrLn "Warming up HIE cache..." + runSessionWithConfig (defaultConfig { messageTimeout = 120 }) hieCommand fullCaps "test/testdata" $ + liftIO $ putStrLn "HIE cache is warmed up" -- withFileLogging "functional.log" $ hspec FunctionalSpec.spec withFileLogging logFilePath $ hspec FunctionalSpec.spec