Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Programs = Programs {}
- data Query m a
- runQuery :: Monad m => FilePath -> Query m a -> m a
- runQuery' :: Monad m => Programs -> FilePath -> Query m a -> m a
- entrypoints :: MonadIO m => Query m [(ChComponentName, ChEntrypoint)]
- sourceDirs :: MonadIO m => Query m [(ChComponentName, [FilePath])]
- ghcOptions :: MonadIO m => Query m [(ChComponentName, [String])]
- ghcSrcOptions :: MonadIO m => Query m [(ChComponentName, [String])]
- ghcPkgOptions :: MonadIO m => Query m [(ChComponentName, [String])]
- ghcMergedPkgOptions :: MonadIO m => Query m [String]
- ghcLangOptions :: MonadIO m => Query m [(ChComponentName, [String])]
- newtype ChModuleName = ChModuleName String
- data ChComponentName
- data ChEntrypoint
- = ChSetupEntrypoint
- | ChLibEntrypoint { }
- | ChExeEntrypoint { }
- buildPlatform :: IO String
- reconfigure :: MonadIO m => Programs -> [String] -> m ()
- writeAutogenFiles :: MonadIO m => FilePath -> m ()
- data LibexecNotFoundError = LibexecNotFoundError String FilePath
- libexecNotFoundError :: String -> FilePath -> String -> String
Documentation
Paths or names of various programs we need.
Running Queries
Caches helper executable result so it doesn't have to be run more than once
as reading in Cabal's LocalBuildInfo
datatype from disk is very slow but
running all possible queries against it at once is cheap.
runQuery query distdir
. Run a Query
. distdir
is where Cabal's
setup-config
file is located.
Queries against Cabal's on disk state
entrypoints :: MonadIO m => Query m [(ChComponentName, ChEntrypoint)] Source
Modules or files Cabal would have the compiler build directly. Can be used to compute the home module closure for a component.
sourceDirs :: MonadIO m => Query m [(ChComponentName, [FilePath])] Source
A component's source-dirs
field, beware as if this is empty implicit
behaviour in GHC kicks in.
ghcOptions :: MonadIO m => Query m [(ChComponentName, [String])] Source
All options cabal would pass to GHC.
ghcSrcOptions :: MonadIO m => Query m [(ChComponentName, [String])] Source
Only search path related GHC options.
ghcPkgOptions :: MonadIO m => Query m [(ChComponentName, [String])] Source
Only package related GHC options, sufficient for things don't need to access any home modules.
ghcMergedPkgOptions :: MonadIO m => Query m [String] Source
Like ghcPkgOptions
but for the whole package not just one component
ghcLangOptions :: MonadIO m => Query m [(ChComponentName, [String])] Source
Only language related options, i.e. -XSomeExtension
Result types
newtype ChModuleName Source
data ChComponentName Source
data ChEntrypoint Source
ChSetupEntrypoint | Almost like |
ChLibEntrypoint | |
ChExeEntrypoint | |
|
General information
Managing dist/
Run cabal configure
Create cabal_macros.h
and Paths_<pkg>
possibly other generated files
in the usual place.
$libexec related error handling
data LibexecNotFoundError Source
This exception is thrown by all runQuery
functions if the internal
wrapper executable cannot be found. You may catch this and present the user
an appropriate error message however the default is to print
libexecNotFoundError
.