Hello community, here is the log from the commit of package ghc-async for openSUSE:Factory checked in at 2019-06-12 13:18:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-async (Old) and /work/SRC/openSUSE:Factory/.ghc-async.new.4811 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-async" Wed Jun 12 13:18:26 2019 rev:17 rq:709196 version:2.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-async/ghc-async.changes 2018-10-25 08:21:17.327939798 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-async.new.4811/ghc-async.changes 2019-06-12 13:18:27.728574593 +0200 @@ -1,0 +2,11 @@ +Fri Jun 7 02:01:43 UTC 2019 - psim...@suse.com + +- Update async to version 2.2.2. + ## Changes in 2.2.2: + + - Builds with GHC 8.6.x + - linkOnly and link2Only are now exported + - wait now has the same behaviour with BlockedIndefinitelyOnSTM as waitCatch + - Documentation fixes + +------------------------------------------------------------------- Old: ---- async-2.2.1.tar.gz async.cabal New: ---- async-2.2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-async.spec ++++++ --- /var/tmp/diff_new_pack.qfsG8v/_old 2019-06-12 13:18:28.208574373 +0200 +++ /var/tmp/diff_new_pack.qfsG8v/_new 2019-06-12 13:18:28.208574373 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-async # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,14 +19,13 @@ %global pkg_name async %bcond_with tests Name: ghc-%{pkg_name} -Version: 2.2.1 +Version: 2.2.2 Release: 0 Summary: Run IO operations asynchronously and wait for their results License: BSD-3-Clause Group: Development/Libraries/Haskell URL: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz -Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-hashable-devel BuildRequires: ghc-rpm-macros @@ -65,7 +64,6 @@ %prep %setup -q -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ async-2.2.1.tar.gz -> async-2.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/async-2.2.1/Control/Concurrent/Async.hs new/async-2.2.2/Control/Concurrent/Async.hs --- old/async-2.2.1/Control/Concurrent/Async.hs 2018-02-04 17:37:42.000000000 +0100 +++ new/async-2.2.2/Control/Concurrent/Async.hs 2019-06-06 09:11:39.000000000 +0200 @@ -117,7 +117,7 @@ waitBothSTM, -- ** Linking - link, link2, ExceptionInLinkedThread(..), + link, linkOnly, link2, link2Only, ExceptionInLinkedThread(..), -- * Convenient utilities race, race_, @@ -185,7 +185,7 @@ instance Functor Async where fmap f (Async a w) = Async a (fmap (fmap f) w) --- | Compare two 'Async's that may have different types +-- | Compare two Asyncs that may have different types by their ThreadId. compareAsyncs :: Async a -> Async b -> Ordering compareAsyncs (Async t1 _) (Async t2 _) = compare t1 t2 @@ -230,7 +230,7 @@ -- -- > withAsync action inner = mask $ \restore -> do -- > a <- async (restore action) --- > restore inner `finally` uninterruptibleCancel a +-- > restore (inner a) `finally` uninterruptibleCancel a -- -- This is a useful variant of 'async' that ensures an @Async@ is -- never left running unintentionally. @@ -289,7 +289,10 @@ -- {-# INLINE wait #-} wait :: Async a -> IO a -wait = atomically . waitSTM +wait = tryAgain . atomically . waitSTM + where + -- See: https://github.com/simonmar/async/issues/14 + tryAgain f = f `catch` \BlockedIndefinitelyOnSTM -> f -- | Wait for an asynchronous action to complete, and return either -- @Left e@ if the action raised an exception @e@, or @Right a@ if it @@ -537,8 +540,12 @@ #endif instance Show ExceptionInLinkedThread where - show (ExceptionInLinkedThread (Async t _) e) = - "ExceptionInLinkedThread " ++ show t ++ " " ++ show e + showsPrec p (ExceptionInLinkedThread (Async t _) e) = + showParen (p >= 11) $ + showString "ExceptionInLinkedThread " . + showsPrec 11 t . + showString " " . + showsPrec 11 e instance Exception ExceptionInLinkedThread where #if __GLASGOW_HASKELL__ >= 708 @@ -559,9 +566,10 @@ -- | Link the given @Async@ to the current thread, such that if the -- @Async@ raises an exception, that exception will be re-thrown in --- the current thread. The supplied predicate determines which --- exceptions in the target thread should be propagated to the source --- thread. +-- the current thread, wrapped in 'ExceptionInLinkedThread'. +-- +-- The supplied predicate determines which exceptions in the target +-- thread should be propagated to the source thread. -- linkOnly :: (SomeException -> Bool) -- ^ return 'True' if the exception @@ -588,6 +596,13 @@ link2 :: Async a -> Async b -> IO () link2 = link2Only (not . isCancel) +-- | Link two @Async@s together, such that if either raises an +-- exception, the same exception is re-thrown in the other @Async@, +-- wrapped in 'ExceptionInLinkedThread'. +-- +-- The supplied predicate determines which exceptions in the target +-- thread should be propagated to the source thread. +-- link2Only :: (SomeException -> Bool) -> Async a -> Async b -> IO () link2Only shouldThrow left@(Async tl _) right@(Async tr _) = void $ forkRepeat $ do @@ -755,12 +770,12 @@ forConcurrently = flip mapConcurrently -- | `mapConcurrently_` is `mapConcurrently` with the return value discarded, --- just like @mapM_ +-- just like @mapM_@. mapConcurrently_ :: F.Foldable f => (a -> IO b) -> f a -> IO () mapConcurrently_ f = runConcurrently . F.foldMap (Concurrently . void . f) -- | `forConcurrently_` is `forConcurrently` with the return value discarded, --- just like @forM_ +-- just like @forM_@. forConcurrently_ :: F.Foldable f => f a -> (a -> IO b) -> IO () forConcurrently_ = flip mapConcurrently_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/async-2.2.1/async.cabal new/async-2.2.2/async.cabal --- old/async-2.2.1/async.cabal 2018-02-04 17:37:42.000000000 +0100 +++ new/async-2.2.2/async.cabal 2019-06-06 09:11:39.000000000 +0200 @@ -1,5 +1,5 @@ name: async -version: 2.2.1 +version: 2.2.2 -- don't forget to update ./changelog.md! synopsis: Run IO operations asynchronously and wait for their results @@ -34,7 +34,7 @@ cabal-version: >=1.10 homepage: https://github.com/simonmar/async bug-reports: https://github.com/simonmar/async/issues -tested-with: GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4 +tested-with: GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4 extra-source-files: changelog.md @@ -50,14 +50,14 @@ if impl(ghc>=7.1) other-extensions: Trustworthy exposed-modules: Control.Concurrent.Async - build-depends: base >= 4.3 && < 4.12, hashable >= 1.1.1.0 && < 1.3, stm >= 2.2 && < 2.5 + build-depends: base >= 4.3 && < 4.14, hashable >= 1.1.2.0 && < 1.4, stm >= 2.2 && < 2.6 test-suite test-async default-language: Haskell2010 type: exitcode-stdio-1.0 hs-source-dirs: test main-is: test-async.hs - build-depends: base >= 4.3 && < 4.12, + build-depends: base >= 4.3 && < 4.14, async, stm, test-framework, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/async-2.2.1/changelog.md new/async-2.2.2/changelog.md --- old/async-2.2.1/changelog.md 2018-02-04 17:37:42.000000000 +0100 +++ new/async-2.2.2/changelog.md 2019-06-06 09:11:39.000000000 +0200 @@ -1,3 +1,10 @@ +## Changes in 2.2.2: + + - Builds with GHC 8.6.x + - linkOnly and link2Only are now exported + - wait now has the same behaviour with BlockedIndefinitelyOnSTM as waitCatch + - Documentation fixes + ## Changes in 2.2.1: - Add a Hashable instance for Async diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/async-2.2.1/test/test-async.hs new/async-2.2.2/test/test-async.hs --- old/async-2.2.1/test/test-async.hs 2018-02-04 17:37:42.000000000 +0100 +++ new/async-2.2.2/test/test-async.hs 2019-06-06 09:11:39.000000000 +0200 @@ -34,6 +34,7 @@ , testCase "async_poll" async_poll , testCase "async_poll2" async_poll2 , testCase "withasync_waitCatch_blocked" withasync_waitCatch_blocked + , testCase "withasync_wait_blocked" withasync_wait_blocked , testGroup "children surviving too long" [ testCase "concurrently+success" concurrently_success , testCase "concurrently+failure" concurrently_failure @@ -143,6 +144,16 @@ case r of Left e -> case fromException e of + Just BlockedIndefinitelyOnMVar -> return () + Nothing -> assertFailure $ show e + Right () -> assertFailure "" + +withasync_wait_blocked :: Assertion +withasync_wait_blocked = do + r <- try $ withAsync (newEmptyMVar >>= takeMVar) wait + case r of + Left e -> + case fromException e of Just BlockedIndefinitelyOnMVar -> return () Nothing -> assertFailure $ show e Right () -> assertFailure ""