Hello community,
here is the log from the commit of package ghc-typed-process for
openSUSE:Factory checked in at 2019-06-12 13:18:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-typed-process (Old)
and /work/SRC/openSUSE:Factory/.ghc-typed-process.new.4811 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-typed-process"
Wed Jun 12 13:18:53 2019 rev:8 rq:709205 version:0.2.4.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-typed-process/ghc-typed-process.changes
2019-01-25 22:43:38.791207407 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-typed-process.new.4811/ghc-typed-process.changes
2019-06-12 13:18:54.952562159 +0200
@@ -1,0 +2,8 @@
+Sat Jun 8 02:02:43 UTC 2019 - [email protected]
+
+- Update typed-process to version 0.2.4.1.
+ ## 0.2.4.1
+
+ * Fix a `Handle` leak in `withProcessInterleave` and its derivatives.
+
+-------------------------------------------------------------------
Old:
----
typed-process-0.2.4.0.tar.gz
New:
----
typed-process-0.2.4.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-typed-process.spec ++++++
--- /var/tmp/diff_new_pack.guWJZs/_old 2019-06-12 13:18:57.256561108 +0200
+++ /var/tmp/diff_new_pack.guWJZs/_new 2019-06-12 13:18:57.260561106 +0200
@@ -19,7 +19,7 @@
%global pkg_name typed-process
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.2.4.0
+Version: 0.2.4.1
Release: 0
Summary: Run external processes, with strong typing of streams
License: MIT
++++++ typed-process-0.2.4.0.tar.gz -> typed-process-0.2.4.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/typed-process-0.2.4.0/ChangeLog.md
new/typed-process-0.2.4.1/ChangeLog.md
--- old/typed-process-0.2.4.0/ChangeLog.md 2019-01-16 13:42:37.000000000
+0100
+++ new/typed-process-0.2.4.1/ChangeLog.md 2019-06-05 18:52:45.000000000
+0200
@@ -1,3 +1,7 @@
+## 0.2.4.1
+
+* Fix a `Handle` leak in `withProcessInterleave` and its derivatives.
+
## 0.2.4.0
* Add `readProcessInterleaved` and `readProcessInterleaved_` to support
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/typed-process-0.2.4.0/README.md
new/typed-process-0.2.4.1/README.md
--- old/typed-process-0.2.4.0/README.md 2018-08-14 11:32:26.000000000 +0200
+++ new/typed-process-0.2.4.1/README.md 2019-02-28 12:48:21.000000000 +0100
@@ -29,7 +29,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.IO (hPutStr, hClose)
import System.Process.Typed
@@ -85,7 +85,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
@@ -113,7 +113,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
@@ -129,7 +129,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
@@ -157,7 +157,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
@@ -189,7 +189,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
@@ -220,7 +220,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
@@ -234,7 +234,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
@@ -247,7 +247,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
@@ -265,7 +265,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
import System.Exit (ExitCode)
@@ -291,7 +291,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
import Data.ByteString.Lazy (ByteString)
@@ -312,12 +312,12 @@
from a process to a file. This is superior to the memory approach as
it does not have the risk of using large amounts of memory, though it
is more inconvenient. Together with the
-[`UnliftIO.Temporary`](https://www.stackage.org/haddock/lts-10.2/unliftio-0.2.2.0/UnliftIO-Temporary.html),
we
+[`UnliftIO.Temporary`](https://www.stackage.org/haddock/lts/unliftio/UnliftIO-Temporary.html),
we
can do some nice things:
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
import UnliftIO.Temporary (withSystemTempFile)
@@ -341,7 +341,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
import System.IO (hClose)
@@ -371,7 +371,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
@@ -383,7 +383,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
@@ -396,7 +396,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
import System.IO
@@ -422,7 +422,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
import System.IO
@@ -456,7 +456,7 @@
```haskell
#!/usr/bin/env stack
--- stack --resolver lts-10.2 script
+-- stack --resolver lts-12.21 script
{-# LANGUAGE OverloadedStrings #-}
import System.Process.Typed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/typed-process-0.2.4.0/src/System/Process/Typed.hs
new/typed-process-0.2.4.1/src/System/Process/Typed.hs
--- old/typed-process-0.2.4.0/src/System/Process/Typed.hs 2019-01-16
13:42:37.000000000 +0100
+++ new/typed-process-0.2.4.1/src/System/Process/Typed.hs 2019-06-05
18:52:45.000000000 +0200
@@ -3,7 +3,6 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Please see the README.md file for examples of using this API.
@@ -507,7 +506,7 @@
#if MIN_VERSION_process(1, 4, 0)
closed = mkStreamSpec P.NoStream (\_ Nothing -> pure ((), return ()))
#else
-closed = mkStreamSpec P.CreatePipe (\_ (Just h) -> (((), return ()) <$ hClose
h))
+closed = mkStreamSpec P.CreatePipe (\_ (Just h) -> ((), return ()) <$ hClose h)
#endif
-- | An input stream spec which sets the input to the given
@@ -636,7 +635,7 @@
if multiThreadedRuntime
then P.waitForProcess pHandle
else do
- switchTime <- (fromIntegral . (`div` 1000) . ctxtSwitchTime)
+ switchTime <- fromIntegral . (`div` 1000) . ctxtSwitchTime
<$> getConcFlags
let minDelay = 1
maxDelay = max minDelay switchTime
@@ -849,21 +848,20 @@
:: ProcessConfig stdin stdoutIgnored stderrIgnored
-> (Process stdin (STM L.ByteString) () -> IO a)
-> IO a
-withProcessInterleave pc inner = do
+withProcessInterleave pc inner =
-- Create a pipe to be shared for both stdout and stderr
- (readEnd, writeEnd) <- P.createPipe
-
- -- Use the writer end of the pipe for both stdout and stderr. For
- -- the stdout half, use byteStringFromHandle to read the data into
- -- a lazy ByteString in memory.
- let pc' = setStdout (mkStreamSpec (P.UseHandle writeEnd) (\pc'' Nothing ->
byteStringFromHandle pc'' readEnd))
- $ setStderr (useHandleOpen writeEnd)
- pc
- withProcess pc' $ \p -> do
- -- Now that the process is forked, close the writer end of this
- -- pipe, otherwise the reader end will never give an EOF.
- hClose writeEnd
- inner p
+ bracket P.createPipe (\(r, w) -> hClose r >> hClose w) $ \(readEnd,
writeEnd) -> do
+ -- Use the writer end of the pipe for both stdout and stderr. For
+ -- the stdout half, use byteStringFromHandle to read the data into
+ -- a lazy ByteString in memory.
+ let pc' = setStdout (mkStreamSpec (P.UseHandle writeEnd) (\pc''
Nothing -> byteStringFromHandle pc'' readEnd))
+ $ setStderr (useHandleOpen writeEnd)
+ pc
+ withProcess pc' $ \p -> do
+ -- Now that the process is forked, close the writer end of this
+ -- pipe, otherwise the reader end will never give an EOF.
+ hClose writeEnd
+ inner p
-- | Same as 'readProcess', but interleaves stderr with stdout.
--
@@ -891,7 +889,7 @@
=> ProcessConfig stdin stdoutIgnored stderrIgnored
-> m L.ByteString
readProcessInterleaved_ pc =
- liftIO $ do
+ liftIO $
withProcessInterleave pc $ \p -> atomically $ do
stdout' <- getStdout p
checkExitCodeSTM p `catchSTM` \ece -> throwSTM ece
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/typed-process-0.2.4.0/typed-process.cabal
new/typed-process-0.2.4.1/typed-process.cabal
--- old/typed-process-0.2.4.0/typed-process.cabal 2019-01-16
13:42:41.000000000 +0100
+++ new/typed-process-0.2.4.1/typed-process.cabal 2019-06-07
12:37:33.000000000 +0200
@@ -4,10 +4,10 @@
--
-- see: https://github.com/sol/hpack
--
--- hash: 11c70077cb1b56f53730fd5ab768dd6b89dd6c3850649afb4cae269796982aff
+-- hash: 377b4644a4d63eb0b81f60f4e7ec4b477eae658e463f90a600c923053da58712
name: typed-process
-version: 0.2.4.0
+version: 0.2.4.1
synopsis: Run external processes, with strong typing of streams
description: Please see the tutorial at
<https://haskell-lang.org/library/typed-process>
category: System