Safe Haskell | None |
---|---|
Language | Haskell2010 |
Shared types for various stackage packages.
- data SnapshotDef = SnapshotDef {
- sdParent :: !(Either (CompilerVersion CVWanted) SnapshotDef)
- sdResolver :: !LoadedResolver
- sdResolverName :: !Text
- sdLocations :: ![PackageLocationIndex Subdirs]
- sdDropPackages :: !(Set PackageName)
- sdFlags :: !(Map PackageName (Map FlagName Bool))
- sdHidden :: !(Map PackageName Bool)
- sdGhcOptions :: !(Map PackageName [Text])
- sdGlobalHints :: !(Map PackageName (Maybe Version))
- snapshotDefVC :: VersionConfig SnapshotDef
- sdRawPathName :: SnapshotDef -> String
- data PackageLocation subdirs
- data PackageLocationIndex subdirs
- = PLIndex !PackageIdentifierRevision
- | PLOther !(PackageLocation subdirs)
- data RepoType
- data Subdirs
- data Repo subdirs = Repo {
- repoUrl :: !Text
- repoCommit :: !Text
- repoType :: !RepoType
- repoSubdirs :: !subdirs
- data Archive subdirs = Archive {
- archiveUrl :: !Text
- archiveSubdirs :: !subdirs
- archiveHash :: !(Maybe StaticSHA256)
- newtype ExeName = ExeName {}
- data LoadedSnapshot = LoadedSnapshot {}
- loadedSnapshotVC :: VersionConfig LoadedSnapshot
- data LoadedPackageInfo loc = LoadedPackageInfo {
- lpiVersion :: !Version
- lpiLocation :: !loc
- lpiFlags :: !(Map FlagName Bool)
- lpiGhcOptions :: ![Text]
- lpiPackageDeps :: !(Map PackageName VersionIntervals)
- lpiProvidedExes :: !(Set ExeName)
- lpiNeededExes :: !(Map ExeName VersionIntervals)
- lpiExposedModules :: !(Set ModuleName)
- lpiHide :: !Bool
- newtype ModuleName = ModuleName {}
- fromCabalModuleName :: ModuleName -> ModuleName
- newtype ModuleInfo = ModuleInfo {
- miModules :: Map ModuleName (Set PackageName)
- moduleInfoVC :: VersionConfig ModuleInfo
- setCompilerVersion :: CompilerVersion CVWanted -> SnapshotDef -> SnapshotDef
- sdWantedCompilerVersion :: SnapshotDef -> CompilerVersion CVWanted
Types
data SnapshotDef Source #
A definition of a snapshot. This could be a Stackage snapshot or something custom. It does not include information on the global package database, this is added later.
It may seem more logic to attach flags, options, etc, directly with the desired package. However, this isn't possible yet: our definition may contain tarballs or Git repos, and we don't actually know the package names contained there. Therefore, we capture all of this additional information by package name, and later in the snapshot load step we will resolve the contents of tarballs and repos, figure out package names, and assigned values appropriately.
SnapshotDef | |
|
sdRawPathName :: SnapshotDef -> String Source #
A relative file path including a unique string for the given snapshot.
data PackageLocation subdirs Source #
Where to get the contents of a package (including cabal file revisions) from.
A GADT may be more logical than the index parameter, but this plays more nicely with Generic deriving.
PLFilePath !FilePath | Note that we use |
PLArchive !(Archive subdirs) | |
PLRepo !(Repo subdirs) | Stored in a source control repository |
Functor PackageLocation Source # | |
Eq subdirs => Eq (PackageLocation subdirs) Source # | |
Data subdirs => Data (PackageLocation subdirs) Source # | |
Ord subdirs => Ord (PackageLocation subdirs) Source # | |
Show subdirs => Show (PackageLocation subdirs) Source # | |
Generic (PackageLocation subdirs) Source # | |
NFData a => NFData (PackageLocation a) Source # | |
(~) * subdirs Subdirs => ToJSON (PackageLocation subdirs) Source # | |
(~) * subdirs Subdirs => FromJSON (WithJSONWarnings (PackageLocation subdirs)) Source # | |
Store a => Store (PackageLocation a) Source # | |
type Rep (PackageLocation subdirs) Source # | |
data PackageLocationIndex subdirs Source #
Add in the possibility of getting packages from the index
(including cabal file revisions). We have special handling of this
case in many places in the codebase, and therefore represent it
with a separate data type from PackageLocation
.
PLIndex !PackageIdentifierRevision | Grab the package from the package index with the given version and (optional) cabal file info to specify the correct revision. |
PLOther !(PackageLocation subdirs) |
Functor PackageLocationIndex Source # | |
Eq subdirs => Eq (PackageLocationIndex subdirs) Source # | |
Data subdirs => Data (PackageLocationIndex subdirs) Source # | |
Ord subdirs => Ord (PackageLocationIndex subdirs) Source # | |
Show subdirs => Show (PackageLocationIndex subdirs) Source # | |
Generic (PackageLocationIndex subdirs) Source # | |
NFData a => NFData (PackageLocationIndex a) Source # | |
(~) * subdirs Subdirs => ToJSON (PackageLocationIndex subdirs) Source # | |
(~) * subdirs Subdirs => FromJSON (WithJSONWarnings (PackageLocationIndex subdirs)) Source # | |
Store a => Store (PackageLocationIndex a) Source # | |
type Rep (PackageLocationIndex subdirs) Source # | |
The type of a source control repository.
Information on packages stored in a source control repository.
Repo | |
|
Functor Repo Source # | |
Eq subdirs => Eq (Repo subdirs) Source # | |
Data subdirs => Data (Repo subdirs) Source # | |
Ord subdirs => Ord (Repo subdirs) Source # | |
Show subdirs => Show (Repo subdirs) Source # | |
Generic (Repo subdirs) Source # | |
NFData a => NFData (Repo a) Source # | |
Store a => Store (Repo a) Source # | |
type Rep (Repo subdirs) Source # | |
A package archive, could be from a URL or a local file path. Local file path archives are assumed to be unchanging over time, and so are allowed in custom snapshots.
Archive | |
|
Functor Archive Source # | |
Eq subdirs => Eq (Archive subdirs) Source # | |
Data subdirs => Data (Archive subdirs) Source # | |
Ord subdirs => Ord (Archive subdirs) Source # | |
Show subdirs => Show (Archive subdirs) Source # | |
Generic (Archive subdirs) Source # | |
NFData a => NFData (Archive a) Source # | |
Store a => Store (Archive a) Source # | |
type Rep (Archive subdirs) Source # | |
Name of an executable.
data LoadedSnapshot Source #
A fully loaded snapshot combined , including information gleaned from the global database and parsing cabal files.
Invariant: a global package may not depend upon a snapshot package, a snapshot may not depend upon a local or project, and all dependencies must be satisfied.
data LoadedPackageInfo loc Source #
Information on a single package for the LoadedSnapshot
which
can be installed.
Note that much of the information below (such as the package dependencies or exposed modules) can be conditional in the cabal file, which means it will vary based on flags, arch, and OS.
LoadedPackageInfo | |
|
Functor LoadedPackageInfo Source # | |
Eq loc => Eq (LoadedPackageInfo loc) Source # | |
Data loc => Data (LoadedPackageInfo loc) Source # | |
Show loc => Show (LoadedPackageInfo loc) Source # | |
Generic (LoadedPackageInfo loc) Source # | |
NFData a => NFData (LoadedPackageInfo a) Source # | |
Store a => Store (LoadedPackageInfo a) Source # | |
type Rep (LoadedPackageInfo loc) Source # | |
newtype ModuleName Source #
newtype ModuleInfo Source #
setCompilerVersion :: CompilerVersion CVWanted -> SnapshotDef -> SnapshotDef Source #
Modify the wanted compiler version in this snapshot. This is used
when overriding via the compiler
value in a custom snapshot or
stack.yaml file. We do _not_ need to modify the snapshot's hash for
this: all binary caches of a snapshot are stored in a filepath that
encodes the actual compiler version in addition to the
hash. Therefore, modifications here will not lead to any invalid
data.
sdWantedCompilerVersion :: SnapshotDef -> CompilerVersion CVWanted Source #
Determined the desired compiler version for this SnapshotDef
.