From b00b3ef0bbb6e934da5b1ac404cebd75d5c847aa Mon Sep 17 00:00:00 2001 From: Ben Gamari <ben@well-typed.com> Date: Wed, 12 Mar 2025 13:25:19 -0400 Subject: [PATCH] compiler: Add export list to GHC.SysTools.Process This also revealed that `readProcessEnvWithExitCode` and its local helpers were dead code. --- compiler/GHC/SysTools/Process.hs | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/compiler/GHC/SysTools/Process.hs b/compiler/GHC/SysTools/Process.hs index bb4129cdd40..37597da7add 100644 --- a/compiler/GHC/SysTools/Process.hs +++ b/compiler/GHC/SysTools/Process.hs @@ -6,7 +6,14 @@ -- (c) The GHC Team 2017 -- ----------------------------------------------------------------------------- -module GHC.SysTools.Process where +module GHC.SysTools.Process + ( readCreateProcessWithExitCode' + , getGccEnv + , runSomething + , runSomethingResponseFile + , runSomethingFiltered + , runSomethingWith + ) where import GHC.Prelude @@ -76,26 +83,6 @@ readCreateProcessWithExitCode' proc = do return (ex, output) -replaceVar :: (String, String) -> [(String, String)] -> [(String, String)] -replaceVar (var, value) env = - (var, value) : filter (\(var',_) -> var /= var') env - --- | Version of @System.Process.readProcessWithExitCode@ that takes a --- key-value tuple to insert into the environment. -readProcessEnvWithExitCode - :: String -- ^ program path - -> [String] -- ^ program args - -> (String, String) -- ^ addition to the environment - -> IO (ExitCode, String, String) -- ^ (exit_code, stdout, stderr) -readProcessEnvWithExitCode prog args env_update = do - current_env <- getEnvironment - readCreateProcessWithExitCode (proc prog args) { - env = Just (replaceVar env_update current_env) } "" - --- Don't let gcc localize version info string, #8825 -c_locale_env :: (String, String) -c_locale_env = ("LANGUAGE", "C") - -- If the -B<dir> option is set, add <dir> to PATH. This works around -- a bug in gcc on Windows Vista where it can't find its auxiliary -- binaries (see bug #1110). -- GitLab