Distribution.Simple

Cabal-2.2.0.1: A framework for packaging Haskell software

Copyright | Isaac Jones 2003-2005
License | BSD3
Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Simple

Contents

- Simple interface
- Customization
  - Standard sets of hooks
  - Utils

Description

This is the command line front end to the Simple build system. When given the parsed command-line args and package information, is able to perform basic commands like configure, build, install, register, etc.

This module exports the main functions that Setup.hs scripts use. It re-exports the `UserHooks` type, the standard entry points like `defaultMain` and `defaultMainWithHooks` and the predefined sets of `UserHooks` that custom `Setup.hs` scripts can extend to add their own behaviour.

This module isn't called "Simple" because it's simple. Far from it. It's called "Simple" because it does complicated things to simple software.

The original idea was that there could be different build systems that all presented the same compatible command line interfaces. There is still a Distribution.Make system but in practice no packages use it.

Synopsis

- module Distribution.Package
- module Distribution.Version
- module Distribution.License
- data AbiTag
  - = NoAbiTag
  - | AbiTag String
- data CompilerInfo = CompilerInfo {
  - compilerInfoId :: CompilerId
  - compilerInfoAbiTag :: AbiTag
  - compilerInfoCompat :: Maybe [CompilerId]
  - compilerInfoLanguages :: Maybe [Language]
  - compilerInfoExtensions :: Maybe [Extension]
  }
- data CompilerId = CompilerId CompilerFlavor Version
- data CompilerFlavor
  - = GHC
  - | GHCJS
  - | NHC
  - | YHC
  - | Hugs
  - | HBC
  - | Helium
  - | JHC
  - | LHC
  - | UHC
  - | HaskellSuite String
  - | OtherCompiler String
- classifyCompilerFlavor :: String -> CompilerFlavor
- parseCompilerFlavorCompat :: ReadP r CompilerFlavor
- buildCompilerFlavor :: CompilerFlavor
- buildCompilerId :: CompilerId
- defaultCompilerFlavor :: Maybe CompilerFlavor
- abiTagString :: AbiTag -> String
- unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo
- data ProfDetailLevel
  - = ProfDetailNone
  - | ProfDetailDefault
  - | ProfDetailExportedFunctions
  - | ProfDetailToplevelFunctions
  - | ProfDetailAllFunctions
  - | ProfDetailOther String
- data DebugInfoLevel
  - = NoDebugInfo
  - | MinimalDebugInfo
  - | NormalDebugInfo
  - | MaximalDebugInfo
- data OptimisationLevel
  - = NoOptimisation
  - | NormalOptimisation
  - | MaximumOptimisation
- type PackageDBStack = [PackageDB]
- data PackageDB
  - = GlobalPackageDB
  - | UserPackageDB
  - | SpecificPackageDB FilePath
- data Compiler = Compiler {
  - compilerId :: CompilerId
  - compilerAbiTag :: AbiTag
  - compilerCompat :: [CompilerId]
  - compilerLanguages :: [(Language, Flag)]
  - compilerExtensions :: [(Extension, Maybe Flag)]
  - compilerProperties :: Map String String
  }
