aboutsummaryrefslogtreecommitdiff
path: root/lib/Distribution/Helper.hs
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2017-12-13 23:00:21 +0200
committerDaniel Gröber <dxld@darkboxed.org>2018-01-18 14:10:26 +0100
commitf40e568f2be06b9254b8b5a956319c6eafd13997 (patch)
tree357f407c57dcbbba795b262da3cbeab1283555fa /lib/Distribution/Helper.hs
parentaba389ec640eb4f6254b6828621c689c638ab791 (diff)
Bring in needsBuildOuput query, for indefinite modules
Diffstat (limited to 'lib/Distribution/Helper.hs')
-rw-r--r--lib/Distribution/Helper.hs24
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs
index bef95ba..f98955c 100644
--- a/lib/Distribution/Helper.hs
+++ b/lib/Distribution/Helper.hs
@@ -56,6 +56,7 @@ module Distribution.Helper (
, ghcOptions
, sourceDirs
, entrypoints
+ , needsBuildOutput
-- * Query environment
, QueryEnv
@@ -206,7 +207,8 @@ data SomeLocalBuildInfo = SomeLocalBuildInfo {
slbiGhcOptions :: [(ChComponentName, [String])],
slbiSourceDirs :: [(ChComponentName, [String])],
- slbiEntrypoints :: [(ChComponentName, ChEntrypoint)]
+ slbiEntrypoints :: [(ChComponentName, ChEntrypoint)],
+ slbiNeedsBuildOutput :: [(ChComponentName, NeedsBuildOutput)]
} deriving (Eq, Ord, Read, Show)
-- | A lazy, cached, query against a package's Cabal configuration. Use
@@ -295,6 +297,9 @@ components (ComponentQuery sc) = map (\(cn, f) -> f cn) `liftM` sc
-- to compute the home module closure for a component.
entrypoints :: MonadIO m => ComponentQuery m ChEntrypoint
+-- | The component has a non-default module renaming, so needs build output ().
+needsBuildOutput :: MonadIO m => ComponentQuery m NeedsBuildOutput
+
-- | A component's @source-dirs@ field, beware since if this is empty implicit
-- behaviour in GHC kicks in.
sourceDirs :: MonadIO m => ComponentQuery m [FilePath]
@@ -321,12 +326,13 @@ ghcMergedPkgOptions = Query $ slbiGhcMergedPkgOptions `liftM` getSlbi
configFlags = Query $ slbiConfigFlags `liftM` getSlbi
nonDefaultConfigFlags = Query $ slbiNonDefaultConfigFlags `liftM` getSlbi
-ghcSrcOptions = ComponentQuery $ Query $ slbiGhcSrcOptions `liftM` getSlbi
-ghcPkgOptions = ComponentQuery $ Query $ slbiGhcPkgOptions `liftM` getSlbi
-ghcOptions = ComponentQuery $ Query $ slbiGhcOptions `liftM` getSlbi
-ghcLangOptions = ComponentQuery $ Query $ slbiGhcLangOptions `liftM` getSlbi
-sourceDirs = ComponentQuery $ Query $ slbiSourceDirs `liftM` getSlbi
-entrypoints = ComponentQuery $ Query $ slbiEntrypoints `liftM` getSlbi
+ghcSrcOptions = ComponentQuery $ Query $ slbiGhcSrcOptions `liftM` getSlbi
+ghcPkgOptions = ComponentQuery $ Query $ slbiGhcPkgOptions `liftM` getSlbi
+ghcOptions = ComponentQuery $ Query $ slbiGhcOptions `liftM` getSlbi
+ghcLangOptions = ComponentQuery $ Query $ slbiGhcLangOptions `liftM` getSlbi
+sourceDirs = ComponentQuery $ Query $ slbiSourceDirs `liftM` getSlbi
+entrypoints = ComponentQuery $ Query $ slbiEntrypoints `liftM` getSlbi
+needsBuildOutput = ComponentQuery $ Query $ slbiNeedsBuildOutput `liftM` getSlbi
-- | Run @cabal configure@
reconfigure :: MonadIO m
@@ -398,6 +404,7 @@ getSomeConfigState = ask >>= \QueryEnv {..} -> do
, "source-dirs"
, "entrypoints"
+ , "needsbuildoutput"
]
let [ Just (ChResponsePkgDbs slbiPackageDbStack),
Just (ChResponseFlags slbiPackageFlags),
@@ -415,7 +422,8 @@ getSomeConfigState = ask >>= \QueryEnv {..} -> do
Just (ChResponseCompList slbiGhcOptions),
Just (ChResponseCompList slbiSourceDirs),
- Just (ChResponseEntrypoints slbiEntrypoints)
+ Just (ChResponseEntrypoints slbiEntrypoints),
+ Just (ChResponseNeedsBuild slbiNeedsBuildOutput)
] = res
slbiCompilerVersion = (comp, compVer)
return $ SomeLocalBuildInfo {..}