Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Check a = Check {}
- reconfigure :: ((ConfigFlags, ConfigExFlags) -> [String] -> GlobalFlags -> IO ()) -> Verbosity -> SymbolicPath Pkg (Dir Dist) -> Flag (Maybe Int) -> Check (ConfigFlags, ConfigExFlags) -> [String] -> GlobalFlags -> SavedConfig -> IO SavedConfig
Documentation
Check
represents a function to check some condition on type a
. The
returned Any
is True
if any part of the condition failed.
:: ((ConfigFlags, ConfigExFlags) -> [String] -> GlobalFlags -> IO ()) | configure action |
-> Verbosity | Verbosity setting |
-> SymbolicPath Pkg (Dir Dist) | "dist" prefix |
-> Flag (Maybe Int) |
|
-> Check (ConfigFlags, ConfigExFlags) | Check that the required flags are set. If they are not set, provide a message explaining the reason for reconfiguration. |
-> [String] | Extra arguments |
-> GlobalFlags | Global flags |
-> SavedConfig | |
-> IO SavedConfig |
Re-configure the package in the current directory if needed. Deciding when to reconfigure and with which options is convoluted:
If we are reconfiguring, we must always run configure
with the
verbosity option we are given; however, that a previous configuration
uses a different verbosity setting is not reason enough to reconfigure.
The package should be configured to use the same "dist" prefix as
given to the build
command, otherwise the build will probably
fail. Not only does this determine the "dist" prefix setting if we
need to reconfigure anyway, but an existing configuration should be
invalidated if its "dist" prefix differs.
If the package has never been configured (i.e., there is no LocalBuildInfo), we must configure first, using the default options.
If the package has been configured, there will be a LocalBuildInfo
.
If there no package description file, we assume that the
PackageDescription
is up to date, though the configuration may need
to be updated for other reasons (see above). If there is a package
description file, and it has been modified since the LocalBuildInfo
was generated, then we need to reconfigure.
The caller of this function may also have specific requirements
regarding the flags the last configuration used. For example,
testAction
requires that the package be configured with test suites
enabled. The caller may pass the required settings to this function
along with a function to check the validity of the saved ConfigFlags
;
these required settings will be checked first upon determining that
a previous configuration exists.