- showCompilerId :: Compiler -> String
- showCompilerIdWithAbi :: Compiler -> String
- compilerFlavor :: Compiler -> CompilerFlavor
- compilerVersion :: Compiler -> Version
- compilerCompatFlavor :: CompilerFlavor -> Compiler -> Bool
- compilerCompatVersion :: CompilerFlavor -> Compiler -> Maybe Version
- compilerInfo :: Compiler -> CompilerInfo
- registrationPackageDB :: PackageDBStack -> PackageDB
- absolutePackageDBPaths :: PackageDBStack -> NoCallStackIO PackageDBStack
- absolutePackageDBPath :: PackageDB -> NoCallStackIO PackageDB
- flagToOptimisationLevel :: Maybe String -> OptimisationLevel
- flagToDebugInfoLevel :: Maybe String -> DebugInfoLevel
- unsupportedLanguages :: Compiler -> [Language] -> [Language]
- languageToFlags :: Compiler -> Maybe Language -> [Flag]
- unsupportedExtensions :: Compiler -> [Extension] -> [Extension]
- extensionsToFlags :: Compiler -> [Extension] -> [Flag]
- parmakeSupported :: Compiler -> Bool
- reexportedModulesSupported :: Compiler -> Bool
- renamingPackageFlagsSupported :: Compiler -> Bool
- unifiedIPIDRequired :: Compiler -> Bool
- packageKeySupported :: Compiler -> Bool
- unitIdSupported :: Compiler -> Bool
- backpackSupported :: Compiler -> Bool
- libraryDynDirSupported :: Compiler -> Bool
- arResponseFilesSupported :: Compiler -> Bool
- coverageSupported :: Compiler -> Bool
- profilingSupported :: Compiler -> Bool
- flagToProfDetailLevel :: String -> ProfDetailLevel
- knownProfDetailLevels :: [(String, [String], ProfDetailLevel)]
- showProfDetailLevel :: ProfDetailLevel -> String
- module Language.Haskell.Extension
- defaultMain :: IO ()
- defaultMainNoRead :: GenericPackageDescription -> IO ()
- defaultMainArgs :: [String] -> IO ()
- data UserHooks = UserHooks {
  - runTests :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()
  - readDesc :: IO (Maybe GenericPackageDescription)
  - hookedPreProcessors :: [PPSuffixHandler]
  - hookedPrograms :: [Program]
  - preConf :: Args -> ConfigFlags -> IO HookedBuildInfo
  - confHook :: (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo
  - postConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  - preBuild :: Args -> BuildFlags -> IO HookedBuildInfo
  - buildHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
  - postBuild :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  - preRepl :: Args -> ReplFlags -> IO HookedBuildInfo
  - replHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO ()
  - postRepl :: Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  - preClean :: Args -> CleanFlags -> IO HookedBuildInfo
  - cleanHook :: PackageDescription -> () -> UserHooks -> CleanFlags -> IO ()
  - postClean :: Args -> CleanFlags -> PackageDescription -> () -> IO ()
  - preCopy :: Args -> CopyFlags -> IO HookedBuildInfo
  - copyHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()
  - postCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  - preInst :: Args -> InstallFlags -> IO HookedBuildInfo
  - instHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()
  - postInst :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  - preSDist :: Args -> SDistFlags -> IO HookedBuildInfo
  - sDistHook :: PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO ()
  - postSDist :: Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()
  - preReg :: Args -> RegisterFlags -> IO HookedBuildInfo
  - regHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()
  - postReg :: Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  - preUnreg :: Args -> RegisterFlags -> IO HookedBuildInfo
  - unregHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()
  - postUnreg :: Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  - preHscolour :: Args -> HscolourFlags -> IO HookedBuildInfo
  - hscolourHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO ()
  - postHscolour :: Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  - preDoctest :: Args -> DoctestFlags -> IO HookedBuildInfo
  - doctestHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> DoctestFlags -> IO ()
  - postDoctest :: Args -> DoctestFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  - preHaddock :: Args -> HaddockFlags -> IO HookedBuildInfo
  - haddockHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()
  - postHaddock :: Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  - preTest :: Args -> TestFlags -> IO HookedBuildInfo
  - testHook :: Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO ()
  - postTest :: Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  - preBench :: Args -> BenchmarkFlags -> IO HookedBuildInfo
  - benchHook :: Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO ()
  - postBench :: Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO ()
  }
- type Args = [String]
- defaultMainWithHooks :: UserHooks -> IO ()
- defaultMainWithHooksArgs :: UserHooks -> [String] -> IO ()
- defaultMainWithHooksNoRead :: UserHooks -> GenericPackageDescription -> IO ()
- defaultMainWithHooksNoReadArgs :: UserHooks -> GenericPackageDescription -> [String] -> IO ()
- simpleUserHooks :: UserHooks
- autoconfUserHooks :: UserHooks
- defaultUserHooks :: UserHooks
- emptyUserHooks :: UserHooks
- defaultHookedPackageDesc :: IO (Maybe FilePath)

# Documentation

module Distribution.Package

module Distribution.Version

module Distribution.License

data AbiTag #

Constructors

NoAbiTag |
AbiTag String |

Instances

Eq AbiTag # |
Instance details Defined in Distribution.Compiler Methods (==) :: AbiTag -> AbiTag -> Bool # (/=) :: AbiTag -> AbiTag -> Bool #
Read AbiTag # |
Instance details Defined in Distribution.Compiler Methods readsPrec :: Int -> ReadS AbiTag Source # readList :: ReadS [AbiTag] Source # readPrec :: ReadPrec AbiTag Source # readListPrec :: ReadPrec [AbiTag] Source #
Show AbiTag # |
Instance details Defined in Distribution.Compiler Methods showsPrec :: Int -> AbiTag -> ShowS Source # show :: AbiTag -> String Source # showList :: [AbiTag] -> ShowS Source #
Generic AbiTag # |
Instance details Defined in Distribution.Compiler Associated Types type Rep AbiTag :: * -> * Source # Methods from :: AbiTag -> Rep AbiTag x Source # to :: Rep AbiTag x -> AbiTag Source #
Binary AbiTag # |
Instance details Defined in Distribution.Compiler Methods put :: AbiTag -> Put Source # get :: Get AbiTag Source # putList :: [AbiTag] -> Put Source #
Text AbiTag # |
Instance details Defined in Distribution.Compiler Methods disp :: AbiTag -> Doc # parse :: ReadP r AbiTag #
type Rep AbiTag # |
Instance details Defined in Distribution.Compiler type Rep AbiTag = D1 (MetaData "AbiTag" "Distribution.Compiler" "Cabal-2.2.0.1" False) (C1 (MetaCons "NoAbiTag" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "AbiTag" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)))

data CompilerInfo #

Compiler information used for resolving configurations. Some fields can be set to Nothing to indicate that the information is unknown.

Constructors

CompilerInfo |
Fields compilerInfoId :: CompilerId Compiler flavour and version. compilerInfoAbiTag :: AbiTag Tag for distinguishing incompatible ABI's on the same architecture/os. compilerInfoCompat :: Maybe [CompilerId] Other implementations that this compiler claims to be compatible with, if known. compilerInfoLanguages :: Maybe [Language] Supported language standards, if known. compilerInfoExtensions :: Maybe [Extension] Supported extensions, if known.

