-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Tools for curating Stackage bundles
--
-- Please see http://www.stackage.org/package/stackage-curator for
-- a description and documentation.
@package stackage-curator
@version 0.7.0.2
module Stackage.Prelude
-- | There seems to be a bug in Cabal where serializing and deserializing
-- version ranges winds up with different representations. So we have a
-- super-simplifier to deal with that.
simplifyVersionRange :: VersionRange -> VersionRange
-- | Topologically sort so that items with dependencies occur after those
-- dependencies.
topologicalSort :: (Ord key, Show key, MonadThrow m, Typeable key) => (value -> finalValue) -> (value -> Set key) -> Map key value -> m (Vector (key, finalValue))
data TopologicalSortException key
NoEmptyDeps :: (Map key (Set key)) -> TopologicalSortException key
copyDir :: FilePath -> FilePath -> IO ()
instance Typeable TopologicalSortException
instance Show key => Show (TopologicalSortException key)
instance (Show key, Typeable key) => Exception (TopologicalSortException key)
module Stackage.CorePackages
-- | Get a Map of all of the core packages. Core packages are
-- defined as packages which ship with GHC itself.
--
-- Precondition: GHC global package database has only core packages, and
-- GHC ships with just a single version of each packages.
getCorePackages :: IO (Map PackageName Version)
-- | A list of executables that are shipped with GHC.
getCoreExecutables :: IO (Set ExeName)
getGhcVersion :: IO Version
-- | The constraints on package selection for a new build plan.
module Stackage.BuildConstraints
data BuildConstraints
BuildConstraints :: Set PackageName -> (PackageName -> PackageConstraints) -> SystemInfo -> Map Text (Set Text) -> BuildConstraints
-- | This does not include core packages.
bcPackages :: BuildConstraints -> Set PackageName
bcPackageConstraints :: BuildConstraints -> PackageName -> PackageConstraints
bcSystemInfo :: BuildConstraints -> SystemInfo
-- | map an account to set of pingees
bcGithubUsers :: BuildConstraints -> Map Text (Set Text)
data PackageConstraints :: *
PackageConstraints :: VersionRange -> Maybe Maintainer -> TestState -> TestState -> Bool -> Map FlagName Bool -> Bool -> PackageConstraints
pcVersionRange :: PackageConstraints -> VersionRange
pcMaintainer :: PackageConstraints -> Maybe Maintainer
pcTests :: PackageConstraints -> TestState
pcHaddocks :: PackageConstraints -> TestState
pcBuildBenchmarks :: PackageConstraints -> Bool
pcFlagOverrides :: PackageConstraints -> Map FlagName Bool
pcEnableLibProfile :: PackageConstraints -> Bool
data TestState :: *
ExpectSuccess :: TestState
ExpectFailure :: TestState
Don'tBuild :: TestState
data SystemInfo :: *
SystemInfo :: Version -> OS -> Arch -> Map PackageName Version -> Set ExeName -> SystemInfo
siGhcVersion :: SystemInfo -> Version
siOS :: SystemInfo -> OS
siArch :: SystemInfo -> Arch
siCorePackages :: SystemInfo -> Map PackageName Version
siCoreExecutables :: SystemInfo -> Set ExeName
getSystemInfo :: IO SystemInfo
-- | The proposed plan from the requirements provided by contributors.
--
-- Checks the current directory for a build-constraints.yaml file and
-- uses it if present. If not, downloads from Github.
defaultBuildConstraints :: Manager -> IO BuildConstraints
toBC :: ConstraintFile -> IO BuildConstraints
data BuildConstraintsSource
BCSDefault :: BuildConstraintsSource
BCSFile :: FilePath -> BuildConstraintsSource
BCSWeb :: Request -> BuildConstraintsSource
loadBuildConstraints :: BuildConstraintsSource -> Manager -> IO BuildConstraints
instance Show BuildConstraintsSource
instance FromJSON ConstraintFile
-- | Dealing with the 00-index file and all its cabal files.
module Stackage.PackageIndex
-- | Stream all of the cabal files from the 00-index tar file.
sourcePackageIndex :: (MonadThrow m, MonadResource m, MonadActive m, MonadBaseControl IO m) => Producer m UnparsedCabalFile
-- | A cabal file with name and version parsed from the filepath, and the
-- package description itself ready to be parsed. It's left in unparsed
-- form for efficiency.
data UnparsedCabalFile
UnparsedCabalFile :: PackageName -> Version -> (forall m. MonadThrow m => m GenericPackageDescription) -> UnparsedCabalFile
ucfName :: UnparsedCabalFile -> PackageName
ucfVersion :: UnparsedCabalFile -> Version
ucfParse :: UnparsedCabalFile -> forall m. MonadThrow m => m GenericPackageDescription
-- | Get all of the latest descriptions for name/version pairs matching the
-- given criterion.
getLatestDescriptions :: MonadIO m => (PackageName -> Version -> Bool) -> (GenericPackageDescription -> IO desc) -> m (Map PackageName desc)
instance Typeable InvalidCabalPath
instance Typeable CabalParseException
instance Show InvalidCabalPath
instance Show CabalParseException
instance Exception CabalParseException
instance Exception InvalidCabalPath
module Stackage.GithubPings
-- | Determine accounts to be pinged on Github based on various metadata in
-- the package description.
getGithubPings :: BuildConstraints -> GenericPackageDescription -> Set Text
-- | Manipulate GenericPackageDescription from Cabal into
-- something more useful for us.
module Stackage.PackageDescription
data SimpleDesc :: *
SimpleDesc :: Map PackageName DepInfo -> Map ExeName DepInfo -> Set ExeName -> Set Text -> SimpleDesc
sdPackages :: SimpleDesc -> Map PackageName DepInfo
sdTools :: SimpleDesc -> Map ExeName DepInfo
sdProvidedExes :: SimpleDesc -> Set ExeName
sdModules :: SimpleDesc -> Set Text
-- | Convert a GenericPackageDescription into a SimpleDesc by
-- following the constraints in the provided CheckCond.
toSimpleDesc :: MonadThrow m => CheckCond -> GenericPackageDescription -> m SimpleDesc
data CheckCond
CheckCond :: PackageName -> OS -> Arch -> Map FlagName Bool -> CompilerFlavor -> Version -> Bool -> Bool -> CheckCond
ccPackageName :: CheckCond -> PackageName
ccOS :: CheckCond -> OS
ccArch :: CheckCond -> Arch
ccFlags :: CheckCond -> Map FlagName Bool
ccCompilerFlavor :: CheckCond -> CompilerFlavor
ccCompilerVersion :: CheckCond -> Version
ccIncludeTests :: CheckCond -> Bool
ccIncludeBenchmarks :: CheckCond -> Bool
data Component :: *
CompLibrary :: Component
CompExecutable :: Component
CompTestSuite :: Component
CompBenchmark :: Component
data DepInfo :: *
DepInfo :: Set Component -> VersionRange -> DepInfo
diComponents :: DepInfo -> Set Component
diRange :: DepInfo -> VersionRange
instance Typeable CheckCondException
instance Show CheckCondException
instance Exception CheckCondException
-- | Representation of a concrete build plan, and how to generate a new one
-- based on constraints.
module Stackage.BuildPlan
data BuildPlan :: *
BuildPlan :: SystemInfo -> Vector (PackageName, Version) -> Map PackageName PackagePlan -> Map Text (Set Text) -> BuildPlan
bpSystemInfo :: BuildPlan -> SystemInfo
bpTools :: BuildPlan -> Vector (PackageName, Version)
bpPackages :: BuildPlan -> Map PackageName PackagePlan
bpGithubUsers :: BuildPlan -> Map Text (Set Text)
data PackagePlan :: *
PackagePlan :: Version -> Set Text -> Set PackageName -> PackageConstraints -> SimpleDesc -> PackagePlan
ppVersion :: PackagePlan -> Version
ppGithubPings :: PackagePlan -> Set Text
ppUsers :: PackagePlan -> Set PackageName
ppConstraints :: PackagePlan -> PackageConstraints
ppDesc :: PackagePlan -> SimpleDesc
-- | Make a build plan given these package set and build constraints.
newBuildPlan :: MonadIO m => Map PackageName PackagePlan -> BuildConstraints -> m BuildPlan
makeToolMap :: Map PackageName PackagePlan -> Map ExeName (Set PackageName)
getLatestAllowedPlans :: MonadIO m => BuildConstraints -> m (Map PackageName PackagePlan)
-- | Confirm that a build plan has a consistent set of dependencies.
module Stackage.CheckBuildPlan
-- | Check the build plan for missing deps, wrong versions, etc.
checkBuildPlan :: MonadThrow m => BuildPlan -> m ()
data BadBuildPlan
instance Typeable BadBuildPlan
instance Eq PkgUser
instance Ord PkgUser
instance Monoid BadBuildPlan
instance Show BadBuildPlan
instance Exception BadBuildPlan
-- | Take an existing build plan and bump all packages to the newest
-- version in the same major version number.
module Stackage.UpdateBuildPlan
updateBuildConstraints :: BuildPlan -> BuildConstraints
updateBuildPlan :: Map PackageName PackagePlan -> BuildPlan -> IO BuildPlan
-- | General commands related to ghc-pkg.
module Stackage.GhcPkg
setupPackageDatabase :: Maybe FilePath -> FilePath -> (ByteString -> IO ()) -> Map PackageName Version -> (PackageIdentifier -> IO ()) -> IO (Set PackageName)
-- | Perform an actual build, generate a binary package database and a
-- documentation directory in the process.
module Stackage.PerformBuild
performBuild :: PerformBuild -> IO [Text]
data PerformBuild
PerformBuild :: BuildPlan -> FilePath -> (ByteString -> IO ()) -> FilePath -> Int -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> PerformBuild
pbPlan :: PerformBuild -> BuildPlan
pbInstallDest :: PerformBuild -> FilePath
pbLog :: PerformBuild -> ByteString -> IO ()
pbLogDir :: PerformBuild -> FilePath
pbJobs :: PerformBuild -> Int
-- | Register packages in the global database
pbGlobalInstall :: PerformBuild -> Bool
pbEnableTests :: PerformBuild -> Bool
pbEnableHaddock :: PerformBuild -> Bool
pbEnableLibProfiling :: PerformBuild -> Bool
pbEnableExecDyn :: PerformBuild -> Bool
pbVerbose :: PerformBuild -> Bool
-- | Pass --allow-newer to cabal configure
pbAllowNewer :: PerformBuild -> Bool
-- | Should we build Hoogle database?
--
-- May be disabled due to:
-- https:/ghc.haskell.orgtracghcticket/9921
pbBuildHoogle :: PerformBuild -> Bool
data BuildException
BuildException :: (Map PackageName BuildFailure) -> [Text] -> BuildException
pbDocDir :: PerformBuild -> FilePath
instance Typeable BuildFailure
instance Typeable BuildException
instance Show BuildFailure
instance Show ResultType
instance Enum ResultType
instance Eq ResultType
instance Ord ResultType
instance Bounded ResultType
instance Read ResultType
instance Show PrevResult
instance Enum PrevResult
instance Eq PrevResult
instance Ord PrevResult
instance Bounded PrevResult
instance Read PrevResult
instance Exception BuildFailure
instance Show BuildException
instance Exception BuildException
module Stackage.InstallBuild
-- | Flags passed in from the command line.
data InstallFlags
InstallFlags :: !BuildPlanSource -> !FilePath -> !(Maybe FilePath) -> !Int -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> InstallFlags
ifPlanSource :: InstallFlags -> !BuildPlanSource
ifInstallDest :: InstallFlags -> !FilePath
ifLogDir :: InstallFlags -> !(Maybe FilePath)
ifJobs :: InstallFlags -> !Int
ifGlobalInstall :: InstallFlags -> !Bool
ifEnableTests :: InstallFlags -> !Bool
ifEnableHaddock :: InstallFlags -> !Bool
ifEnableLibProfiling :: InstallFlags -> !Bool
ifEnableExecDyn :: InstallFlags -> !Bool
ifVerbose :: InstallFlags -> !Bool
ifSkipCheck :: InstallFlags -> !Bool
ifBuildHoogle :: InstallFlags -> !Bool
-- | Source for build plan.
data BuildPlanSource
BPSBundleWeb :: String -> BuildPlanSource
BPSFile :: FilePath -> BuildPlanSource
-- | Install stackage from an existing build plan.
installBuild :: InstallFlags -> IO ()
instance Typeable InstallBuildException
instance Show BuildPlanSource
instance Show InstallFlags
instance Show InstallBuildException
instance Exception InstallBuildException
-- | Create a bundle to be uploaded to Stackage Server.
module Stackage.ServerBundle
serverBundle :: EpochTime -> Text -> Text -> BuildPlan -> LByteString
-- | Get current time
epochTime :: IO EpochTime
-- | All package/versions in a build plan, including core packages.
--
-- Note that this may include packages not available on Hackage.
bpAllPackages :: BuildPlan -> Map PackageName Version
docsListing :: BuildPlan -> FilePath -> IO DocMap
-- | Create a V2 bundle, which contains the build plan, metadata, docs, and
-- doc map.
createBundleV2 :: CreateBundleV2 -> IO ()
data CreateBundleV2
CreateBundleV2 :: BuildPlan -> SnapshotType -> FilePath -> FilePath -> CreateBundleV2
cb2Plan :: CreateBundleV2 -> BuildPlan
cb2Type :: CreateBundleV2 -> SnapshotType
cb2DocsDir :: CreateBundleV2 -> FilePath
cb2Dest :: CreateBundleV2 -> FilePath
data SnapshotType :: *
STNightly :: SnapshotType
STLTS :: UnpkInt -> UnpkInt -> SnapshotType
writeIndexStyle :: Maybe Text -> FilePath -> IO [String]
type DocMap = Map Text PackageDocs
data PackageDocs :: *
PackageDocs :: Text -> Map Text [Text] -> PackageDocs
pdVersion :: PackageDocs -> Text
pdModules :: PackageDocs -> Map Text [Text]
-- | Upload to Stackage and Hackage
module Stackage.Upload
data UploadBundle
UploadBundle :: StackageServer -> LByteString -> Maybe Text -> Maybe Text -> Maybe Text -> Text -> UploadBundle
ubServer :: UploadBundle -> StackageServer
ubContents :: UploadBundle -> LByteString
ubAlias :: UploadBundle -> Maybe Text
-- | should be GHC version
ubNightly :: UploadBundle -> Maybe Text
-- | e.g. 2.3
ubLTS :: UploadBundle -> Maybe Text
ubAuthToken :: UploadBundle -> Text
newtype SnapshotIdent
SnapshotIdent :: Text -> SnapshotIdent
unSnapshotIdent :: SnapshotIdent -> Text
uploadBundle :: UploadBundle -> Manager -> IO (SnapshotIdent, Maybe Text)
data UploadDocs
UploadDocs :: StackageServer -> FilePath -> Text -> SnapshotIdent -> UploadDocs
udServer :: UploadDocs -> StackageServer
-- | may be a directory or a tarball
udDocs :: UploadDocs -> FilePath
udAuthToken :: UploadDocs -> Text
udSnapshot :: UploadDocs -> SnapshotIdent
uploadDocs :: UploadDocs -> Manager -> IO (Response LByteString)
uploadHackageDistro :: BuildPlan -> ByteString -> ByteString -> Manager -> IO (Response LByteString)
uploadHackageDistroNamed :: Text -> BuildPlan -> ByteString -> ByteString -> Manager -> IO (Response LByteString)
data UploadDocMap
UploadDocMap :: StackageServer -> Text -> SnapshotIdent -> FilePath -> BuildPlan -> UploadDocMap
udmServer :: UploadDocMap -> StackageServer
udmAuthToken :: UploadDocMap -> Text
udmSnapshot :: UploadDocMap -> SnapshotIdent
udmDocDir :: UploadDocMap -> FilePath
udmPlan :: UploadDocMap -> BuildPlan
uploadDocMap :: UploadDocMap -> Manager -> IO (Response LByteString)
uploadBundleV2 :: UploadBundleV2 -> Manager -> IO Text
data UploadBundleV2
UploadBundleV2 :: StackageServer -> Text -> FilePath -> UploadBundleV2
ub2Server :: UploadBundleV2 -> StackageServer
ub2AuthToken :: UploadBundleV2 -> Text
ub2Bundle :: UploadBundleV2 -> FilePath
def :: Default a => a
data StackageServer
unStackageServer :: StackageServer -> Text
instance Show StackageServer
instance Eq StackageServer
instance Ord StackageServer
instance Hashable StackageServer
instance IsString StackageServer
instance Show SnapshotIdent
instance Eq SnapshotIdent
instance Ord SnapshotIdent
instance Hashable SnapshotIdent
instance IsString SnapshotIdent
instance Default UploadBundle
instance Default StackageServer
module Stackage.CompleteBuild
data BuildType
Nightly :: BuildType
LTS :: BumpType -> Text -> BuildType
data BumpType
Major :: BumpType
Minor :: BumpType
-- | Flags passed in from the command line.
data BuildFlags
BuildFlags :: !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !StackageServer -> !Bool -> BuildFlags
bfEnableTests :: BuildFlags -> !Bool
bfEnableHaddock :: BuildFlags -> !Bool
bfDoUpload :: BuildFlags -> !Bool
bfEnableLibProfile :: BuildFlags -> !Bool
bfEnableExecDyn :: BuildFlags -> !Bool
bfVerbose :: BuildFlags -> !Bool
bfSkipCheck :: BuildFlags -> !Bool
bfUploadV1 :: BuildFlags -> !Bool
bfServer :: BuildFlags -> !StackageServer
bfBuildHoogle :: BuildFlags -> !Bool
-- | Make a complete plan, build, test and upload bundle, docs and distro.
completeBuild :: BuildType -> BuildFlags -> IO ()
-- | Generate and check a new build plan, but do not execute it.
--
-- Since 0.3.1
justCheck :: IO ()
justUploadNightly :: Text -> IO ()
getStackageAuthToken :: IO Text
instance Typeable ParseGoalFailure
instance Show BuildFlags
instance Show BumpType
instance Read BumpType
instance Eq BumpType
instance Ord BumpType
instance Show BuildType
instance Read BuildType
instance Eq BuildType
instance Ord BuildType
instance Show ParseGoalFailure
instance Eq LTSVer
instance Ord LTSVer
instance Show LTSVer
instance Exception ParseGoalFailure