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

Add 8.6.2 to dist and update nightly resolver #968

Merged
merged 11 commits into from
Dec 7, 2018
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
36 changes: 27 additions & 9 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -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 ]
Expand Down
2 changes: 1 addition & 1 deletion test/functional/DiagnosticsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions test/functional/FunctionalCodeActionsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions test/functional/Main.hs
Original file line number Diff line number Diff line change
@@ -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