From 53545f18594e5fd22152ac04baf515eaae9f24d6 Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Thu, 5 Apr 2018 10:03:08 +0530 Subject: [PATCH] update readme, cabal description and changelog --- Changelog.md | 8 +++++--- README.md | 45 ++++++++++++++++++++++++--------------------- packcheck.cabal | 39 +++++++++++++++------------------------ stack.yaml | 2 +- 4 files changed, 45 insertions(+), 49 deletions(-) diff --git a/Changelog.md b/Changelog.md index dd38f05..c57a804 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,11 +3,13 @@ ### Enhancements * Add cabal new-build support. Use `packcheck.sh cabal-new` to use it. * Add knobs to disable tests or doc builds (`DISABLE_TEST`, `DISABLE_DOCS`) -* Now you can specify multiple versions of GHC in PATH and packcheck will - automatically find the right one based on GHCVER envvar. +* Now you can specify multiple versions of GHC in PATH and packcheck + automatically finds the right one based on GHCVER envvar. +* Add TOOLS_DIR option to specify hvr-ghc style installation of ghc and + cabal. A correct version of GHC is automatically picked from this directory. * GHCVER and CABALVER variables are now optional in travis config if you specify the cabal and ghc PPAs under apt sources. -* Run autoreconf if there is a configure.ac in the package dir +* Run `autoreconf` if there is a `configure.ac` in the package dir ### Deprecations * TEST_INSTALL option is deprecated, use ENABLE_INSTALL instead diff --git a/README.md b/README.md index d17ba33..19270d7 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,13 @@ ## TL; DR -* Just copy +* For CI, just copy [.travis.yml](https://github.com/harendra-kumar/packcheck/blob/master/.travis.yml) and [appveyor.yml](https://github.com/harendra-kumar/packcheck/blob/master/appveyor.yml) files to your package repo, add your repo to travis/appveyor and CI will just work. -* Copy +* For local use, copy [packcheck.sh](https://github.com/harendra-kumar/packcheck/blob/master/packcheck.sh) to your local machine (Linux/OSX/Windows), put it in your PATH, and run it from your package directory and watch all the CI tests being done locally. @@ -23,11 +23,11 @@ $ packcheck.sh cabal-new ``` * If a CI build fails just copy and paste the command printed in the log and - the same build will run on the local machine so that you can debug quickly. + the same build runs on the local machine so that you can debug quickly. * Want to send coverage info to coverall.io? Just uncomment a line in your `.travis.yml`. -* If you are using `hvr-ghc` PPA, just say `TOOLS_DIR=/opt` or wherever it - is installed, and you can use all the ghc/cabal versions available, +* If you are using `hvr-ghc` PPA, just use `TOOLS_DIR=/opt` or the path where + it is installed, and you can use all the ghc/cabal versions available, automatically. * Conveniently control all aspects of build, including tool options or whether to enable benchmarks, haddock, coverage, install test etc. It is a very @@ -69,6 +69,8 @@ An invocation of packcheck performs a whole battery of tests: * When using stack builds, stack and ghc are installed automatically, if needed * for stack builds, if the package being tested does not have a `stack.yaml` it is created automatically using `stack init`. +* Picks up the right version of GHC automatically if multiple versions are + available in the PATH or from hvr-ghc style ghc/cabal installation. * build source * build benchmarks * build docs @@ -110,22 +112,6 @@ cabal build: $ ./packcheck.sh cabal GHCVER=8.0.2 COVERALLS_OPTIONS="test1 test2" ``` -## Diagnostics - -There may be issues due to some environment variables unknowingly set or some -command line parameters or env variables being misspelled and therefore -silently ignored. To avoid any such issues the robust way to invoke `packcheck` -is to use a clean environment using `env -i` and passing `CHECK_ENV=y` -parameter. When this parameter is set unwanted/misspelled variables are -detected and reported. - -``` -$ env -i CHECK_ENV=y ./packcheck.sh stack -``` - -For performance diagnostics `packcheck` prints the time elapsed from the -beginning at each build step performed. - ## Full Reference Options marked `DESTRUCTIVE!` are fine in a CI environment. But on a @@ -233,3 +219,20 @@ Diagnostics options -------------------------------------------------- CHECK_ENV : [y] Treat unknown env variables as error, used with env -i BASE_TIME : System time to be used as base for timeline reporting +``` + +## Diagnostics + +There may be issues due to some environment variables unknowingly set or some +command line parameters or env variables being misspelled and therefore +silently ignored. To avoid any such issues the robust way to invoke `packcheck` +is to use a clean environment using `env -i` and passing `CHECK_ENV=y` +parameter. When this parameter is set unwanted/misspelled variables are +detected and reported. + +``` +$ env -i CHECK_ENV=y ./packcheck.sh stack +``` + +For performance diagnostics `packcheck` prints the time elapsed from the +beginning at each build step performed. diff --git a/packcheck.cabal b/packcheck.cabal index 0319cfd..c4b1a6f 100644 --- a/packcheck.cabal +++ b/packcheck.cabal @@ -2,34 +2,25 @@ name: packcheck version: 0.2.0 synopsis: Universal build and CI testing for Haskell packages description: - * Just copy @.travis.yml@ and @appveyor.yml@ to your package repo and your package is CI ready. - * Copy @packcheck.sh@ to your local machine and run it from your package directory (works on - Linux/OSX/Windows) to perform all the same tests that are done by CI, locally. - . - `packcheck` is a minimal yet complete "hello world" Haskell package with - `travis` and `appveyor` config files that can be used unmodified in any Haskell - package. The CI configs can be modified `declaratively` to adapt to `any` - kind of build scenario you can imagine. - . - The package includes @packcheck.sh@, a high level universal super build script - to uniformly, consistently build and comprehensively sanity test a Haskell - package across build tools (stack/cabal) and across all platforms - (Linux\/MacOS\/Windows). You do not need to be familiar with any of the build - tools to use it. - . - To use it for CI, simply copy the @.travis.yml@, @appveyor.yml@ config files from this - package to your package and that's it. It should work without modification, - and of course you can customize the configs. For use on local host, just copy - over the @packcheck.sh@ script and put it in your `PATH`. Run the script from - the package directory of the package you want to build. + This package contains a universal CI/build script @packcheck.sh@ and config + files designed such that you can just copy over @.travis.yml@ and + @appveyor.yml@ to your package repo and your package is CI ready in a jiffy. + For local testing, copy @packcheck.sh@ to your local machine, put it in your + PATH, and run it from your package directory: . > $ packcheck.sh stack > $ packcheck.sh cabal + > $ packcheck.sh cabal-new + . + You can try it on this package itself. @packcheck.sh@ uniformly, consistently + builds and comprehensively sanity tests a Haskell package across build tools + (stack/cabal) and across all platforms (Linux\/MacOS\/Windows). You do not + need to be familiar with any of the build tools to use it. . - This is also a minimal yet complete model package (with tests, benchmarks, - Linux\/MacOS\/Windows CI already working) that can be used as a starting point to - develop a new package. Beginners can use it to learn about haskell package - metadata structure, benchmarks, tests, CI configs etc. + This is also a minimal yet complete model package (with tests, benchmarks, CI + already working) that can be used as a starting point to develop a new + package. Beginners can use it to learn about haskell package metadata + structure, benchmarks, tests, CI configs etc. . See the README for comprehensive documentation. diff --git a/stack.yaml b/stack.yaml index 2815bdf..fb7ba99 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,3 +1,3 @@ -resolver: lts-11.0 +resolver: lts-11.3 packages: - '.'