1This is a collection of instructions covering the processes that the Stackage curators - the
2team who maintain the Stackage project itself - should be doing on a regular basis.
3Curation activities are mostly automated, and do not take up a significant amount of time.
4The following is the current list of curators, in alphabetical order:
6* Adam Bergmark (@bergmark)
7* Alexey Zabelin (@alexeyzab)
8* Chris Dornan (@cdornan)
9* Dan Burton (@danburton)
10* Jens Petersen (@juhp)
11* Joe Kachmar (@jkachmar)
12* Michael Snoyman (@snoyberg)
13* Mihai Maruseac (@mihaimaruseac)
17This section sketches out at a high level how the entire Stackage build/curation
20* [build-constraints.yaml](https://github.com/commercialhaskell/stackage/blob/master/build-constraints.yaml) specifies packages to be included in Stackage
21* [stackage-curator](http://www.stackage.org/package/stackage-curator) combines build-constraints.yaml with the current state of Hackage to create a build plan for a Stackage Nightly
22* stackage-curator can check that build plan to ensure all version bounds are consistent
23 * The [Travis job](https://github.com/commercialhaskell/stackage/blob/master/.travis.yml) performs these two steps to provide immediate feedback on pull requests
24* Docker Hub [builds](https://github.com/commercialhaskell/stackage/blob/master/Dockerfile) a [Docker image](https://hub.docker.com/r/commercialhaskell/stackage/) for running builds
25* The stackage-build server (described below) is able to run automated builds using the [build.sh script](https://github.com/commercialhaskell/stackage/blob/master/automated/build.sh)
26* When a new Nightly build is completed, it is uploaded to [the nightly repo](https://github.com/fpco/stackage-nightly)
27* Once a week, we run an LTS minor bump. Instead of using build-constraints.yaml, that job takes the previous LTS release, turns it into constraints, and then bumps the version numbers to the latest on Hackage, in accordance with the version bounds in the build plan. This plans are uploaded to [the LTS repo](https://github.com/fpco/lts-haskell)
28* Cutting a new LTS major release is essentially just a Stackage Nightly that gets rebuilt and uploaded as an LTS
32The typical story on pull requests is: If Travis accepts it and the
33author only added packages under his/her own name, merge it. If the
34build later fails (see [Adding Debian packages]), then block the
35package until it's fixed.
37[Adding Debian packages]: https://github.com/commercialhaskell/stackage/blob/master/CURATORS.md#adding-debian-packages-for-required-system-tools-or-libraries
39If benchmarks, haddocks, or test suites fails at this point we
40typically also block the package until these issues are fixed. This in
41order to add packages with a clean slate.
43Optionally we can check if packdeps says the package is up to date.
44Visit http://packdeps.haskellers.com/feed?needle=<package-name>
46Builds may fail because of unrelated bounds changes. If this happens,
47first add any version bounds to get master into a passing state (see
48"Fixing bounds issues"), then re-run the travis build.
50A common issue is that authors submit newly uploaded packages, it can
51take up to an hour before this has synced across the stack
52infrastructure. You can usually compare the versions of the package in
53https://github.com/commercialhaskell/all-cabal-metadata/tree/master/packages/
54to what's on hackage to see if this is the case. Wait an hour and
55re-run the pull request.
57Tests also commonly fail due to missing test files, and sometimes due
58to doctest limitations. You can point the maintainer to
59https://github.com/bergmark/blog/blob/master/2016/package-faq.md
61## Fixing bounds issues
63The most common activity you'll deal with in Stackage curation is a version
64bound issue, usually a restrictive upper bound. You fix this by opening an
65issue on the Stackage repo about the problem, and modifying the
66build-constraints.yaml file to work around it in one of the ways below. Be sure
67to refer to the issue for workarounds added to that file.
69### Temporary upper bounds
71Most common technique, just prevent a new version of a library from
72being included immediately. This also applies to when only benchmarks
73and tests are affected.
75* Copy the stackage-curator output and create a new issue, see e.g
76https://github.com/commercialhaskell/stackage/issues/2108
78* Add a new entry under the "stackage upper bounds" section of `build-constraints.yaml`. For the above example it would be
81 "Stackage upper bounds":
82 # https://github.com/commercialhaskell/stackage/issues/2108
86* Commit (message e.g. "Upper bound for #2108")
87* Optionally: Verify with `stackage-curator check` locally
89* Verify that everything works on the build server (you can restart the build or wait for it to to run again)
91Sometimes releases for different packages are tightly coupled. Then it
92can make sense to combine them into one issue, as in
93https://github.com/commercialhaskell/stackage/issues/2143.
95If a dependency that is not explicitly in stackage is causing test or
96benchmark failures you can skip or expect them to fail (see "Skipping
97tests and benchmarks" and "Expecting test/benchmark/haddock
98failures"). Bonus points for reporting this upstream to that packages'
101### Lifting upper bounds
103You can try this when you notice that a package has been updated. You
104can also periodically try to lift bounds (I think it's good to do this
105at the start of your week /@bergmark)
107If not all packages have been updated check if any of them are missing
108from the original issue and if so add a new comment mentioning them. A
109new package may appear if its dependencies were part of this issue but
110have been updated since the last time we checked. We want to give
111these new packages ample time to be upgraded.
113If stackage-curator is happy commit the change ("Remove upper bounds
114and close #X"). After doing this the next nightly build may fail
115because some packages didn't have an upper bound in place, but
116compilation failed. In this case revert the previous commit so any
117disabled packages are enabled again, re-open the issue, and add a new
118comment with the failing packages. This is to give all maintainers
119enough time to upgrade for this case as well.
121### Amending upper bounds
123With the `pipes` example above there was later a new release of
124`pipes-safe` that required the **newer** version of `pipes`. You can
125add that package to the same upper bounds section,
126(e.g. https://github.com/commercialhaskell/stackage/commit/6429b1eb14db3f2a0779813ef2927085fa4ad673)
127as we want to lift them simultaneously.
129### Skipping tests and benchmarks
131Sometimes tests and benchmark dependencies are forgotten or not cared
132for. To disable compilation for them add them to `skipped-tests` or
133`skipped-benchmarks`. If a package is added to these sections they
134won't be compiled, and their dependencies won't be taken into account.
136There are sub sections under these headers that is used to group types
137of failures together, and also to document what type of failures
140### Expecting test/benchmark/haddock failures
142The difference from the `skipped` sections is that items listed here
143are compiled and their dependencies are taken into account. These
144sections also have sub sections with groups and descriptions.
146One big category of test suites in this section are those requiring
147running services. We don't want to run those, but we do want to check
148dependencies and compile them.
150If there are no version bounds that would fix the issue or if you
151can't figure it out, file it
152(e.g. https://github.com/commercialhaskell/stackage/issues/2133) to ask the
155### Waiting for new releases
157Sometimes there is a failure reported on a (now possibly closed) issue
158on an external tracker. If an issue gets resolved but there is no
159hackage release yet we'd like to get notified when it's uploaded.
161Add the package with its current version to the
162`tell-me-when-its-released` section. This will cause the build to stop
163when the new version is out.
165### Excluding packages
167In an extreme case of a non-responsive maintainer, you can remove the
168package entirely from Stackage. We try to avoid that whenever
171This typically happens when we move to a new major GHC release or when
172there are only a few packages waiting for updates on an upper bounds
175Comment out the offending packages from the "packages" section and add
176a comment saying why it was disabled:
179 # - swagger # bounds: aeson 1.0
182If this causes reverse dependencies to be disabled we should notify
183the maintainers of those packages.
186## Updating the content of the Docker image used for building
188### Adding Debian packages for required system tools or libraries
189Additional (non-Haskell) system libraries or tools should be added to `stackage/debian-bootstrap.sh`.
190After you've committed those changes, merging them into the `nightly` branch should
191trigger a DockerHub build. Simply run:
194 $ git checkout nightly
199Use [Ubuntu Package content search](http://packages.ubuntu.com/) to determine which package provides particular dev files (it defaults to xenial which is the version used to build Nightly).
201Note that we generally don't install/run services needed for testsuites in the docker images - packages with tests requiring some system service can be added to `expected-test-failures`.
202It's good to inform the maintainer of any disabled tests (commenting in the PR is sufficient).
204If a new package fails to build because of missing system libraries we often ask the maintainer to help figure out what to install.
206### Upgrading GHC version
207The Dockerfile contains information on which GHC versions should be used. You
208can modify it and push it to Github to trigger a DockerHub build. The nightly
209branch is used for nightlies. For LTSes, we use the ltsX branch, where X is the
210major version number (e.g., lts3 for lts-3.\*).
212Note that when starting a new LTS major release, you'll need to modify Docker
213Hub to create a new Docker tag for the relevant branch name.
215You'll need to update both the `PATH` in `Dockerfile` and the `GHCVER` variable
216in `debian-bootstrap.sh`.
218Ensure that the [global-hints.yaml
219file](https://github.com/fpco/stackage-content/blob/master/stack/global-hints.yaml)
220is updated with information on the latest GHC release by cloning that
221repo and running `./update-global-hints.yaml ghc-X.Y.Z`.
223### Getting the new image to the build server
224Once a new Docker image is available, you'll need to pull it onto the stackage-build server (see
225below). Instead of pulling an unbounded number of images, I typically just
226delete all of the old images and let the new ones get downloaded:
229docker rm $(docker ps -a -q)
230docker rmi $(docker images -q)
233but `docker pull snoyberg/stackage:nightly` can also be run instead just to update the nightly image say.
235For a new GHC version you should also delete the cache directories on the stackage-build server to
236force all packages to be rebuilt. See: [issue#746](https://github.com/commercialhaskell/stackage/issues/746). Eg:
238rm -r nightly/work/builds/nightly/
240This should also be done when moving the Nightly docker image to a new version of Ubuntu.
242If you're impatient and would like to build the Docker image on the
243build server instead of waiting for Docker Hub, you can run the
249 && git clone https://github.com/commercialhaskell/stackage \
251 && docker build --tag snoyberg/stackage:nightly .)
255Note that we do a clean clone of the `stackage` repo instead of using
256the existing checkout because of how `docker build` works: it will
257send the entire local directory contents as context to the Docker
258daemon, which in the case of the build tree is a _lot_ of content. (We
259can discuss the wisdom—or lack thereof—of Docker's
262## stackage-build server
264You'll need to get your SSH public key added to the machine. ~/.ssh/config info:
269 Hostname build.stackage.org
272### Running the build script
274We currently run the builds manually so make it easy to see when there are
275bounds issues that need to be corrected. Automated this would be even better,
276we're just not there yet.
280/opt/stackage-build/stackage/automated/run-nightly.sh
282# Run an LTS minor bump
283/opt/stackage-build/stackage/automated/build.sh lts-2.17
285# Run an LTS major bump
286/opt/stackage-build/stackage/automated/build.sh lts-3.0
289Recommended: run these from inside a `tmux` session. If you get version bound
290problems on nightly or LTS major, you need to fix build-constraints.yaml (see
291info above). For an LTS minor bump, you'll typically want to use the
292`CONSTRAINTS` environment variable, e.g.:
295CONSTRAINTS='--constraint "conduit < 1.4.5" --constraint "criterion < 1.2.3"' /opt/stackage-build/stackage/automated/build.sh lts-2.17
298Valid arguments to include in this environment variable:
300* `--constraint` to modify an upper or lower bound
301* `--add-package` to add a brand new package
302* `--expect-test-failure` to expect tests to fail
303* `--expect-haddock-failure` to expect haddocks to fail
304* `--expect-bench-failure` to expect benchmarks to fail
306If a build fails for bounds reasons, see all of the advice above. If the code
307itself doesn't build, or tests fail, open up an issue and then either put in a
308version bound to avoid that version or something else. It's difficult to give
309universal advice on how to solve things, since each situation is unique. Let's
310develop this advice over time. For now: if you're not sure, ask for guidance.
312__`NOPLAN=1`__ If you wish to rerun a build without recalculating a
313build plan, you can set the environment variable `NOPLAN=1`. This is
314useful for such cases as an intermittent test failure, out of memory
315condition, or manually tweaking the plan file.
317Note LTS builds inherit the current Hackage data (stack updated for Nigthly) to avoid excess extra rebuilding.
321A looping script on the build server keeps trying to build nightly
322with `sleep 30m` interleaved. It only publishes the nightly once per
323day. This way new package versions or build failures can be caught
324early and hopefully the nightlies will be timely.
326LTS minor bumps typically are run on Sundays.
328### Website sync debugging (and other out of disk space errors)
330* You can detect the problem by running `df`. If you see that `/` is out of space, we have a problem
331* (outdated) There are many temp files inside `/home/ubuntu/stackage-server-cron` that can be cleared out occasionally
332* (outdated) You can then manually run `/home/ubuntu/stackage-server-cron.sh`, or wait for the cron job to do it
336Sometimes the cache can get corrupted which might manifest as `can't load .so/.DLL`.
337You can wipe the nightly cache and rebuild everything by doing
338`rm -rf /var/stackage/stackage/automated/nightly`.
339Replace nightly with `lts7` to wipe the LTS 7 cache.
341### Force a single package rebuild
343You can force a single package to rebuild by deleting its "previous result"
347$ rm /var/stackage/stackage/automated/nightly/work/builds/nightly/prevres/Build/cryptohash-0.11.9
352If docker hangs with e.g. `docker: Error response from daemon:
353connection error: desc = "transport: dial unix
354/var/run/docker/containerd/docker-containerd .sock: connect:
355connection refused".` you can restart it with `sudo systemctl restart
358## Local curator setup
360We do not run the full stackage build locally as that might take too
361much time. However, some steps on the other hand are much faster to do
362yourself, e.g. verifying constraints without building anything.
364To get started, install `stackage-curator` via Git, or [the Linux binary]:
367$ git clone git@github.com:fpco/stackage-curator.git
368$ cd stackage-curator && stack install
371It is a good idea to upgrade `stackage-curator` at the start of your week.
372Then, clone the stackage repo, get the latest packages and run dependency
376$ git clone git@github.com:commercialhaskell/stackage.git
377$ stack update && stackage-curator check
380This can be used to make sure all version bounds are in place, including for
381test suites and benchmarks, to check whether bounds can be lifted, and to get
382[tell-me-when-its-released] notifications.
384`stackage-curator` does not build anything, so you wont see any compilation
385errors for builds, tests and benchmarks.
387[the Linux binary]: https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2
388[tell-me-when-its-released]: https://github.com/commercialhaskell/stackage/blob/master/CURATORS.md#waiting-for-new-releases
390## Adding new curators
3921. Add public ssh key to `~/.ssh/authorized_keys` on build server
3932. Add to commercialhaskell/stackage project.
395## Dealing with a new GHC release
397As mentioned in the [GHC upgrade note], the major impact of a new GHC release
398is on the packages that are causing upper bounds to be put in place. In order
399to minimise out-of-date breakage and allow maintainers to have a solid chance
400of getting their packages into the newest LTS, we try to do the following:
402Make an early announcement (in the form of a blog post, typically) of the new
403GHC release on the nightly build and the planned deadline for the new LTS release.
404Make it clear, that in the time coming up to this, we hope package maintainers
405will upgrade their packages to allow for the new GHC release.
407We prefer to prune packages causing upper bounds constraints **after** the LTS
408release to allow the maximum amount of packages to get into the newest LTS.
410You will almost always need to update the Win32 package version listed in the
411build-constraints.yaml file.
413After the first LTS release, the package pruning process may begin in the
414nightly build in order to move forward with getting the latest versions of
415packages compatible with the new GHC release.
417[GHC upgrade note]: https://github.com/commercialhaskell/stackage/blob/master/MAINTAINERS.md#upgrading-to-a-new-ghc-version
421Every 3-6 months, we make a new major release of LTS. The procedure we follow for this is:
4231. Write a blog post on stackage.org announcing the intent to cut a major
424 release. Give an estimated date two weeks in the future from the publication
4262. Spread the blog post on social media and mailing lists as much as possible.
4273. Expect maintainers to send significant requests for added packages and
428 relaxed upper bounds. There will likely be some hard decisions to be made
429 regarding relaxing a bound versus keeping more packages. All of these changes
430 occur on master and affect nightly.
4314. Once the estimated date hits, push a new `lts-XX` branch and trigger Docker
432 Hub to build a Docker image for the new release.
4335. Run the build procedure for the new LTS release.
4346. After the LTS build completes, more aggressively prune upper bounds from
435 `build-constraints.yaml`.
4367. Once both (5) and (6) are done, publish a new blog post on stackage.org
437 announcing the new LTS and Nightly, with links to the change pages on
438 stackage.org. Include a reminder that requests for packages to be added to LTS
439 may be made on commercialhaskell/lts-haskell.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list