From 23864c59abfc6dad5a6b137941d618903817e1e3 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sun, 4 Aug 2019 21:14:45 +0200 Subject: Allow passing override-env to process functions Unfortunately we need this to pass a custom GHC executable path to stack, since it doesn't have an option to override it on the commandline (yet?). --- src/CabalHelper/Compiletime/Program/Stack.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/CabalHelper/Compiletime/Program/Stack.hs') diff --git a/src/CabalHelper/Compiletime/Program/Stack.hs b/src/CabalHelper/Compiletime/Program/Stack.hs index 3cdf87b..896c73e 100644 --- a/src/CabalHelper/Compiletime/Program/Stack.hs +++ b/src/CabalHelper/Compiletime/Program/Stack.hs @@ -112,14 +112,14 @@ listPackageCabalFiles qe@QueryEnv{qeProjLoc=ProjLocStackYaml stack_yaml} workdirArg :: QueryEnvI c 'Stack -> [String] workdirArg QueryEnv{qeDistDir=DistDirStack mworkdir} = maybeToList $ ("--work-dir="++) . unRelativePath <$> mworkdir -workdirArg QueryEnv{qeDistDir=DistDirCabal{}} = - error "workdirArg: TODO: this case is impossible and should not produce an exhaustiveness warning anymore starting with GHC 8.8" -doStackCmd :: (QueryEnvI c 'Stack -> CallProcessWithCwd a) - -> QueryEnvI c 'Stack -> Maybe FilePath -> [String] -> IO a +doStackCmd :: (QueryEnvI c 'Stack -> CallProcessWithCwdAndEnv a) + -> QueryEnvI c 'Stack + -> Maybe FilePath -> [String] -> IO a doStackCmd procfn qe mcwd args = let Programs{..} = qePrograms qe in - procfn qe mcwd stackProgram $ stackArgsBefore ++ args ++ stackArgsAfter + procfn qe mcwd stackEnv stackProgram $ + stackArgsBefore ++ args ++ stackArgsAfter readStackCmd :: QueryEnvI c 'Stack -> Maybe FilePath -> [String] -> IO String callStackCmd :: QueryEnvI c 'Stack -> Maybe FilePath -> [String] -> IO () -- cgit v1.2.3