Instances

Read CompilerInfo # |
Instance details Defined in Distribution.Compiler Methods readsPrec :: Int -> ReadS CompilerInfo Source # readList :: ReadS [CompilerInfo] Source # readPrec :: ReadPrec CompilerInfo Source # readListPrec :: ReadPrec [CompilerInfo] Source #
Show CompilerInfo # |
Instance details Defined in Distribution.Compiler Methods showsPrec :: Int -> CompilerInfo -> ShowS Source # show :: CompilerInfo -> String Source # showList :: [CompilerInfo] -> ShowS Source #
Generic CompilerInfo # |
Instance details Defined in Distribution.Compiler Associated Types type Rep CompilerInfo :: * -> * Source # Methods from :: CompilerInfo -> Rep CompilerInfo x Source # to :: Rep CompilerInfo x -> CompilerInfo Source #
Binary CompilerInfo # |
Instance details Defined in Distribution.Compiler Methods put :: CompilerInfo -> Put Source # get :: Get CompilerInfo Source # putList :: [CompilerInfo] -> Put Source #
type Rep CompilerInfo # |
Instance details Defined in Distribution.Compiler type Rep CompilerInfo = D1 (MetaData "CompilerInfo" "Distribution.Compiler" "Cabal-2.2.0.1" False) (C1 (MetaCons "CompilerInfo" PrefixI True) ((S1 (MetaSel (Just "compilerInfoId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CompilerId) :*: S1 (MetaSel (Just "compilerInfoAbiTag") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 AbiTag)) :*: (S1 (MetaSel (Just "compilerInfoCompat") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe [CompilerId])) :*: (S1 (MetaSel (Just "compilerInfoLanguages") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe [Language])) :*: S1 (MetaSel (Just "compilerInfoExtensions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe [Extension]))))))

data CompilerId #

Constructors

CompilerId CompilerFlavor Version |

Instances

Eq CompilerId # |
Instance details Defined in Distribution.Compiler Methods (==) :: CompilerId -> CompilerId -> Bool # (/=) :: CompilerId -> CompilerId -> Bool #
Ord CompilerId # |
Instance details Defined in Distribution.Compiler Methods compare :: CompilerId -> CompilerId -> Ordering # (<) :: CompilerId -> CompilerId -> Bool # (<=) :: CompilerId -> CompilerId -> Bool # (>) :: CompilerId -> CompilerId -> Bool # (>=) :: CompilerId -> CompilerId -> Bool # max :: CompilerId -> CompilerId -> CompilerId # min :: CompilerId -> CompilerId -> CompilerId #
Read CompilerId # |
Instance details Defined in Distribution.Compiler Methods readsPrec :: Int -> ReadS CompilerId Source # readList :: ReadS [CompilerId] Source # readPrec :: ReadPrec CompilerId Source # readListPrec :: ReadPrec [CompilerId] Source #
Show CompilerId # |
Instance details Defined in Distribution.Compiler Methods showsPrec :: Int -> CompilerId -> ShowS Source # show :: CompilerId -> String Source # showList :: [CompilerId] -> ShowS Source #
Generic CompilerId # |
Instance details Defined in Distribution.Compiler Associated Types type Rep CompilerId :: * -> * Source # Methods from :: CompilerId -> Rep CompilerId x Source # to :: Rep CompilerId x -> CompilerId Source #
NFData CompilerId # |
Instance details Defined in Distribution.Compiler Methods rnf :: CompilerId -> () Source #
Binary CompilerId # |
Instance details Defined in Distribution.Compiler Methods put :: CompilerId -> Put Source # get :: Get CompilerId Source # putList :: [CompilerId] -> Put Source #
Text CompilerId # |
Instance details Defined in Distribution.Compiler Methods disp :: CompilerId -> Doc # parse :: ReadP r CompilerId #
type Rep CompilerId # |
Instance details Defined in Distribution.Compiler type Rep CompilerId = D1 (MetaData "CompilerId" "Distribution.Compiler" "Cabal-2.2.0.1" False) (C1 (MetaCons "CompilerId" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CompilerFlavor) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version)))

data CompilerFlavor #

Constructors

GHC |
GHCJS |
NHC |
YHC |
Hugs |
HBC |
Helium |
JHC |
LHC |
UHC |
HaskellSuite String |
OtherCompiler String |

Instances

