From 7118bd1d105229fc17a6c178b69876f113d806f0 Mon Sep 17 00:00:00 2001 From: elfenlaid Date: Thu, 2 Oct 2014 11:59:51 +0300 Subject: [PATCH 1/3] Fix build dependencies --- haskell/LTHaskellClient.hs | 10 +++++----- light-haskell.cabal | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/haskell/LTHaskellClient.hs b/haskell/LTHaskellClient.hs index 0f1cf05..a659012 100644 --- a/haskell/LTHaskellClient.hs +++ b/haskell/LTHaskellClient.hs @@ -18,7 +18,7 @@ import qualified Data.ByteString.Lazy.Char8 as BS import GHC.Generics (Generic) import Language.Haskell.GhcMod (check, defaultOptions, findCradle, - lintSyntax, withGHC) + lint, runGhcModT) import Language.Haskell.Stylish @@ -166,10 +166,10 @@ format x = do getSyntaxIssues :: FilePath -> IO [String] getSyntaxIssues filePath = do - cradle <- findCradle - withGHC filePath $ check defaultOptions cradle [filePath] + (Right result, _) <- runGhcModT defaultOptions $ check [filePath] + return $ either (:[]) lines result getLintIssues :: FilePath -> IO [String] getLintIssues file = do - syntaxIssues <- lintSyntax defaultOptions file - return $ lines syntaxIssues + (Right lintIssues, _) <- runGhcModT defaultOptions $ lint file + return $ lines lintIssues diff --git a/light-haskell.cabal b/light-haskell.cabal index 9b8d013..b8e6b84 100644 --- a/light-haskell.cabal +++ b/light-haskell.cabal @@ -51,15 +51,15 @@ executable light-haskell -- Other library packages from which modules are imported. build-depends: - base ==4.6.*, - network ==2.4.*, + base ==4.7.*, + network ==2.5.*, directory ==1.2.*, containers ==0.5.*, text ==1.1.*, bytestring ==0.10.*, aeson ==0.7.*, - process ==1.1.*, - ghc-mod ==3.1.*, + process ==1.2.*, + ghc-mod ==5.1.*, stylish-haskell ==0.5.* -- Directories containing source files. From 60a8f92f1efc9294498abc4d879812cfe557f75d Mon Sep 17 00:00:00 2001 From: elfenlaid Date: Thu, 2 Oct 2014 19:42:56 +0300 Subject: [PATCH 2/3] Fix base constraints --- light-haskell.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/light-haskell.cabal b/light-haskell.cabal index b8e6b84..3e65797 100644 --- a/light-haskell.cabal +++ b/light-haskell.cabal @@ -51,7 +51,7 @@ executable light-haskell -- Other library packages from which modules are imported. build-depends: - base ==4.7.*, + base (>=4.0 && <5), network ==2.5.*, directory ==1.2.*, containers ==0.5.*, From 5f2ad67f04baad61d6697e49ee9762438428754b Mon Sep 17 00:00:00 2001 From: elfenlaid Date: Sat, 4 Oct 2014 11:19:56 +0300 Subject: [PATCH 3/3] Update travis config and cabal dependencies --- .travis.yml | 42 +++++++++++++++++++++++++++++++++++++----- light-haskell.cabal | 6 +++--- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 512bcef..383e4aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,38 @@ language: haskell -ghc: - - 7.6 - - 7.8 -script: - - cabal install --dependencies-only && cabal build + +env: + - GHCVER=7.6.3 + - GHCVER=7.8.2 + - GHCVER=7.8.3 + +before_install: + # If $GHCVER is the one travis has, don't bother reinstalling it. + # We can also have faster builds by installing some libraries with + # `apt`. If it isn't, install the GHC we want from hvr's PPA along + # with cabal-1.18. + - | + if [ $GHCVER = `ghc --numeric-version` ]; then + # Try installing some of the build-deps with apt-get for speed. + travis/cabal-apt-install --enable-tests $MODE + export CABAL=cabal + else + # Install the GHC we want from hvr's PPA + travis_retry sudo add-apt-repository -y ppa:hvr/ghc + travis_retry sudo apt-get update + travis_retry sudo apt-get install cabal-install-1.18 ghc-$GHCVER happy + export CABAL=cabal-1.18 + export PATH=/opt/ghc/$GHCVER/bin:$PATH + fi + # Uncomment whenever hackage is down. + # - mkdir -p ~/.cabal && cp travis/config ~/.cabal/config && $CABAL update + - $CABAL update + + # Update happy when building with GHC head + - | + if [ $GHCVER = "7.8.3" ] || [ $GHCVER = "7.8.2" ]; then + $CABAL install happy alex + export PATH=$HOME/.cabal/bin:$PATH + fi + +install: + - $CABAL install --dependencies-only --enable-tests && $CABAL build diff --git a/light-haskell.cabal b/light-haskell.cabal index 3e65797..7942776 100644 --- a/light-haskell.cabal +++ b/light-haskell.cabal @@ -52,14 +52,14 @@ executable light-haskell -- Other library packages from which modules are imported. build-depends: base (>=4.0 && <5), - network ==2.5.*, + network >=2.4, directory ==1.2.*, containers ==0.5.*, text ==1.1.*, bytestring ==0.10.*, aeson ==0.7.*, - process ==1.2.*, - ghc-mod ==5.1.*, + process >=1.1, + ghc-mod >=5.1, stylish-haskell ==0.5.* -- Directories containing source files.