cabal-install-3.12.1.0: The command-line interface for Cabal and Hackage.

Safe Haskell | None
Language | Haskell2010

Distribution.Client.Reconfigure

Synopsis

- newtype Check a = Check {
  - runCheck :: Any -> a -> IO (Any, a)
  }
- reconfigure :: ((ConfigFlags, ConfigExFlags) -> [String] -> GlobalFlags -> IO ()) -> Verbosity -> FilePath -> Flag (Maybe Int) -> Check (ConfigFlags, ConfigExFlags) -> [String] -> GlobalFlags -> SavedConfig -> IO SavedConfig

# Documentation

newtype Check a #

`Check` represents a function to check some condition on type `a`. The returned `Any` is `True` if any part of the condition failed.

Constructors

Check |

Fields

- runCheck :: Any -> a -> IO (Any, a)

#### Instances

Instances details

Monoid (Check a) # |
Instance details Defined in Distribution.Client.Reconfigure Methods mempty :: Check a # mappend :: Check a -> Check a -> Check a # mconcat :: [Check a] -> Check a #
Semigroup (Check a) # |
Instance details Defined in Distribution.Client.Reconfigure Methods (<>) :: Check a -> Check a -> Check a # sconcat :: NonEmpty (Check a) -> Check a # stimes :: Integral b => b -> Check a -> Check a #

reconfigure #

Arguments

:: ((ConfigFlags, ConfigExFlags) -> [String] -> GlobalFlags -> IO ()) | configure action
-> Verbosity | Verbosity setting
-> FilePath | "dist" prefix

-> Flag (Maybe Int)

- j flag for reinstalling add-source deps.

-> 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.