Eq CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods (==) :: CompilerFlavor -> CompilerFlavor -> Bool # (/=) :: CompilerFlavor -> CompilerFlavor -> Bool #
Data CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CompilerFlavor -> c CompilerFlavor Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CompilerFlavor Source # toConstr :: CompilerFlavor -> Constr Source # dataTypeOf :: CompilerFlavor -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CompilerFlavor) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CompilerFlavor) Source # gmapT :: (forall b. Data b => b -> b) -> CompilerFlavor -> CompilerFlavor Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CompilerFlavor -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CompilerFlavor -> r Source # gmapQ :: (forall d. Data d => d -> u) -> CompilerFlavor -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> CompilerFlavor -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CompilerFlavor -> m CompilerFlavor Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CompilerFlavor -> m CompilerFlavor Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CompilerFlavor -> m CompilerFlavor Source #
Ord CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods compare :: CompilerFlavor -> CompilerFlavor -> Ordering # (<) :: CompilerFlavor -> CompilerFlavor -> Bool # (<=) :: CompilerFlavor -> CompilerFlavor -> Bool # (>) :: CompilerFlavor -> CompilerFlavor -> Bool # (>=) :: CompilerFlavor -> CompilerFlavor -> Bool # max :: CompilerFlavor -> CompilerFlavor -> CompilerFlavor # min :: CompilerFlavor -> CompilerFlavor -> CompilerFlavor #
Read CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods readsPrec :: Int -> ReadS CompilerFlavor Source # readList :: ReadS [CompilerFlavor] Source # readPrec :: ReadPrec CompilerFlavor Source # readListPrec :: ReadPrec [CompilerFlavor] Source #
Show CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods showsPrec :: Int -> CompilerFlavor -> ShowS Source # show :: CompilerFlavor -> String Source # showList :: [CompilerFlavor] -> ShowS Source #
Generic CompilerFlavor # |
Instance details Defined in Distribution.Compiler Associated Types type Rep CompilerFlavor :: * -> * Source # Methods from :: CompilerFlavor -> Rep CompilerFlavor x Source # to :: Rep CompilerFlavor x -> CompilerFlavor Source #
NFData CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods rnf :: CompilerFlavor -> () Source #
Binary CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods put :: CompilerFlavor -> Put Source # get :: Get CompilerFlavor Source # putList :: [CompilerFlavor] -> Put Source #
Pretty CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods pretty :: CompilerFlavor -> Doc #
Parsec CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods parsec :: CabalParsing m => m CompilerFlavor #
Text CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods disp :: CompilerFlavor -> Doc # parse :: ReadP r CompilerFlavor #
Newtype TestedWith (CompilerFlavor, VersionRange) # |
Instance details Defined in Distribution.Parsec.Newtypes Methods pack :: (CompilerFlavor, VersionRange) -> TestedWith # unpack :: TestedWith -> (CompilerFlavor, VersionRange) #
type Rep CompilerFlavor # |
Instance details Defined in Distribution.Compiler type Rep CompilerFlavor = D1 (MetaData "CompilerFlavor" "Distribution.Compiler" "Cabal-2.2.0.1" False) (((C1 (MetaCons "GHC" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "GHCJS" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "NHC" PrefixI False) (U1 :: * -> *))) :+: (C1 (MetaCons "YHC" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "Hugs" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "HBC" PrefixI False) (U1 :: * -> *)))) :+: ((C1 (MetaCons "Helium" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "JHC" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "LHC" PrefixI False) (U1 :: * -> *))) :+: (C1 (MetaCons "UHC" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "HaskellSuite" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :+: C1 (MetaCons "OtherCompiler" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))))))

classifyCompilerFlavor :: String -> CompilerFlavor #

parseCompilerFlavorCompat :: ReadP r CompilerFlavor #

Like `classifyCompilerFlavor` but compatible with the old ReadS parser.

It is compatible in the sense that it accepts only the same strings, eg GHC but not "ghc". However other strings get mapped to `OtherCompiler`. The point of this is that we do not allow extra valid values that would upset older Cabal versions that had a stricter parser however we cope with new values more gracefully so that we'll be able to introduce new value in future without breaking things so much.

buildCompilerFlavor :: CompilerFlavor #

buildCompilerId :: CompilerId #

defaultCompilerFlavor :: Maybe CompilerFlavor #

The default compiler flavour to pick when compiling stuff. This defaults to the compiler used to build the Cabal lib.

However if it's not a recognised compiler then it's `Nothing` and the user will have to specify which compiler they want.

abiTagString :: AbiTag -> String #

unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo #

Make a CompilerInfo of which only the known information is its CompilerId, its AbiTag and that it does not claim to be compatible with other compiler id's.

data ProfDetailLevel #

Some compilers (notably GHC) support profiling and can instrument programs so the system can account costs to different functions. There are different levels of detail that can be used for this accounting. For compilers that do not support this notion or the particular detail levels, this is either ignored or just capped to some similar level they do support.

Constructors

ProfDetailNone |
ProfDetailDefault |
ProfDetailExportedFunctions |
ProfDetailToplevelFunctions |
ProfDetailAllFunctions |
ProfDetailOther String |

Instances

Eq ProfDetailLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods (==) :: ProfDetailLevel -> ProfDetailLevel -> Bool # (/=) :: ProfDetailLevel -> ProfDetailLevel -> Bool #
Read ProfDetailLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods readsPrec :: Int -> ReadS ProfDetailLevel Source # readList :: ReadS [ProfDetailLevel] Source # readPrec :: ReadPrec ProfDetailLevel Source # readListPrec :: ReadPrec [ProfDetailLevel] Source #
Show ProfDetailLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods showsPrec :: Int -> ProfDetailLevel -> ShowS Source # show :: ProfDetailLevel -> String Source # showList :: [ProfDetailLevel] -> ShowS Source #
Generic ProfDetailLevel # |
Instance details Defined in Distribution.Simple.Compiler Associated Types type Rep ProfDetailLevel :: * -> * Source # Methods from :: ProfDetailLevel -> Rep ProfDetailLevel x Source # to :: Rep ProfDetailLevel x -> ProfDetailLevel Source #
Binary ProfDetailLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods put :: ProfDetailLevel -> Put Source # get :: Get ProfDetailLevel Source # putList :: [ProfDetailLevel] -> Put Source #
type Rep ProfDetailLevel # |
Instance details Defined in Distribution.Simple.Compiler type Rep ProfDetailLevel = D1 (MetaData "ProfDetailLevel" "Distribution.Simple.Compiler" "Cabal-2.2.0.1" False) ((C1 (MetaCons "ProfDetailNone" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "ProfDetailDefault" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ProfDetailExportedFunctions" PrefixI False) (U1 :: * -> *))) :+: (C1 (MetaCons "ProfDetailToplevelFunctions" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "ProfDetailAllFunctions" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ProfDetailOther" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)))))

