Skip to content

Commit 0d7e9cc

Browse files
committed
Deprecate obsolete functions
1 parent 51c1ef4 commit 0d7e9cc

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

Cabal/src/Distribution/Compat/Process.hs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{-# LANGUAGE CPP #-}
22
module Distribution.Compat.Process (
33
-- * Redefined functions
4-
createProcess,
54
proc,
6-
runInteractiveProcess,
7-
rawSystem,
85
-- * Additions
96
enableProcessJobs,
7+
-- * Deprecated
8+
createProcess,
9+
runInteractiveProcess,
10+
rawSystem,
1011
) where
1112

1213
import System.Exit (ExitCode (..))
@@ -68,19 +69,22 @@ proc path args = enableProcessJobs (Process.proc path args) { Process.delegate_c
6869

6970
-- | 'System.Process.createProcess' with process jobs enabled when appropriate.
7071
-- See 'enableProcessJobs'.
72+
{-# DEPRECATED createProcess "use proc with System.Process.createProcess instead" #-}
7173
createProcess :: CreateProcess
7274
-> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
7375
createProcess = Process.createProcess . enableProcessJobs
7476

7577
-- | 'System.Process.rawSystem' with process jobs enabled when appropriate.
7678
-- See 'enableProcessJobs'.
79+
{-# DEPRECATED rawSystem "use one of the functions exported by Distribution.Simple.Utils instead" #-}
7780
rawSystem :: FilePath -> [String] -> IO ExitCode
7881
rawSystem path args = do
7982
(_,_,_,p) <- Process.createProcess (proc path args)
8083
Process.waitForProcess p
8184

8285
-- | 'System.Process.runInteractiveProcess' with process jobs enabled when
8386
-- appropriate. See 'enableProcessJobs'.
87+
{-# DEPRECATED runInteractiveProcess "use one of the functions exported by Distribution.Simple.Utils instead" #-}
8488
runInteractiveProcess
8589
:: FilePath -- ^ Filename of the executable (see 'RawCommand' for details)
8690
-> [String] -- ^ Arguments to pass to the executable

Cabal/src/Distribution/Simple/Utils.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module Distribution.Simple.Utils (
3838
debug, debugNoWrap,
3939
chattyTry,
4040
annotateIO,
41-
printRawCommandAndArgs, printRawCommandAndArgsAndEnv,
41+
logCommand,
4242
withOutputMarker,
4343

4444
-- * exceptions
@@ -55,7 +55,6 @@ module Distribution.Simple.Utils (
5555
rawSystemStdInOut,
5656
rawSystemIOWithEnv,
5757
rawSystemIOWithEnvAndAction,
58-
createProcessWithEnv,
5958
fromCreatePipe,
6059
maybeExit,
6160
xargs,
@@ -175,6 +174,10 @@ module Distribution.Simple.Utils (
175174
-- * FilePath stuff
176175
isAbsoluteOnAnyPlatform,
177176
isRelativeOnAnyPlatform,
177+
178+
-- * Deprecated
179+
printRawCommandAndArgs, printRawCommandAndArgsAndEnv,
180+
createProcessWithEnv,
178181
) where
179182

180183
import Prelude ()
@@ -735,10 +738,12 @@ maybeExit cmd = do
735738
exitcode <- cmd
736739
unless (exitcode == ExitSuccess) $ exitWith exitcode
737740

741+
{-# DEPRECATED printRawCommandAndArgs "use logCommand" #-}
738742
printRawCommandAndArgs :: Verbosity -> FilePath -> [String] -> IO ()
739743
printRawCommandAndArgs verbosity path args = withFrozenCallStack $ do
740744
logCommand verbosity (proc path args)
741745

746+
{-# DEPRECATED printRawCommandAndArgsAndEnv "use logCommand" #-}
742747
printRawCommandAndArgsAndEnv :: Verbosity
743748
-> FilePath
744749
-> [String]
@@ -888,6 +893,7 @@ rawSystemIOWithEnvAndAction verbosity path args mcwd menv action inp out err = w
888893
mbToStd :: Maybe Handle -> Process.StdStream
889894
mbToStd = maybe Process.Inherit Process.UseHandle
890895

896+
{-# DEPRECATED createProcessWithEnv "use System.Process.createProcess with Distribution.Compat.Process.proc instead" #-}
891897
createProcessWithEnv ::
892898
Verbosity
893899
-> FilePath

cabal-testsuite/src/Test/Cabal/Server.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ startServer chan senv = do
226226
std_out = CreatePipe,
227227
std_err = CreatePipe
228228
}
229-
-- printRawCommandAndArgsAndEnv (runnerVerbosity senv) (programPath prog) ghc_args Nothing
230229
when (verbosity >= verbose) $
231230
writeChan chan (ServerLogMsg AllServers (showCommandForUser (programPath prog) ghc_args))
232231
(Just hin, Just hout, Just herr, proch) <- createProcess proc_spec

0 commit comments

Comments
 (0)