From a93ed8c7d93df1860d2e56b400b724ac47edf470 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Wed, 31 Jul 2019 17:07:39 +0200 Subject: Merge CompPrograms back into Programs We need to support passing down the path to ghc to new-build/stack in order to support using a non-default 'ghc' executable. --- src/CabalHelper/Compiletime/Types.hs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/CabalHelper/Compiletime/Types.hs') diff --git a/src/CabalHelper/Compiletime/Types.hs b/src/CabalHelper/Compiletime/Types.hs index e79c812..1f3bd3d 100644 --- a/src/CabalHelper/Compiletime/Types.hs +++ b/src/CabalHelper/Compiletime/Types.hs @@ -241,9 +241,6 @@ data QueryEnvI c (pt :: ProjType) = QueryEnv , qePrograms :: !Programs -- ^ Field accessor for 'QueryEnv'. - , qeCompPrograms :: !CompPrograms - -- ^ Field accessor for 'QueryEnv'. - , qeProjLoc :: !(ProjLoc pt) -- ^ Field accessor for 'QueryEnv'. Defines path to the project directory, -- i.e. a directory containing a @cabal.project@ file @@ -460,11 +457,9 @@ data StackProjPaths = StackProjPaths -- Beware: GHC 8.0.2 doesn't like these being recursively defined for some -- reason so just keep them unrolled. type Verbose = (?verbose :: Word -> Bool) -type Env = ( ?cprogs :: CompPrograms - , ?progs :: Programs +type Env = ( ?progs :: Programs , ?verbose :: Word -> Bool) -type Progs = (?cprogs :: CompPrograms, ?progs :: Programs) -type CProgs = (?cprogs :: CompPrograms) +type Progs = (?progs :: Programs) -- | Configurable paths to various programs we use. data Programs = Programs @@ -477,11 +472,8 @@ data Programs = Programs -- ^ The path to the @stack@ program. , stackArgsBefore :: ![String] , stackArgsAfter :: ![String] - } deriving (Eq, Ord, Show, Read, Generic, Typeable) --- | Configurable paths to programs only used during helper compilation. -data CompPrograms = CompPrograms - { ghcProgram :: !FilePath + , ghcProgram :: !FilePath -- ^ The path to the @ghc@ program. , ghcPkgProgram :: !FilePath @@ -492,10 +484,7 @@ data CompPrograms = CompPrograms -- | By default all programs use their unqualified names, i.e. they will be -- searched for on @PATH@. defaultPrograms :: Programs -defaultPrograms = Programs "cabal" [] [] "stack" [] [] - -defaultCompPrograms :: CompPrograms -defaultCompPrograms = CompPrograms "ghc" "ghc-pkg" +defaultPrograms = Programs "cabal" [] [] "stack" [] [] "ghc" "ghc-pkg" data CompileOptions = CompileOptions { oVerbose :: Bool -- cgit v1.2.3