data DebugInfoLevel #

Some compilers support emitting debug info. Some have different levels. For compilers that do not the level is just capped to the level they do support.

Constructors

NoDebugInfo |
MinimalDebugInfo |
NormalDebugInfo |
MaximalDebugInfo |

Instances

Bounded DebugInfoLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods minBound :: DebugInfoLevel Source # maxBound :: DebugInfoLevel Source #
Enum DebugInfoLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods succ :: DebugInfoLevel -> DebugInfoLevel Source # pred :: DebugInfoLevel -> DebugInfoLevel Source # toEnum :: Int -> DebugInfoLevel Source # fromEnum :: DebugInfoLevel -> Int Source # enumFrom :: DebugInfoLevel -> [DebugInfoLevel] Source # enumFromThen :: DebugInfoLevel -> DebugInfoLevel -> [DebugInfoLevel] Source # enumFromTo :: DebugInfoLevel -> DebugInfoLevel -> [DebugInfoLevel] Source # enumFromThenTo :: DebugInfoLevel -> DebugInfoLevel -> DebugInfoLevel -> [DebugInfoLevel] Source #
Eq DebugInfoLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods (==) :: DebugInfoLevel -> DebugInfoLevel -> Bool # (/=) :: DebugInfoLevel -> DebugInfoLevel -> Bool #
Read DebugInfoLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods readsPrec :: Int -> ReadS DebugInfoLevel Source # readList :: ReadS [DebugInfoLevel] Source # readPrec :: ReadPrec DebugInfoLevel Source # readListPrec :: ReadPrec [DebugInfoLevel] Source #
Show DebugInfoLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods showsPrec :: Int -> DebugInfoLevel -> ShowS Source # show :: DebugInfoLevel -> String Source # showList :: [DebugInfoLevel] -> ShowS Source #
Generic DebugInfoLevel # |
Instance details Defined in Distribution.Simple.Compiler Associated Types type Rep DebugInfoLevel :: * -> * Source # Methods from :: DebugInfoLevel -> Rep DebugInfoLevel x Source # to :: Rep DebugInfoLevel x -> DebugInfoLevel Source #
Binary DebugInfoLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods put :: DebugInfoLevel -> Put Source # get :: Get DebugInfoLevel Source # putList :: [DebugInfoLevel] -> Put Source #
type Rep DebugInfoLevel # |
Instance details Defined in Distribution.Simple.Compiler type Rep DebugInfoLevel = D1 (MetaData "DebugInfoLevel" "Distribution.Simple.Compiler" "Cabal-2.2.0.1" False) ((C1 (MetaCons "NoDebugInfo" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "MinimalDebugInfo" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "NormalDebugInfo" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "MaximalDebugInfo" PrefixI False) (U1 :: * -> *)))

data OptimisationLevel #

Some compilers support optimising. Some have different levels. For compilers that do not the level is just capped to the level they do support.

Constructors

NoOptimisation |
NormalOptimisation |
MaximumOptimisation |

Instances

Bounded OptimisationLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods minBound :: OptimisationLevel Source # maxBound :: OptimisationLevel Source #
Enum OptimisationLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods succ :: OptimisationLevel -> OptimisationLevel Source # pred :: OptimisationLevel -> OptimisationLevel Source # toEnum :: Int -> OptimisationLevel Source # fromEnum :: OptimisationLevel -> Int Source # enumFrom :: OptimisationLevel -> [OptimisationLevel] Source # enumFromThen :: OptimisationLevel -> OptimisationLevel -> [OptimisationLevel] Source # enumFromTo :: OptimisationLevel -> OptimisationLevel -> [OptimisationLevel] Source # enumFromThenTo :: OptimisationLevel -> OptimisationLevel -> OptimisationLevel -> [OptimisationLevel] Source #
Eq OptimisationLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods (==) :: OptimisationLevel -> OptimisationLevel -> Bool # (/=) :: OptimisationLevel -> OptimisationLevel -> Bool #
Read OptimisationLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods readsPrec :: Int -> ReadS OptimisationLevel Source # readList :: ReadS [OptimisationLevel] Source # readPrec :: ReadPrec OptimisationLevel Source # readListPrec :: ReadPrec [OptimisationLevel] Source #
Show OptimisationLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods showsPrec :: Int -> OptimisationLevel -> ShowS Source # show :: OptimisationLevel -> String Source # showList :: [OptimisationLevel] -> ShowS Source #
Generic OptimisationLevel # |
Instance details Defined in Distribution.Simple.Compiler Associated Types type Rep OptimisationLevel :: * -> * Source # Methods from :: OptimisationLevel -> Rep OptimisationLevel x Source # to :: Rep OptimisationLevel x -> OptimisationLevel Source #
Binary OptimisationLevel # |
Instance details Defined in Distribution.Simple.Compiler Methods put :: OptimisationLevel -> Put Source # get :: Get OptimisationLevel Source # putList :: [OptimisationLevel] -> Put Source #
type Rep OptimisationLevel # |
Instance details Defined in Distribution.Simple.Compiler type Rep OptimisationLevel = D1 (MetaData "OptimisationLevel" "Distribution.Simple.Compiler" "Cabal-2.2.0.1" False) (C1 (MetaCons "NoOptimisation" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "NormalOptimisation" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "MaximumOptimisation" PrefixI False) (U1 :: * -> *)))

