aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2020-05-01 23:13:48 +0200
committerDaniel Gröber <dxld@darkboxed.org>2020-05-02 15:44:26 +0200
commit5b85a4b9e1c6463c94ffa595893ad02c9a3d2ec3 (patch)
tree5a1e715378d7da40d6adc3954efc0c556a11a5a8 /src
parent852dbc69d276e19add3917d17dff5541d84e29d4 (diff)
Only pass pjUnits to compile module instead of whole PlanJson
Diffstat (limited to 'src')
-rw-r--r--src/CabalHelper/Compiletime/Compile.hs9
1 files changed, 5 insertions, 4 deletions
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 $