Disable stack support for ghc <7.8

This commit is contained in:
Daniel Gröber 2015-11-26 19:21:15 +01:00
parent 1c0c97bdbb
commit 16c69b2743
2 changed files with 7 additions and 0 deletions

View File

@ -79,6 +79,10 @@ cabalCradle wdir = do
stackCradle :: (IOish m, GmOut m) => FilePath -> MaybeT m Cradle
stackCradle wdir = do
#if !MIN_VERSION_ghc(7,8,0)
-- GHC < 7.8 is not supported by stack
mzero
#endif
cabalFile <- MaybeT $ liftIO $ findCabalFile wdir
let cabalDir = takeDirectory cabalFile

View File

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
module CabalHelperSpec where
import Control.Arrow
@ -57,11 +58,13 @@ spec = do
then forM_ opts (\o -> o `shouldContain` ["-no-user-package-conf","-package-conf", cwd </> "test/data/cabal-project/.cabal-sandbox/"++ghcSandboxPkgDbDir bp])
else forM_ opts (\o -> o `shouldContain` ["-no-user-package-db","-package-db",cwd </> "test/data/cabal-project/.cabal-sandbox/"++ghcSandboxPkgDbDir bp])
#if !MIN_VERSION_ghc(7,8,0)
it "handles stack project" $ do
let tdir = "test/data/stack-project"
[ghcOpts] <- map gmcGhcOpts . filter ((==ChExeName "new-template-exe") . gmcName) <$> runD' tdir getComponents
let pkgs = pkgOptions ghcOpts
sort pkgs `shouldBe` ["base", "bytestring"]
#endif
it "extracts build dependencies" $ do
let tdir = "test/data/cabal-project"