Snapshot curator tool for, e.g., creating Stackage snapshots.
This is the "curator 2.0", replacing https://github.com/fpco/stackage-curator. It relies on pantry for finding appropriate packages, and Stack for performing the builds. It is intended to be much simpler to maintain than the old stackage-curator tool.
This tool is not yet complete. Here's a (likely incomplete) list of
things that still need to be handled to replace stackage-curator
:
app/Main.hs
just runs through a bunch of
steps. We need to have individual commands like the current tool, so
each command can be called in an appropriately locked-down Docker
container.build-constraints.yaml
. I'd
like to see if we can get rid of them entirely and instead just customize the
Docker build image.Here's a rundown of how this tool is intended to be used.
We update the Hackage index to get a list of all of the most recent
package versions. This is pantry's updateHackageIndex
command.
We start with build-constraints.yaml
, the configuration file in
commercialhaskell/stackage. This specifies all of the packages we want
to include in a snapshot, along with a bunch of configuration.
We parse build-constraints.yaml
and convert it into the
constraints.yaml
file, which contains a more properly structures set
of constraints. We'll continue to let users edit the
build-constraints.yaml
file, since it's more user-friendly. But
constraints.yaml
gives us more flexibility.
constraints.yaml
from
build-constraints.yaml
, we'll take the constraints.yaml
used for
the last LTS release in the series. Details still need to be worked
out on how upper bounds are added and where this file is stored.Curator team: at this point, you can edit constraints.yaml
to make
tweaks to the build plan. This replaces the old CONSTRAINTS
environment variable.
We combine the constraints.yaml
file and the information from
Hackage to produce snapshot-incomplete.yaml
. This has a concrete
list of all of the packages we intend to include in the
snapshot. Again, this file can be manually modified if desired.
The snapshot-incomplete.yaml
file does not have all of the
cryptographic hashes necessary for fully reproducible builds. We next
generate snapshot.yaml
with all of this information. This file
should never be manually edited, instead edits should occur at the
snapshot-incomplete.yaml
and constraints.yaml
phases.
The snapshot.yaml
file gets checked for its consistency ensuring the
following:
All package dependencies are explicitly specified in constraints files
Dependency bounds of all snapshot packages are properly satisfied
There are no dependency cycles in the snapshot (only libraries and executables are included into checked dependency tree as test suites and benchmarks are allowed to create cycles)
The snapshot contains Cabal version suitable to build all packages
We unpack all of the package specified by snapshot.yaml
into a local
directory, and generate a stack.yaml
that gives instructions to
build all of those packages.
We build the packages, run test suites, and generate Haddocks.
TODO Grab artifacts and upload them to the right place.