From 5b85a4b9e1c6463c94ffa595893ad02c9a3d2ec3 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Fri, 1 May 2020 23:13:48 +0200 Subject: Only pass pjUnits to compile module instead of whole PlanJson --- src/CabalHelper/Compiletime/Compile.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/CabalHelper') diff --git a/src/CabalHelper/Compiletime/Compile.hs b/src/CabalHelper/Compiletime/Compile.hs index 4c92fba..e468c1b 100644 --- a/src/CabalHelper/Compiletime/Compile.hs +++ b/src/CabalHelper/Compiletime/Compile.hs @@ -21,7 +21,7 @@ module CabalHelper.Compiletime.Compile where import qualified Cabal.Plan as CP import Cabal.Plan - ( PlanJson(..), PkgId(..), PkgName(..), Ver(..), uPId) + ( PkgId(..), PkgName(..), Ver(..), uPId) import Control.Applicative import Control.Arrow import Control.Exception as E @@ -30,6 +30,7 @@ import Control.Monad.Trans.Maybe import Control.Monad.IO.Class import Data.Char import Data.List +import Data.Map.Strict (Map) import Data.Maybe import Data.String import Data.Version @@ -94,7 +95,7 @@ data CompHelperEnv' cv = CompHelperEnv , chePkgDb :: ![PackageDbDir] -- ^ A package-db where we are guaranteed to find Cabal-`cheCabalVer`. , cheProjDir :: !FilePath - , chePlanJson :: !(Maybe PlanJson) + , chePjUnits :: !(Maybe (Map CP.UnitId CP.Unit)) , cheDistV2 :: !(Maybe FilePath) , cheProjLocalCacheDir :: FilePath } @@ -185,8 +186,8 @@ compileHelper' CompHelperEnv {..} = do compileWithCabalV2Inplace ghcVer cabalVer = do -- TODO: Test coverage! Neither compile-test nor ghc-session test out -- this code path - PlanJson {pjUnits} <- maybe mzero pure chePlanJson - distdir_newstyle <- maybe mzero pure cheDistV2 + pjUnits <- maybe mzero pure chePjUnits + distdir_newstyle <- maybe mzero pure cheDistV2 let cabal_pkgid = PkgId (PkgName (Text.pack "Cabal")) (Ver $ versionBranch cabalVer) mcabal_unit = listToMaybe $ -- cgit v1.2.3