-
Notifications
You must be signed in to change notification settings - Fork 848
Closed
Description
So we already have an implementation of this in stackage-common but under slightly different superficial arguments. We'd like it updated to match the proposal (see end of ticket). Currently,
getPackage :: FinalAction
-> Map Text Bool
-> Map PackageName (Map Text Bool)
-> Loc Absolute File
-> IO Packagethe two flag structure arguments are redundant, it can be just one. And the final action is remnant from fpbuild, it's really only used to determine whether the test suite or benchmarks are enabled. So these things can be put in a PackageConfig record data type (as below). It should just be a case of updating the places that need to be updated to enforce this API.
You can this along with your stackage-curator stuff and then pass to me and I'll port stackage-build to the latest stackage-common API and update anything as necessary.
-- | Anything to do with a package associated with some directory.
module Stackage.Package where
data PackageException
data Package = Package
{packageName :: !PackageName
,packageVersion :: !PackageVersion
,packageDir :: !FilePath
,packageFiles :: !(Set FilePath)
,packageDependencies :: !(Map PackageName VersionRange)
,packageTools :: !(Set Tool)
,packageFlags :: !(Map Text Bool)}
data BuildResult
data PackageConfig = PackageConfig
{ packageConfigEnableTests :: !Bool
, packageConfigEnableBenchmarks :: !Bool
, packageConfigFlags :: !Map Text Bool
}
readPackage :: (MonadLogger m,MonadIO m,MonadThrow m)
=> PackageConfig -> Loc Absolute File -> m PackageMetadata
Metadata
Assignees
Labels
No labels