From fcdf3fb77ba0759b34ba9750d52415a27fdac0f3 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 27 Nov 2017 08:01:18 +0200 Subject: [PATCH 1/3] Build with Stack, LTS Haskell and GHC --- MAINTAINERS.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index fac083ad..d565be90 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -26,7 +26,20 @@ After doing that commit with a message like "add foo-bar" and send a pull reques The continuous integration job will do some checks to see if your package's dependencies are up-to-date. The CI job notably doesn't compile packages, run tests, build documentation, or find missing C libraries. -If you want to be proactive or if CI fails, you can make sure that your package builds against the newest versions of all dependencies like this: +If you want to be proactive or if CI fails, you can make sure that your package builds against the latest nightly: + +``` +$ stack build --resolver nightly --haddock --test --bench --no-run-benchmarks +``` + +Or, if some dependencies haven't made it into Stackage Nightly yet: + +``` +$ rm -f stack.yaml && stack init --resolver nightly --solver +``` + +Or, alternatively, with `cabal` (may end up using older dependency +versions): ``` $ ghc --version # Should be the same as the latest nightly, it's in the title of https://www.stackage.org/nightly @@ -139,6 +152,13 @@ If your package ends up being temporarily disabled from Stackage Nightly, please simply send a pull request to add it back once it and its dependencies are compatible with the newest GHC version. +Note that it is _not_ a goal of LTS Haskell to track the latest +version of GHC. If you want the latest and greatest, Stackage Nightly +is your best bet. In particular, LTS Haskell will often—but not +always—avoid upgrading to the first point release of GHC +releases (e.g., 8.2.1) to allow further testing and to get the +benefits of the first bugfix release (e.g., 8.2.2). + ## Adding a package to an LTS snapshot The steps above affect the Stackage Nightly builds, but do not directly affect From 51f13eb9329e58ca1ce10439e940fbfb3d3805ba Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 27 Nov 2017 09:09:22 +0200 Subject: [PATCH 2/3] Better Stack instructions using tarball --- MAINTAINERS.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index d565be90..ded7a119 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -29,13 +29,12 @@ The CI job notably doesn't compile packages, run tests, build documentation, or If you want to be proactive or if CI fails, you can make sure that your package builds against the latest nightly: ``` -$ stack build --resolver nightly --haddock --test --bench --no-run-benchmarks -``` - -Or, if some dependencies haven't made it into Stackage Nightly yet: - -``` +# Build from the tarball on Hackage to check for missing files +$ stack unpack yourpackage && cd yourpackage-* +# Generate a pristine stack.yaml, adding any missing extra-deps $ rm -f stack.yaml && stack init --resolver nightly --solver +# Build, generate docs, test, and build benchmarks +$ stack build --resolver nightly --haddock --test --bench --no-run-benchmarks ``` Or, alternatively, with `cabal` (may end up using older dependency From 26a075c4e404f7fbdff087502aa9046c9db1590c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 27 Nov 2017 13:32:54 +0200 Subject: [PATCH 3/3] Mention Packdeps --- MAINTAINERS.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index ded7a119..52f316de 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -37,8 +37,19 @@ $ rm -f stack.yaml && stack init --resolver nightly --solver $ stack build --resolver nightly --haddock --test --bench --no-run-benchmarks ``` -Or, alternatively, with `cabal` (may end up using older dependency -versions): +This approach works well, but has two limitations you should be aware +of: + +* It won't notify you of restrictive upper bounds in your package if + Stackage has the same upper bounds. For that reason, we recommend + using [Packdeps](http://packdeps.haskellers.com/) (see "Following + dependency upgrades" below). +* If the latest Stackage Nightly is missing some of the latest + packages, your build above may succeed whereas the Travis job may + fail. Again: Packdeps will help you detect this situation. + +Alternatively, you can build with `cabal`. Note that this may end up +using older dependency versions: ``` $ ghc --version # Should be the same as the latest nightly, it's in the title of https://www.stackage.org/nightly