Skip to content

Commit

Permalink
Fix build on GHC 7.8 and GHC 8.0
Browse files Browse the repository at this point in the history
Unfortunately, this undoes 19a9a67
because I got a mysterious assertion failure
otherwise (to-be-investigated)
  • Loading branch information
mgsloan committed May 25, 2016
1 parent 12ec101 commit 503739a
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 20 deletions.
2 changes: 2 additions & 0 deletions src/Data/Store/VersionTagged.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Data.Store.VersionTagged
, decodeFileMaybe
) where

import Control.Applicative
import Control.Exception.Lifted (catch, IOException, assert)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Logger
Expand All @@ -23,6 +24,7 @@ import Data.Store.TypeHash
import qualified Data.Text as T
import Path
import Path.IO (ensureDir)
import Prelude

-- | Write to the given file, with a binary-tagged tag.
taggedEncodeFile :: (Store a, HasTypeHash a, MonadIO m, MonadLogger m, Eq a)
Expand Down
5 changes: 4 additions & 1 deletion src/Stack/Build/Cache.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ module Stack.Build.Cache

import Control.DeepSeq (NFData)
import Control.Exception.Enclosed (handleIO, tryAnyDeep)
import Control.Monad (liftM)
import Control.Monad.Catch (MonadThrow, MonadCatch)
import Control.Monad.IO.Class
import Control.Monad.Logger (MonadLogger, logDebug)
import Control.Monad.Reader
import Control.Monad.Reader (MonadReader, asks)
import Control.Monad.Trans.Control (MonadBaseControl)
import qualified Crypto.Hash.SHA256 as SHA256
import Data.Binary (Binary (..))
Expand All @@ -47,6 +48,7 @@ import qualified Data.ByteString.Base16 as B16
import qualified Data.ByteString.Base64.URL as B64URL
import qualified Data.ByteString.Char8 as S8
import qualified Data.ByteString.Lazy as LBS
import Data.Foldable (forM_)
import Data.Map (Map)
import Data.Maybe (fromMaybe, mapMaybe)
import Data.Monoid ((<>))
Expand All @@ -58,6 +60,7 @@ import Data.Store.TypeHash (HasTypeHash, mkManyHasTypeHash)
import Data.Store.VersionTagged
import Data.Text (Text)
import qualified Data.Text as T
import Data.Traversable (forM)
import GHC.Generics (Generic)
import Path
import Path.IO
Expand Down
9 changes: 5 additions & 4 deletions src/Stack/Types/StackT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,11 @@ stickyLoggerFunc loc src level msg = do
getStickyLoggerFunc
:: (HasSticky r, HasLogLevel r, HasSupportsUnicode r, ToLogStr msg, MonadReader r m, MonadIO m)
=> m (Loc -> LogSource -> LogLevel -> msg -> IO ())
getStickyLoggerFunc = stickyLoggerFuncImpl
<$> asks getSticky
<*> asks getLogLevel
<*> asks getSupportsUnicode
getStickyLoggerFunc = do
sticky <- asks getSticky
logLevel <- asks getLogLevel
supportsUnicode <- asks getSupportsUnicode
return $ stickyLoggerFuncImpl sticky logLevel supportsUnicode

stickyLoggerFuncImpl
:: ToLogStr msg
Expand Down
4 changes: 3 additions & 1 deletion src/test/Stack/StoreSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{-# LANGUAGE OverloadedStrings #-}
module Stack.StoreSpec where

import Control.Applicative
import qualified Data.ByteString as BS
import Data.Containers (mapFromList, setFromList)
import Data.Int
Expand All @@ -19,11 +20,12 @@ import qualified Data.Vector.Unboxed as UV
import Data.Word
import Language.Haskell.TH
import Language.Haskell.TH.ReifyMany
import Prelude
import Stack.Build.Cache (BuildCache(..))
import Stack.PackageDump
import Stack.Types
import Test.Hspec
import Test.SmallCheck.Series
import Stack.Build.Cache (BuildCache(..))

-- NOTE: these were copied from Data.Store. Should probably be moved to
-- smallcheck.
Expand Down
71 changes: 61 additions & 10 deletions stack-7.8.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,66 @@
resolver: nightly-2016-05-13
compiler: ghc-7.8.4
resolver: lts-2.22
# docker:
# enable: true
# repo: fpco/stack-full
# image:
# containers:
# - base: "fpco/stack-base" # see ./etc/docker/stack-base/Dockerfile
# name: "fpco/stack-test"
extra-deps:
- Cabal-1.18.1.7
- filepath-1.3.0.2
- path-0.5.7
- path-io-1.1.0
- directory-1.2.2.0
- Win32-notify-0.3.0.1
- hfsevents-0.1.5
- project-template-0.2.0
- filelock-0.1.0.1
- gitrev-1.2.0
- http-client-0.4.19
- http-conduit-2.1.8
- ignore-0.1.1.0
- binary-tagged-0.1.3.1
- fsnotify-0.2.1
- ansi-terminal-0.6.2.3
# For deepseq-1.4
- deepseq-1.4.1.2
- aeson-0.11.2.0
- bytestring-0.10.6.0
- Cabal-1.18.1.6
- containers-0.5.6.3
- hpc-0.6.0.2
- process-1.2.1.0
- time-1.5.0.1
- base-compat-0.9.0
- hpack-0.14.0
- QuickCheck-2.8.2
- nats-1
- microlens-0.4.1.0
- open-browser-0.2.1.0
- tls-1.3.8
- cryptonite-0.15 # for tls-1.3.5
- memory-0.12
- asn1-parse-0.9.4
- asn1-types-0.3.2
- x509-1.6.3
- x509-validation-1.6.3
- x509-store-1.6.1
- x509-system-1.6.3
- http-client-tls-0.2.4
- connection-0.2.5
- regex-applicative-text-0.1.0.1
- monad-unlift-0.1.1.0
- attoparsec-0.13.0.2
- fail-4.9.0.0
- tagged-0.8.4
- persistent-template-2.1.8.1
- aeson-compat-0.3.3.0
- http-api-data-0.2.2
- time-locale-compat-0.1.1.1
- persistent-2.5
- store-0.1.0.1
- th-reify-many-0.1.6
- th-utilities-0.1.0.1
- store-0.1.0.0
- th-lift-instances-0.1.7
- th-utilities-0.1.1.0
- th-orphans-0.13.1
- base-orphans-0.5.4
flags:
QuickCheck:
base4point8: false
time-locale-compat:
old-locale: false
3 changes: 2 additions & 1 deletion stack-8.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ extra-deps:
- transformers-0.5.2.0
- transformers-compat-0.5.1.4
- unix-2.7.2.0
- th-lift-instances-0.1.7
- th-reify-many-0.1.6
- th-utilities-0.1.0.1
- store-0.1.0.0
- store-0.1.0.1
- th-orphans-0.13.1
packages:
- .
Expand Down
6 changes: 3 additions & 3 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ nix:
extra-deps:
- hpack-0.14.0
- path-io-1.1.0
- th-lift-instances-0.1.6
- th-lift-instances-0.1.7
- aeson-0.11.2.0
- th-reify-many-0.1.6
- th-utilities-0.1.0.1
- store-0.1.0.0
- th-utilities-0.1.1.0
- store-0.1.0.1
- th-orphans-0.13.1

0 comments on commit 503739a

Please sign in to comment.