Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Module for detecting if recompilation is required
Synopsis
- checkOldIface :: HscEnv -> ModSummary -> Maybe ModIface -> IO (MaybeValidated ModIface)
- data RecompileRequired
- needsRecompileBecause :: RecompReason -> RecompileRequired
- recompThen :: Monad m => m RecompileRequired -> m RecompileRequired -> m RecompileRequired
- data MaybeValidated a
- = UpToDateItem a
- | OutOfDateItem !CompileReason (Maybe a)
- outOfDateItemBecause :: RecompReason -> Maybe a -> MaybeValidated a
- data RecompReason
- = UnitDepRemoved UnitId
- | ModulePackageChanged String
- | SourceFileChanged
- | ThisUnitIdChanged
- | ImpurePlugin
- | PluginsChanged
- | PluginFingerprintChanged
- | ModuleInstChanged
- | HieMissing
- | HieOutdated
- | SigsMergeChanged
- | ModuleChanged ModuleName
- | ModuleRemoved (UnitId, ModuleName)
- | ModuleAdded (UnitId, ModuleName)
- | ModuleChangedRaw ModuleName
- | ModuleChangedIface ModuleName
- | FileChanged FilePath
- | CustomReason String
- | FlagsChanged
- | OptimFlagsChanged
- | HpcFlagsChanged
- | MissingBytecode
- | MissingObjectFile
- | MissingDynObjectFile
- | MissingDynHiFile
- | MismatchedDynHiFile
- | ObjectsChanged
- | LibraryChanged
- data CompileReason
- recompileRequired :: RecompileRequired -> Bool
- addFingerprints :: HscEnv -> PartialModIface -> IO ModIface
Documentation
checkOldIface :: HscEnv -> ModSummary -> Maybe ModIface -> IO (MaybeValidated ModIface) Source #
Top level function to check if the version of an old interface file is equivalent to the current source file the user asked us to compile. If the same, we can avoid recompilation.
We return on the outside whether the interface file is up to date, providing
evidence that is with a ModIface
. In the case that it isn't, we may also
return a found or provided ModIface
. Why we don't always return the old
one, if it exists, is unclear to me, except that I tried it and some tests
failed (see #18205).
data RecompileRequired Source #
UpToDate | everything is up to date, recompilation is not required |
NeedsRecompile !CompileReason | Need to compile the module |
Instances
Monoid RecompileRequired Source # | |
Defined in GHC.Iface.Recomp | |
Semigroup RecompileRequired Source # | |
Defined in GHC.Iface.Recomp (<>) :: RecompileRequired -> RecompileRequired -> RecompileRequired Source # sconcat :: NonEmpty RecompileRequired -> RecompileRequired Source # stimes :: Integral b => b -> RecompileRequired -> RecompileRequired Source # | |
Outputable RecompileRequired Source # | |
Defined in GHC.Iface.Recomp ppr :: RecompileRequired -> SDoc Source # | |
Eq RecompileRequired Source # | |
Defined in GHC.Iface.Recomp (==) :: RecompileRequired -> RecompileRequired -> Bool # (/=) :: RecompileRequired -> RecompileRequired -> Bool # |
recompThen :: Monad m => m RecompileRequired -> m RecompileRequired -> m RecompileRequired Source #
data MaybeValidated a Source #
UpToDateItem a | The item contained is validated to be up to date |
OutOfDateItem | The item is are absent altogether or out of date, for the reason given. |
|
Instances
Functor MaybeValidated Source # | |
Defined in GHC.Iface.Recomp fmap :: (a -> b) -> MaybeValidated a -> MaybeValidated b Source # (<$) :: a -> MaybeValidated b -> MaybeValidated a Source # |
outOfDateItemBecause :: RecompReason -> Maybe a -> MaybeValidated a Source #
data RecompReason Source #
Instances
Outputable RecompReason Source # | |
Defined in GHC.Iface.Recomp ppr :: RecompReason -> SDoc Source # | |
Eq RecompReason Source # | |
Defined in GHC.Iface.Recomp (==) :: RecompReason -> RecompReason -> Bool # (/=) :: RecompReason -> RecompReason -> Bool # |
data CompileReason Source #
MustCompile | The .hs file has been touched, or the .o/.hi file does not exist |
RecompBecause !RecompReason | The .o/.hi files are up to date, but something else has changed to force recompilation; the String says what (one-line summary) |
Instances
Outputable CompileReason Source # | |
Defined in GHC.Iface.Recomp ppr :: CompileReason -> SDoc Source # | |
Eq CompileReason Source # | |
Defined in GHC.Iface.Recomp (==) :: CompileReason -> CompileReason -> Bool # (/=) :: CompileReason -> CompileReason -> Bool # |
addFingerprints :: HscEnv -> PartialModIface -> IO ModIface Source #
Add fingerprints for top-level declarations to a ModIface
.
See Note [Fingerprinting IfaceDecls]