aboutsummaryrefslogtreecommitdiff
path: root/lib/Distribution
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2018-12-15 23:50:15 +0100
committerDaniel Gröber <dxld@darkboxed.org>2019-01-22 03:06:51 +0100
commit842de542f71616b6d828ea2f993f227e59f1ebc5 (patch)
treeaa157c6864ea303f1abbf847dc4d500ede81e5c1 /lib/Distribution
parentf844fb50da753332f2f37d4907336d7e7c2a04f2 (diff)
Refactor Compile (for v2-install)
Diffstat (limited to 'lib/Distribution')
-rw-r--r--lib/Distribution/Helper.hs24
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs
index ba8c2dd..bafe3ca 100644
--- a/lib/Distribution/Helper.hs
+++ b/lib/Distribution/Helper.hs
@@ -123,6 +123,7 @@ import CabalHelper.Compiletime.Compile
import qualified CabalHelper.Compiletime.Program.Stack as Stack
import qualified CabalHelper.Compiletime.Program.GHC as GHC
import qualified CabalHelper.Compiletime.Program.CabalInstall as CabalInstall
+import CabalHelper.Compiletime.Cabal
import CabalHelper.Compiletime.Sandbox
import CabalHelper.Compiletime.Types
import CabalHelper.Compiletime.Types.RelativePath
@@ -517,7 +518,7 @@ writeAutogenFiles Unit{uCabalFile, uDistDir} = Query $ \qe -> do
getSandboxPkgDb
:: String
-- ^ Cabal build platform, i.e. @buildPlatform@
- -> Version
+ -> GHC.GhcVersion
-- ^ GHC version (@cProjectVersion@ is your friend)
-> FilePath
-- ^ Path to the project directory, i.e. a directory containing a
@@ -593,22 +594,24 @@ wrapper'
(DistDirV1 distdir)
ProjInfo{piCabalVersion}
= CompHelperEnv
- { cheCabalVer = piCabalVersion
+ { cheCabalVer = CabalVersion piCabalVersion
, cheProjDir = plV1Dir projloc
- , cheCacheDir = distdir
+ , cheProjLocalCacheDir = distdir
, chePkgDb = Nothing
- , cheNewstyle = Nothing
+ , chePlanJson = Nothing
+ , cheDistV2 = Nothing
}
wrapper'
(ProjLocV2Dir projdir)
(DistDirV2 distdir)
ProjInfo{piImpl=ProjInfoV2{piV2Plan=plan}}
= CompHelperEnv
- { cheCabalVer = makeDataVersion pjCabalLibVersion
+ { cheCabalVer = CabalVersion $ makeDataVersion pjCabalLibVersion
, cheProjDir = projdir
- , cheCacheDir = distdir </> "cache"
+ , cheProjLocalCacheDir = distdir </> "cache"
, chePkgDb = Nothing
- , cheNewstyle = Just (plan, distdir)
+ , chePlanJson = Just plan
+ , cheDistV2 = Just distdir
}
where
PlanJson {pjCabalLibVersion=Ver pjCabalLibVersion } = plan
@@ -624,9 +627,10 @@ wrapper'
}
= let workdir = fromMaybe ".stack-work" $ unRelativePath <$> mworkdir in
CompHelperEnv
- { cheCabalVer = piCabalVersion
+ { cheCabalVer = CabalVersion $ piCabalVersion
, cheProjDir = projdir
- , cheCacheDir = projdir </> workdir
+ , cheProjLocalCacheDir = projdir </> workdir
, chePkgDb = Just sppGlobalPkgDb
- , cheNewstyle = Nothing
+ , chePlanJson = Nothing
+ , cheDistV2 = Nothing
}