Skip to content

Commit 974c14c

Browse files
committed
Remove newly deprecated functions
1 parent 0d7e9cc commit 974c14c

File tree

2 files changed

+1
-88
lines changed

2 files changed

+1
-88
lines changed

Cabal/src/Distribution/Compat/Process.hs

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,9 @@ module Distribution.Compat.Process (
44
proc,
55
-- * Additions
66
enableProcessJobs,
7-
-- * Deprecated
8-
createProcess,
9-
runInteractiveProcess,
10-
rawSystem,
117
) where
128

13-
import System.Exit (ExitCode (..))
14-
import System.IO (Handle)
15-
16-
import System.Process (CreateProcess, ProcessHandle)
9+
import System.Process (CreateProcess)
1710
import qualified System.Process as Process
1811

1912
#if defined(mingw32_HOST_OS) && MIN_VERSION_process(1,6,9)
@@ -66,39 +59,3 @@ enableProcessJobs cp = cp
6659
-- and defaulting 'delegate_ctlc' to 'True'.
6760
proc :: FilePath -> [String] -> CreateProcess
6861
proc path args = enableProcessJobs (Process.proc path args) { Process.delegate_ctlc = True }
69-
70-
-- | 'System.Process.createProcess' with process jobs enabled when appropriate.
71-
-- See 'enableProcessJobs'.
72-
{-# DEPRECATED createProcess "use proc with System.Process.createProcess instead" #-}
73-
createProcess :: CreateProcess
74-
-> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
75-
createProcess = Process.createProcess . enableProcessJobs
76-
77-
-- | 'System.Process.rawSystem' with process jobs enabled when appropriate.
78-
-- See 'enableProcessJobs'.
79-
{-# DEPRECATED rawSystem "use one of the functions exported by Distribution.Simple.Utils instead" #-}
80-
rawSystem :: FilePath -> [String] -> IO ExitCode
81-
rawSystem path args = do
82-
(_,_,_,p) <- Process.createProcess (proc path args)
83-
Process.waitForProcess p
84-
85-
-- | 'System.Process.runInteractiveProcess' with process jobs enabled when
86-
-- appropriate. See 'enableProcessJobs'.
87-
{-# DEPRECATED runInteractiveProcess "use one of the functions exported by Distribution.Simple.Utils instead" #-}
88-
runInteractiveProcess
89-
:: FilePath -- ^ Filename of the executable (see 'RawCommand' for details)
90-
-> [String] -- ^ Arguments to pass to the executable
91-
-> Maybe FilePath -- ^ Optional path to the working directory
92-
-> Maybe [(String,String)] -- ^ Optional environment (otherwise inherit)
93-
-> IO (Handle,Handle,Handle,ProcessHandle)
94-
runInteractiveProcess path args mb_cwd mb_env = do
95-
(mb_in, mb_out, mb_err, p) <-
96-
Process.createProcess (proc path args)
97-
{ Process.std_in = Process.CreatePipe,
98-
Process.std_out = Process.CreatePipe,
99-
Process.std_err = Process.CreatePipe,
100-
Process.env = mb_env,
101-
Process.cwd = mb_cwd }
102-
return (fromJust mb_in, fromJust mb_out, fromJust mb_err, p)
103-
where
104-
fromJust = maybe (error "runInteractiveProcess: fromJust") id

Cabal/src/Distribution/Simple/Utils.hs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ module Distribution.Simple.Utils (
3838
debug, debugNoWrap,
3939
chattyTry,
4040
annotateIO,
41-
logCommand,
4241
withOutputMarker,
4342

4443
-- * exceptions
@@ -174,10 +173,6 @@ module Distribution.Simple.Utils (
174173
-- * FilePath stuff
175174
isAbsoluteOnAnyPlatform,
176175
isRelativeOnAnyPlatform,
177-
178-
-- * Deprecated
179-
printRawCommandAndArgs, printRawCommandAndArgsAndEnv,
180-
createProcessWithEnv,
181176
) where
182177

183178
import Prelude ()
@@ -241,7 +236,6 @@ import Foreign.C.Error (Errno (..), ePIPE)
241236
import Data.Time.Clock.POSIX (getPOSIXTime, POSIXTime)
242237
import Numeric (showFFloat)
243238
import Distribution.Compat.Process (proc)
244-
import System.Process (ProcessHandle)
245239
import qualified System.Process as Process
246240
import qualified GHC.IO.Exception as GHC
247241

@@ -738,21 +732,6 @@ maybeExit cmd = do
738732
exitcode <- cmd
739733
unless (exitcode == ExitSuccess) $ exitWith exitcode
740734

741-
{-# DEPRECATED printRawCommandAndArgs "use logCommand" #-}
742-
printRawCommandAndArgs :: Verbosity -> FilePath -> [String] -> IO ()
743-
printRawCommandAndArgs verbosity path args = withFrozenCallStack $ do
744-
logCommand verbosity (proc path args)
745-
746-
{-# DEPRECATED printRawCommandAndArgsAndEnv "use logCommand" #-}
747-
printRawCommandAndArgsAndEnv :: Verbosity
748-
-> FilePath
749-
-> [String]
750-
-> Maybe FilePath
751-
-> Maybe [(String, String)]
752-
-> IO ()
753-
printRawCommandAndArgsAndEnv verbosity path args mcwd menv = withFrozenCallStack $ do
754-
logCommand verbosity (proc path args) { Process.cwd = mcwd, Process.env = menv }
755-
756735
-- | Log a command execution (that's typically about to happen)
757736
-- at info level, and log working directory and environment overrides
758737
-- at debug level if specified.
@@ -893,29 +872,6 @@ rawSystemIOWithEnvAndAction verbosity path args mcwd menv action inp out err = w
893872
mbToStd :: Maybe Handle -> Process.StdStream
894873
mbToStd = maybe Process.Inherit Process.UseHandle
895874

896-
{-# DEPRECATED createProcessWithEnv "use System.Process.createProcess with Distribution.Compat.Process.proc instead" #-}
897-
createProcessWithEnv ::
898-
Verbosity
899-
-> FilePath
900-
-> [String]
901-
-> Maybe FilePath -- ^ New working dir or inherit
902-
-> Maybe [(String, String)] -- ^ New environment or inherit
903-
-> Process.StdStream -- ^ stdin
904-
-> Process.StdStream -- ^ stdout
905-
-> Process.StdStream -- ^ stderr
906-
-> IO (Maybe Handle, Maybe Handle, Maybe Handle,ProcessHandle)
907-
-- ^ Any handles created for stdin, stdout, or stderr
908-
-- with 'CreateProcess', and a handle to the process.
909-
createProcessWithEnv verbosity path args mcwd menv inp out err = withFrozenCallStack $ do
910-
let cp = (proc path args) { Process.cwd = mcwd
911-
, Process.env = menv
912-
, Process.std_in = inp
913-
, Process.std_out = out
914-
, Process.std_err = err
915-
}
916-
logCommand verbosity cp
917-
Process.createProcess cp
918-
919875
-- | Execute the given command with the given arguments, returning
920876
-- the command's output. Exits if the command exits with error.
921877
--

0 commit comments

Comments
 (0)