aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Compiletime/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/CabalHelper/Compiletime/Types.hs')
-rw-r--r--src/CabalHelper/Compiletime/Types.hs18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/CabalHelper/Compiletime/Types.hs b/src/CabalHelper/Compiletime/Types.hs
index 619538c..d206cf0 100644
--- a/src/CabalHelper/Compiletime/Types.hs
+++ b/src/CabalHelper/Compiletime/Types.hs
@@ -269,7 +269,7 @@ type ReadProcessWithCwdAndEnv =
String -> CallProcessWithCwdAndEnv String
type CallProcessWithCwdAndEnv a =
- Maybe FilePath -> [(String, String)] -> FilePath -> [String] -> IO a
+ Maybe FilePath -> [(String, EnvOverride)] -> FilePath -> [String] -> IO a
data QueryCache pt = QueryCache
{ qcProjInfo :: !(Maybe (ProjInfo pt))
@@ -484,14 +484,14 @@ type Progs = (?progs :: Programs)
data Programs = Programs
{ cabalProgram :: !FilePath
-- ^ The path to the @cabal@ program.
- , cabalArgsBefore :: ![String]
- , cabalArgsAfter :: ![String]
+ , cabalProjArgs :: ![String]
+ , cabalUnitArgs :: ![String]
, stackProgram :: !FilePath
-- ^ The path to the @stack@ program.
- , stackArgsBefore :: ![String]
- , stackArgsAfter :: ![String]
- , stackEnv :: ![(String, String)]
+ , stackProjArgs :: ![String]
+ , stackUnitArgs :: ![String]
+ , stackEnv :: ![(String, EnvOverride)]
-- ^ TODO: Stack doesn't support passing the compiler as a
-- commandline option so we meddle with PATH instead. We should
-- patch that upstream.
@@ -509,6 +509,12 @@ data Programs = Programs
defaultPrograms :: Programs
defaultPrograms = Programs "cabal" [] [] "stack" [] [] [] "ghc" "ghc-pkg"
+data EnvOverride
+ = EnvPrepend String
+ | EnvAppend String
+ | EnvReplace String
+ deriving (Eq, Ord, Show, Read, Generic, Typeable)
+
data CompileOptions = CompileOptions
{ oVerbose :: Bool
, oCabalPkgDb :: Maybe PackageDbDir