type PackageDBStack = [PackageDB] #

We typically get packages from several databases, and stack them together. This type lets us be explicit about that stacking. For example typical stacks include:

    [GlobalPackageDB]
    [GlobalPackageDB, UserPackageDB]
    [GlobalPackageDB, SpecificPackageDB "package.conf.inplace"]

Note that the `GlobalPackageDB` is invariably at the bottom since it contains the rts, base and other special compiler-specific packages.

We are not restricted to using just the above combinations. In particular we can use several custom package dbs and the user package db together.

When it comes to writing, the top most (last) package is used.

data PackageDB #

Some compilers have a notion of a database of available packages. For some there is just one global db of packages, other compilers support a per-user or an arbitrary db specified at some location in the file system. This can be used to build isloated environments of packages, for example to build a collection of related packages without installing them globally.

Constructors

GlobalPackageDB |
UserPackageDB |
SpecificPackageDB FilePath |

Instances

Eq PackageDB # |
Instance details Defined in Distribution.Simple.Compiler Methods (==) :: PackageDB -> PackageDB -> Bool # (/=) :: PackageDB -> PackageDB -> Bool #
Ord PackageDB # |
Instance details Defined in Distribution.Simple.Compiler Methods compare :: PackageDB -> PackageDB -> Ordering # (<) :: PackageDB -> PackageDB -> Bool # (<=) :: PackageDB -> PackageDB -> Bool # (>) :: PackageDB -> PackageDB -> Bool # (>=) :: PackageDB -> PackageDB -> Bool # max :: PackageDB -> PackageDB -> PackageDB # min :: PackageDB -> PackageDB -> PackageDB #
Read PackageDB # |
Instance details Defined in Distribution.Simple.Compiler Methods readsPrec :: Int -> ReadS PackageDB Source # readList :: ReadS [PackageDB] Source # readPrec :: ReadPrec PackageDB Source # readListPrec :: ReadPrec [PackageDB] Source #
Show PackageDB # |
Instance details Defined in Distribution.Simple.Compiler Methods showsPrec :: Int -> PackageDB -> ShowS Source # show :: PackageDB -> String Source # showList :: [PackageDB] -> ShowS Source #
Generic PackageDB # |
Instance details Defined in Distribution.Simple.Compiler Associated Types type Rep PackageDB :: * -> * Source # Methods from :: PackageDB -> Rep PackageDB x Source # to :: Rep PackageDB x -> PackageDB Source #
Binary PackageDB # |
Instance details Defined in Distribution.Simple.Compiler Methods put :: PackageDB -> Put Source # get :: Get PackageDB Source # putList :: [PackageDB] -> Put Source #
type Rep PackageDB # |
Instance details Defined in Distribution.Simple.Compiler type Rep PackageDB = D1 (MetaData "PackageDB" "Distribution.Simple.Compiler" "Cabal-2.2.0.1" False) (C1 (MetaCons "GlobalPackageDB" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "UserPackageDB" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "SpecificPackageDB" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath))))

data Compiler #

Constructors

Compiler |
Fields compilerId :: CompilerId Compiler flavour and version. compilerAbiTag :: AbiTag Tag for distinguishing incompatible ABI's on the same architecture/os. compilerCompat :: [CompilerId] Other implementations that this compiler claims to be compatible with. compilerLanguages :: [(Language, Flag)] Supported language standards. compilerExtensions :: [(Extension, Maybe Flag)] Supported extensions. compilerProperties :: Map String String A key-value map for properties not covered by the above fields.

Instances

