From 245e797f27f9fcd7400684b966dbe2ee7f48d4ad Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 20 Nov 2016 12:59:34 +0200 Subject: [PATCH] Replace enclosed-exceptions with safe-exceptions Fixes #2768 --- ChangeLog.md | 2 ++ src/Network/HTTP/Download.hs | 2 +- src/Stack/Build/Cache.hs | 2 +- src/Stack/Build/Execute.hs | 2 +- src/Stack/Coverage.hs | 2 +- src/Stack/Fetch.hs | 2 +- src/Stack/FileWatch.hs | 2 +- src/Stack/Ghci.hs | 2 +- src/Stack/Init.hs | 2 +- src/Stack/PackageDump.hs | 2 +- src/Stack/PackageIndex.hs | 2 +- src/Stack/Setup.hs | 2 +- src/Stack/Solver.hs | 2 +- stack.cabal | 2 +- 14 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index e2d4edff46..ed0adfed0e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -77,6 +77,8 @@ Other enhancements: [#1521](https://github.com/commercialhaskell/stack/issues/1521) * No longer warns about missing build-tools if they are on the PATH. [#2235](https://github.com/commercialhaskell/stack/issues/2235) +* Replace enclosed-exceptions with safe-exceptions. + [#2768](https://github.com/commercialhaskell/stack/issues/2768) Bug fixes: diff --git a/src/Network/HTTP/Download.hs b/src/Network/HTTP/Download.hs index 2fe5f41514..9391e6c85f 100644 --- a/src/Network/HTTP/Download.hs +++ b/src/Network/HTTP/Download.hs @@ -25,7 +25,7 @@ module Network.HTTP.Download ) where import Control.Exception (Exception) -import Control.Exception.Enclosed (handleIO) +import Control.Exception.Safe (handleIO) import Control.Monad (void) import Control.Monad.Catch (MonadMask, throwM) import Control.Monad.IO.Class (MonadIO, liftIO) diff --git a/src/Stack/Build/Cache.hs b/src/Stack/Build/Cache.hs index 5095930a26..9969a68501 100644 --- a/src/Stack/Build/Cache.hs +++ b/src/Stack/Build/Cache.hs @@ -33,7 +33,7 @@ module Stack.Build.Cache import Control.Applicative import Control.DeepSeq (NFData) -import Control.Exception.Enclosed (handleIO, tryAnyDeep) +import Control.Exception.Safe (handleIO, tryAnyDeep) import Control.Monad (liftM) import Control.Monad.Catch (MonadThrow, MonadCatch) import Control.Monad.IO.Class diff --git a/src/Stack/Build/Execute.hs b/src/Stack/Build/Execute.hs index 8c3ab2f7b4..ff62ca8d52 100644 --- a/src/Stack/Build/Execute.hs +++ b/src/Stack/Build/Execute.hs @@ -23,7 +23,7 @@ import Control.Arrow ((&&&), second) import Control.Concurrent.Execute import Control.Concurrent.MVar.Lifted import Control.Concurrent.STM -import Control.Exception.Enclosed (catchIO) +import Control.Exception.Safe (catchIO) import Control.Exception.Lifted import Control.Monad (liftM, when, unless, void) import Control.Monad.Catch (MonadCatch) diff --git a/src/Stack/Coverage.hs b/src/Stack/Coverage.hs index de75350610..8a38c7f0b7 100644 --- a/src/Stack/Coverage.hs +++ b/src/Stack/Coverage.hs @@ -17,7 +17,7 @@ module Stack.Coverage ) where import Control.Applicative -import Control.Exception.Enclosed (handleIO) +import Control.Exception.Safe (handleIO) import Control.Exception.Lifted import Control.Monad (liftM, when, unless, void, (<=<)) import Control.Monad.IO.Class diff --git a/src/Stack/Fetch.hs b/src/Stack/Fetch.hs index 177a465f9e..7e04a97291 100644 --- a/src/Stack/Fetch.hs +++ b/src/Stack/Fetch.hs @@ -34,7 +34,7 @@ import Control.Concurrent.Async (Concurrently (..)) import Control.Concurrent.MVar.Lifted (modifyMVar, newMVar) import Control.Concurrent.STM import Control.Exception (assert) -import Control.Exception.Enclosed (tryIO) +import Control.Exception.Safe (tryIO) import Control.Monad (join, liftM, unless, void, when) import Control.Monad.Catch import Control.Monad.IO.Class diff --git a/src/Stack/FileWatch.hs b/src/Stack/FileWatch.hs index e17d375319..97fa7e2864 100644 --- a/src/Stack/FileWatch.hs +++ b/src/Stack/FileWatch.hs @@ -11,7 +11,7 @@ import Blaze.ByteString.Builder.Char.Utf8 (fromShow) import Control.Concurrent.Async (race_) import Control.Concurrent.STM import Control.Exception (Exception, fromException) -import Control.Exception.Enclosed (tryAny) +import Control.Exception.Safe (tryAny) import Control.Monad (forever, unless, when) import qualified Data.ByteString.Lazy as L import qualified Data.Map.Strict as Map diff --git a/src/Stack/Ghci.hs b/src/Stack/Ghci.hs index 203a8d51d5..d804a85cde 100644 --- a/src/Stack/Ghci.hs +++ b/src/Stack/Ghci.hs @@ -22,7 +22,7 @@ module Stack.Ghci import Control.Applicative import Control.Arrow (second) -import Control.Exception.Enclosed (tryAny) +import Control.Exception.Safe (tryAny) import Control.Monad hiding (forM) import Control.Monad.Catch import Control.Monad.IO.Class diff --git a/src/Stack/Init.hs b/src/Stack/Init.hs index 75e7b38cc7..f071141ccc 100644 --- a/src/Stack/Init.hs +++ b/src/Stack/Init.hs @@ -9,7 +9,7 @@ module Stack.Init ) where import Control.Exception (assert) -import Control.Exception.Enclosed (catchAny) +import Control.Exception.Safe (catchAny) import Control.Monad import Control.Monad.Catch (throwM) import Control.Monad.IO.Class diff --git a/src/Stack/PackageDump.hs b/src/Stack/PackageDump.hs index bdf087b3ea..54921b36b8 100644 --- a/src/Stack/PackageDump.hs +++ b/src/Stack/PackageDump.hs @@ -25,7 +25,7 @@ module Stack.PackageDump import Control.Applicative import Control.Arrow ((&&&)) -import Control.Exception.Enclosed (tryIO) +import Control.Exception.Safe (tryIO) import Control.Monad (liftM) import Control.Monad.Catch import Control.Monad.IO.Class diff --git a/src/Stack/PackageIndex.hs b/src/Stack/PackageIndex.hs index 98ad0ce56f..78313fd964 100644 --- a/src/Stack/PackageIndex.hs +++ b/src/Stack/PackageIndex.hs @@ -29,7 +29,7 @@ module Stack.PackageIndex import qualified Codec.Archive.Tar as Tar import Control.Exception (Exception) -import Control.Exception.Enclosed (tryIO) +import Control.Exception.Safe (tryIO) import Control.Monad (unless, when, liftM, void) import Control.Monad.Catch (throwM) import qualified Control.Monad.Catch as C diff --git a/src/Stack/Setup.hs b/src/Stack/Setup.hs index 52e02deae5..128c7fe412 100644 --- a/src/Stack/Setup.hs +++ b/src/Stack/Setup.hs @@ -24,7 +24,7 @@ module Stack.Setup import Control.Applicative import Control.Concurrent.Async.Lifted (Concurrently(..)) -import Control.Exception.Enclosed (catchIO, tryAny) +import Control.Exception.Safe (catchIO, tryAny) import Control.Monad (liftM, when, join, void, unless) import Control.Monad.Catch import Control.Monad.IO.Class (MonadIO, liftIO) diff --git a/src/Stack/Solver.hs b/src/Stack/Solver.hs index c28473a5ca..7b11489147 100644 --- a/src/Stack/Solver.hs +++ b/src/Stack/Solver.hs @@ -22,7 +22,7 @@ import Prelude.Compat import Control.Applicative import Control.Exception (assert) -import Control.Exception.Enclosed (tryIO) +import Control.Exception.Safe (tryIO) import Control.Monad (when,void,join,liftM,unless,mapAndUnzipM, zipWithM_) import Control.Monad.Catch import Control.Monad.IO.Class diff --git a/stack.cabal b/stack.cabal index e9f5b432c0..a45a990678 100644 --- a/stack.cabal +++ b/stack.cabal @@ -199,7 +199,6 @@ library , cryptohash-conduit , directory >= 1.2.1.0 , either - , enclosed-exceptions , errors < 2.2 , exceptions >= 0.8.0.2 , extra < 1.6 @@ -238,6 +237,7 @@ library , resourcet >= 1.1.4.1 , retry >= 0.6 && < 0.8 , safe >= 0.3 + , safe-exceptions , semigroups >= 0.5 && < 0.19 , split , stm >= 2.4.4