stackage-curator 0.7.0.1 → 0.7.0.2
raw patch · 4 files changed
+64/−4 lines, 4 files
Files
- ChangeLog.md +4/−0
- README.md +44/−0
- Stackage/PerformBuild.hs +14/−2
- stackage-curator.cabal +2/−2
ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.7.0.2++* Deal better with invariant violations around unregistered packages+ ## 0.7.0 * Renamed to stackage-curator
README.md view
@@ -1,5 +1,7 @@ ## stackage-curator +[](https://travis-ci.org/fpco/stackage-curator)+ This repository contains the code for curating Stackage package sets and building reusable package databases. It was originally simply called the stackage package and was part of the stackage repository, but since this is a@@ -10,3 +12,45 @@ * [Stackage Homepage](https://www.stackage.org) * [Main stackage repo](https://github.com/fpco/stackage)++### Code explanation++We start off with *constraints*. Constraints state things like "package X has a+given version range," who the maintainer is for a package, the description of+the system/compiler being used, etc. `BuildConstraints` describes the build as+a whole, whereas `PackageConstraints` describes the constraints on an+individual package.++There are two primary ways of getting a `BuildConstraints`.+`defaultBuildConstraints` inspects the first GHC in the PATH environment variable to+determine GHC version, core packages, core tools, etc. It then uses the+`Stackage.Config` module to extract information on additional packages to be+installed. The secondary approach is in `Stackage2.UpdateBuildPlan`, which will be+discussed later.++`BuildConstraints` does not specify a build completely. That is given by a+`BuildPlan`, which is similarly broken down into `BuildPlan` and `PackagePlan`.+In order to get a `BuildPlan`, we need two pieces of information: the+`BuildConstraints`, and a package index. The package index (usually downloaded+from Hackage) is a collection of all of the cabal files available.++By applying a `BuildConstraints` to a package index (via `newBuildPlan`), we+get a proposed `BuildPlan`. There is no guarantee that this `BuildPlan` is+valid. To validate it, we use `checkBuildPlan`. A `BuildPlan` is an instance of+both `ToJSON` and `FromJSON`, and therefore can be serialized to a file for+later use.++When dealing with LTS Haskell, we want to be able to take a `BuildPlan`, and+update to a newer `BuildPlan` that keeps all packages at the same major+version. `updateBuildConstraints` turns a `BuildPlan` into a new+`BuildConstraints` with that restriction, and `updateBuildPlan` applies+`newBuildPlan` to that result. As mentioned previously: this is *not* a+validated result, and therefore `checkBuildPlan` must be used.++A `BuildPlan` can be acted on. This is done to check that all packages compile+together, run relevant test suites, test Haddock documentation is correct, and+produce as artifacts both a self-contained GHC binary package database and a+set of Haddock documentation. (Not yet implemented.)++A `BuildPlan` may be converted into a bundle to be uploaded to Stackage Server.+(Not yet implemented.)
Stackage/PerformBuild.hs view
@@ -368,6 +368,8 @@ PackageConstraints {..} = ppConstraints $ piPlan sbPackageInfo + hasLib = not $ null $ sdModules $ ppDesc $ piPlan sbPackageInfo+ buildLibrary = wf libOut $ \getOutH -> do let run a b = do when pbVerbose $ log' (unwords (a : b)) runChild getOutH a b@@ -389,8 +391,18 @@ inner prevBuildResult <- getPreviousResult pb Build pident- unless (prevBuildResult == PRSuccess) $ withConfiged $ do- assert (pname `notMember` registeredPackages) $ do+ toBuild <- case () of+ ()+ | prevBuildResult /= PRSuccess -> return True+ | pname `notMember` registeredPackages && hasLib -> do+ log' $ concat+ [ "WARNING: Package "+ , display pname+ , " marked as build success, but not registered"+ ]+ return True+ | otherwise -> return False+ when toBuild $ withConfiged $ do deletePreviousResults pb pident log' $ "Building " ++ namever
stackage-curator.cabal view
@@ -1,5 +1,5 @@ name: stackage-curator-version: 0.7.0.1+version: 0.7.0.2 synopsis: Tools for curating Stackage bundles description: Please see <http://www.stackage.org/package/stackage-curator> for a description and documentation. homepage: https://github.com/fpco/stackage@@ -103,4 +103,4 @@ source-repository head type: git- location: https://github.com/fpco/stackage+ location: https://github.com/fpco/stackage-curator