Eq Compiler # |
Instance details Defined in Distribution.Simple.Compiler Methods (==) :: Compiler -> Compiler -> Bool # (/=) :: Compiler -> Compiler -> Bool #
Read Compiler # |
Instance details Defined in Distribution.Simple.Compiler Methods readsPrec :: Int -> ReadS Compiler Source # readList :: ReadS [Compiler] Source # readPrec :: ReadPrec Compiler Source # readListPrec :: ReadPrec [Compiler] Source #
Show Compiler # |
Instance details Defined in Distribution.Simple.Compiler Methods showsPrec :: Int -> Compiler -> ShowS Source # show :: Compiler -> String Source # showList :: [Compiler] -> ShowS Source #
Generic Compiler # |
Instance details Defined in Distribution.Simple.Compiler Associated Types type Rep Compiler :: * -> * Source # Methods from :: Compiler -> Rep Compiler x Source # to :: Rep Compiler x -> Compiler Source #
Binary Compiler # |
Instance details Defined in Distribution.Simple.Compiler Methods put :: Compiler -> Put Source # get :: Get Compiler Source # putList :: [Compiler] -> Put Source #
type Rep Compiler # |
Instance details Defined in Distribution.Simple.Compiler type Rep Compiler = D1 (MetaData "Compiler" "Distribution.Simple.Compiler" "Cabal-2.2.0.1" False) (C1 (MetaCons "Compiler" PrefixI True) ((S1 (MetaSel (Just "compilerId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CompilerId) :*: (S1 (MetaSel (Just "compilerAbiTag") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 AbiTag) :*: S1 (MetaSel (Just "compilerCompat") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [CompilerId]))) :*: (S1 (MetaSel (Just "compilerLanguages") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(Language, Flag)]) :*: (S1 (MetaSel (Just "compilerExtensions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(Extension, Maybe Flag)]) :*: S1 (MetaSel (Just "compilerProperties") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map String String))))))

showCompilerId :: Compiler -> String #

showCompilerIdWithAbi :: Compiler -> String #

compilerFlavor :: Compiler -> CompilerFlavor #

compilerVersion :: Compiler -> Version #

compilerCompatFlavor :: CompilerFlavor -> Compiler -> Bool #

Is this compiler compatible with the compiler flavour we're interested in?

For example this checks if the compiler is actually GHC or is another compiler that claims to be compatible with some version of GHC, e.g. GHCJS.

    if compilerCompatFlavor GHC compiler then ... else ...

compilerCompatVersion :: CompilerFlavor -> Compiler -> Maybe Version #

Is this compiler compatible with the compiler flavour we're interested in, and if so what version does it claim to be compatible with.

For example this checks if the compiler is actually GHC-7.x or is another compiler that claims to be compatible with some GHC-7.x version.

    case compilerCompatVersion GHC compiler of
      Just (Version (7:_)) -> ...
      _                    -> ...

compilerInfo :: Compiler -> CompilerInfo #

registrationPackageDB :: PackageDBStack -> PackageDB #

Return the package that we should register into. This is the package db at the top of the stack.

absolutePackageDBPaths :: PackageDBStack -> NoCallStackIO PackageDBStack #

Make package paths absolute

absolutePackageDBPath :: PackageDB -> NoCallStackIO PackageDB #

flagToOptimisationLevel :: Maybe String -> OptimisationLevel #

flagToDebugInfoLevel :: Maybe String -> DebugInfoLevel #

unsupportedLanguages :: Compiler -> [Language] -> [Language] #

languageToFlags :: Compiler -> Maybe Language -> [Flag] #

unsupportedExtensions :: Compiler -> [Extension] -> [Extension] #

For the given compiler, return the extensions it does not support.

extensionsToFlags :: Compiler -> [Extension] -> [Flag] #

For the given compiler, return the flags for the supported extensions.

parmakeSupported :: Compiler -> Bool #

Does this compiler support parallel --make mode?

reexportedModulesSupported :: Compiler -> Bool #

Does this compiler support reexported-modules?

renamingPackageFlagsSupported :: Compiler -> Bool #

Does this compiler support thinning/renaming on package flags?

unifiedIPIDRequired :: Compiler -> Bool #

Does this compiler have unified IPIDs (so no package keys)

packageKeySupported :: Compiler -> Bool #

Does this compiler support package keys?

unitIdSupported :: Compiler -> Bool #

Does this compiler support unit IDs?

backpackSupported :: Compiler -> Bool #

Does this compiler support Backpack?

libraryDynDirSupported :: Compiler -> Bool #

Does this compiler support a package database entry with: "dynamic-library-dirs"?

arResponseFilesSupported :: Compiler -> Bool #

Does this compiler's "ar" command supports response file arguments (i.e. @file-style arguments).

coverageSupported :: Compiler -> Bool #

Does this compiler support Haskell program coverage?

profilingSupported :: Compiler -> Bool #

Does this compiler support profiling?

flagToProfDetailLevel :: String -> ProfDetailLevel #

knownProfDetailLevels :: [(String, [String], ProfDetailLevel)] #

showProfDetailLevel :: ProfDetailLevel -> String #

module Language.Haskell.Extension

# Simple interface

defaultMain :: IO () #

A simple implementation of `main` for a Cabal setup script. It reads the package description file using IO, and performs the action specified on the command line.

defaultMainNoRead :: GenericPackageDescription -> IO () #

Like `defaultMain`, but accepts the package description as input rather than using IO to read it.

defaultMainArgs :: [String] -> IO () #

A version of `defaultMain` that is passed the command line arguments, rather than getting them from the environment.

# Customization

data UserHooks #

Hooks allow authors to add specific functionality before and after a command is run, and also to specify additional preprocessors.

- WARNING: The hooks interface is under rather constant flux as we try to understand users needs. Setup files that depend on this interface may break in future releases.

Constructors

