MyNixOS website logo
Description

CLI tool for building across Stackage major versions.

Build your Haskell project over Stackage major LTS versions.

stack-all

A CLI tool for building Haskell projects easily over Stackage major versions.

This is how I do my Haskell build CI for projects locally with stack.

Usage

stack-all by default runs stack build over Stackage Nightly and LTS major versions (current default is nightly & LTS 21, 20, 19, 18, 16, 14, 13, 12, 11) corresponding to latest major ghc minor versions, with appropriate stack --resolver options.

Note that stack only works if a stack.yaml file exists. If no stack.yaml file is found, stack-all will create one. Of course it may still fail to build, but this allows for quickly trying to build a package that does not include stack support.

Help output

$ stack-all --version
0.4.2
$ stack-all --help
Build over Stackage versions

Usage: stack-all [--version] [(-c|--create-config) | (-s|--make-lts)]
                 [-k|--keep-going] [-d|--debug] [--refresh-cache]
                 [-n|--newest MAJOR] [(-o|--oldest MAJOR) | (-a|--all-lts)]
                 [MAJORVER... [COMMAND...]]

  stack-all builds projects easily across different Stackage versions

Available options:
  -h,--help                Show this help text
  --version                Show version
  -c,--create-config       Create a project .stack-all file
  -s,--make-lts            Create a stack-ltsXX.yaml file
  -k,--keep-going          Keep going even if an LTS fails
  -d,--debug               Verbose stack build output on error
  --refresh-cache          Force refresh of stackage snapshots.json cache
  -n,--newest MAJOR        Newest LTS release to build from
  -o,--oldest MAJOR        Oldest compatible LTS release
  -a,--all-lts             Try to build back to LTS 1 even

Overriding stack.yaml

stack-all can use stack-ltsXX.yaml files to override the default stack.yaml file for particular Stackage major versions. Note that a stack-ltsXX.yaml file will also be used for older LTS major versions until another stack-ltsYY.yaml file is found. stack-nightly.yaml is also supported, but used only for nightly.

For example if you have stack-lts19.yaml and stack-lts16.yaml files in your project, then stack.yaml will be used as normal to build nightly, lts-21 and lts-20, but stack-lts19.yaml will be used for building lts-19 and lts-18, and stack-lts16.yaml will be used for lts-16, lts-14 (and older). Since stack-all overrides the exact resolver with the latest minor snapshot, the exact minor Stackage version specified in the stack*.yaml files doesn't actually matter: stack-all always uses the latest published minor releases of Stackage major versions.

stack-ltsXX.yaml files can be easily created using stack-all --make-lts ltsXX (or -s ltsXX for short).

(Other versioned stack.yaml filenames like stack-ghc-8.8.yaml are not currently supported.)

Specifying LTS versions

You can abbreviate lts-XX args to ltsXX on the commandline. lts is also accepted and resolved to the latest major LTS version.

There are --oldest and --newest options to specify the range of lts versions to build over:

You can specify the oldest major LTS to build for with eg stack-all -o lts14. Otherwise if not configured the default oldest LTS is currently lts-11.

Similarly you can specify the newest LTS version to build from with eg stack-all -n lts19. (The default is to build from nightly.)

Alternatively, one can give one or more explicit LTS major versions to build for as arguments: eg stack-all lts18 if you only wish to build that version.

Configuring the oldest and/or newest LTS to build

You can configure the oldest working LTS major version for your project by running for example stack-all -c -o lts-16 which generates a .stack-all project config file like this:

[versions]
# lts-14 too old
oldest = lts-16

(the comment line can be used to document why the older LTS doesn't work). This specifies that the oldest LTS version to build for is lts-16.

The newest LTS to build with stack-all can similarly be configured: stack-all -c -n lts20 or setting newest = lts-20.

Running other stack commands

By default stack-all just runs the stack build command over Stackage major versions.

You can also specify a stack command to run with options on the commandline: eg

$ stack-all test --no-rerun-tests

will run stack test over the LTS versions instead.

Happy stack building!

Install

The project is released on Hackage.

You can also build from git source with stack install or cabal install.

Collaboration

The project is hosted at https://github.com/juhp/stack-all under a BSD license.

Metadata

Version

0.4.2

Executables (1)

  • bin/stack-all

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows