aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-12-21 04:33:24 +0100
committerDaniel Gröber <dxld@darkboxed.org>2019-12-21 04:33:24 +0100
commit94c7695f4d25ecae8df655326351bf6014e02a9e (patch)
treed33daa272350d16912e8e5af998154c9a212bd8e /lib
parentc20981c0cf56d0a9d9fbfba9be961dbb4d5896c9 (diff)
Restore lost [Note Stack Cabal Version]
Diffstat (limited to 'lib')
-rw-r--r--lib/Distribution/Helper.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs
index 7448b2b..507adad 100644
--- a/lib/Distribution/Helper.hs
+++ b/lib/Distribution/Helper.hs
@@ -614,6 +614,20 @@ readProjInfo qe pc pcm pi = withVerbosity $ do
, piImpl = ProjInfoStack
}
+-- [Note Stack Cabal Version]
+--
+-- Stack just uses ghc-pkg on the global-pkg-db to determine the
+-- appropriate Cabal version for a resolver when building, see
+-- Stack.Setup.pathsFromCompiler(cabalPkgVer). We do essentially the same
+-- thing here.
+--
+-- The code for building Setup.hs is in Stack.Build.Execute and the version
+-- of cabal is set in withSingleContext.withCabal.getPackageArgs.
+--
+-- Note there is some special casing going on (see 'depsMinusCabal'), they
+-- use the packages from the snapshot pkg-db except Cabal which comes from
+-- the global pkg-db.
+
readUnitInfo :: Helper pt -> Unit pt -> UnitModTimes -> IO UnitInfo
readUnitInfo helper unit@Unit {uUnitId=uiUnitId} uiModTimes = do
res <- runHelper helper unit