UserHooks |
Fields runTests :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO () Deprecated: Please use the new testing interface instead! Used for `./setup test` readDesc :: IO (Maybe GenericPackageDescription) Read the description file hookedPreProcessors :: [PPSuffixHandler] Custom preprocessors in addition to and overriding `knownSuffixHandlers`. hookedPrograms :: [Program] These programs are detected at configure time. Arguments for them are added to the configure command. preConf :: Args -> ConfigFlags -> IO HookedBuildInfo Hook to run before configure command confHook :: (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo Over-ride this hook to get different behavior during configure. postConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after configure command preBuild :: Args -> BuildFlags -> IO HookedBuildInfo Hook to run before build command. Second arg indicates verbosity level. buildHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO () Over-ride this hook to get different behavior during build. postBuild :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after build command. Second arg indicates verbosity level. preRepl :: Args -> ReplFlags -> IO HookedBuildInfo Hook to run before repl command. Second arg indicates verbosity level. replHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO () Over-ride this hook to get different behavior during interpretation. postRepl :: Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after repl command. Second arg indicates verbosity level. preClean :: Args -> CleanFlags -> IO HookedBuildInfo Hook to run before clean command. Second arg indicates verbosity level. cleanHook :: PackageDescription -> () -> UserHooks -> CleanFlags -> IO () Over-ride this hook to get different behavior during clean. postClean :: Args -> CleanFlags -> PackageDescription -> () -> IO () Hook to run after clean command. Second arg indicates verbosity level. preCopy :: Args -> CopyFlags -> IO HookedBuildInfo Hook to run before copy command copyHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO () Over-ride this hook to get different behavior during copy. postCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after copy command preInst :: Args -> InstallFlags -> IO HookedBuildInfo Hook to run before install command instHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO () Over-ride this hook to get different behavior during install. postInst :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after install command. postInst should be run on the target, not on the build machine. preSDist :: Args -> SDistFlags -> IO HookedBuildInfo Hook to run before sdist command. Second arg indicates verbosity level. sDistHook :: PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO () Over-ride this hook to get different behavior during sdist. postSDist :: Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO () Hook to run after sdist command. Second arg indicates verbosity level. preReg :: Args -> RegisterFlags -> IO HookedBuildInfo Hook to run before register command regHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO () Over-ride this hook to get different behavior during registration. postReg :: Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after register command preUnreg :: Args -> RegisterFlags -> IO HookedBuildInfo Hook to run before unregister command unregHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO () Over-ride this hook to get different behavior during unregistration. postUnreg :: Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after unregister command preHscolour :: Args -> HscolourFlags -> IO HookedBuildInfo Hook to run before hscolour command. Second arg indicates verbosity level. hscolourHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO () Over-ride this hook to get different behavior during hscolour. postHscolour :: Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after hscolour command. Second arg indicates verbosity level. preDoctest :: Args -> DoctestFlags -> IO HookedBuildInfo Hook to run before doctest command. Second arg indicates verbosity level. doctestHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> DoctestFlags -> IO () Over-ride this hook to get different behavior during doctest. postDoctest :: Args -> DoctestFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after doctest command. Second arg indicates verbosity level. preHaddock :: Args -> HaddockFlags -> IO HookedBuildInfo Hook to run before haddock command. Second arg indicates verbosity level. haddockHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO () Over-ride this hook to get different behavior during haddock. postHaddock :: Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after haddock command. Second arg indicates verbosity level. preTest :: Args -> TestFlags -> IO HookedBuildInfo Hook to run before test command. testHook :: Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO () Over-ride this hook to get different behavior during test. postTest :: Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after test command. preBench :: Args -> BenchmarkFlags -> IO HookedBuildInfo Hook to run before bench command. benchHook :: Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO () Over-ride this hook to get different behavior during bench. postBench :: Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO () Hook to run after bench command.

type Args = [String] #

defaultMainWithHooks :: UserHooks -> IO () #

A customizable version of `defaultMain`.

defaultMainWithHooksArgs :: UserHooks -> [String] -> IO () #

A customizable version of `defaultMain` that also takes the command line arguments.

defaultMainWithHooksNoRead :: UserHooks -> GenericPackageDescription -> IO () #

A customizable version of `defaultMainNoRead`.

defaultMainWithHooksNoReadArgs :: UserHooks -> GenericPackageDescription -> [String] -> IO () #

A customizable version of `defaultMainNoRead` that also takes the command line arguments.

Since: Cabal-2.2.0.0

## Standard sets of hooks

simpleUserHooks :: UserHooks #

Hooks that correspond to a plain instantiation of the "simple" build system

autoconfUserHooks :: UserHooks #

defaultUserHooks :: UserHooks #

Deprecated: Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2 compatibility in which case you must stick with defaultUserHooks

Basic autoconf `UserHooks`:

- `postConf` runs `./configure`, if present.
- the pre-hooks `preBuild`, `preClean`, `preCopy`, `preInst`, `preReg` and `preUnreg` read additional build information from package`.buildinfo`, if present.

Thus `configure` can use local system information to generate package`.buildinfo` and possibly other files.

emptyUserHooks :: UserHooks #

Empty `UserHooks` which do nothing.

## Utils

defaultHookedPackageDesc :: IO (Maybe FilePath) #

Deprecated: Use findHookedPackageDesc with the proper base directory instead

Optional auxiliary package information file (pkgname`.buildinfo`)