Information about an unit (a unit is an installed module library).
This is a subset of Cabal's InstalledPackageInfo, with just the bits
that GHC is interested in.
Some types are left as parameters to be instantiated differently in ghc-pkg and in ghc itself.
Constructors
GenericUnitInfounitId :: uidUnique unit identifier that is used during compilation (e.g. to generate symbols).
unitInstanceOf :: uidIdentifier of an indefinite unit (i.e. with module holes) that this unit is an instance of.
For non instantiated units, unitInstanceOf=unitId
unitInstantiations :: [(modulename, mod)]How this unit instantiates some of its module holes. Map hole module names to actual module
unitPackageId :: srcpkgidSource package identifier.
Cabal instantiates this with Distribution.Types.PackageId.PackageId type which only contains the source package name and version. Notice that it doesn't contain the Hackage revision, nor any kind of hash.
unitPackageName :: srcpkgnameSource package name
unitPackageVersion :: VersionSource package version
unitComponentName :: Maybe srcpkgnameName of the component.
Cabal supports more than one components (libraries, executables, testsuites) in the same package. Each component has a name except the default one (that can only be a library component) for which we use
Nothing.GHC only deals with "library" components as they are the only kind of components that can be registered in a database and used by other modules.
unitAbiHash :: ShortTextABI hash used to avoid mixing up units compiled with different dependencies, compiler, options, etc.
unitDepends :: [uid]Identifiers of the units this one depends on
unitAbiDepends :: [(uid, ShortText)]Like unitDepends, but each dependency is annotated with the ABI hash we expect the dependency to respect.
unitImportDirs :: [FilePathST]Directories containing module interfaces
unitLibraries :: [ShortText]Names of the Haskell libraries provided by this unit
unitExtDepLibsSys :: [ShortText]Names of the external system libraries that this unit depends on. See also unitExtDepLibsGhc field.
unitExtDepLibsGhc :: [ShortText]Because of slight differences between the GHC dynamic linker (in GHC.Runtime.Linker) and the native system linker, some packages have to link with a different list of libraries when using GHC's. Examples include: libs that are actually gnu ld scripts, and the possibility that the .a libs do not exactly match the .so/.dll equivalents.
If this field is set, then we use that instead of the unitExtDepLibsSys field.
unitLibraryDirs :: [FilePathST]Directories containing libraries provided by this unit. See also unitLibraryDynDirs.
It seems to be used to store paths to external library dependencies too.
unitLibraryDynDirs :: [FilePathST]Directories containing the dynamic libraries provided by this unit. See also unitLibraryDirs.
It seems to be used to store paths to external dynamic library dependencies too.
unitExtDepFrameworks :: [ShortText]Names of the external MacOS frameworks that this unit depends on.
unitExtDepFrameworkDirs :: [FilePathST]Directories containing MacOS frameworks that this unit depends on.
unitLinkerOptions :: [ShortText]Linker (e.g. ld) command line options
unitCcOptions :: [ShortText]C compiler options that needs to be passed to the C compiler when we compile some C code against this unit.
unitIncludes :: [ShortText]C header files that are required by this unit (provided by this unit or external)
unitIncludeDirs :: [FilePathST]Directories containing C header files that this unit depends on.
unitHaddockInterfaces :: [FilePathST]Paths to Haddock interface files for this unit
unitHaddockHTMLs :: [FilePathST]Paths to Haddock directories containing HTML files
unitExposedModules :: [(modulename, Maybe mod)]Modules exposed by the unit.
A module can be re-exported from another package. In this case, we indicate the module origin in the second parameter.
unitHiddenModules :: [modulename]Hidden modules.
These are useful for error reporting (e.g. if a hidden module is imported)
unitIsIndefinite :: BoolTrue if this unit has some module holes that need to be instantiated with real modules to make the unit usable (a.k.a. Backpack).
unitIsExposed :: BoolTrue if the unit is exposed. A unit could be installed in a database by "disabled" by not being exposed.
unitIsTrusted :: BoolTrue if the unit is trusted (cf Safe Haskell)
Instances3Binary, Eq, Show
Binary DbUnitInfoDefined in ghc-boot-9.10.3 · GHC.Unit.Database(Eq uid, Eq modulename, Eq mod, Eq srcpkgid, Eq srcpkgname) => Eq (GenericUnitInfo srcpkgid srcpkgname uid modulename mod)Defined in ghc-boot-9.10.3 · GHC.Unit.Database(Show uid, Show modulename, Show mod, Show srcpkgid, Show srcpkgname) => Show (GenericUnitInfo srcpkgid srcpkgname uid modulename mod)Defined in ghc-boot-9.10.3 · GHC.Unit.Database