stack-all 0.2 → 0.2.1
raw patch · 4 files changed
+70/−19 lines, 4 filesdep ~directory
Dependency ranges changed: directory
Files
- ChangeLog.md +3/−0
- README.md +54/−11
- src/Main.hs +9/−4
- stack-all.cabal +4/−4
ChangeLog.md view
@@ -1,5 +1,8 @@ # Revision history for stack-all +## 0.2.1 (2021-04-30)+- if stack fails, print the ~/.stack snapshot path for reference+ ## 0.2 (2021-04-03) - better error messages when reading snapshot option/arg (TristanCacqueray) - search parent dirs for stack project dir, like stack
README.md view
@@ -9,28 +9,71 @@ `stack-all` by default runs `stack build` over recent Stackage LTS major versions and Nightly (current default is nightly, lts-17, lts-16, lts-14,... , lts-11)-corresponding to latest major ghc minor verions.+corresponding to latest major ghc minor versions,+using the stack's `--resolver` option. -Note that stack-all will automatically use `stack-ltsXX.yaml`, even for older lts releases: eg say you have `stack-lts13.yaml` in your project, then it will also be used for building lts-12 (unless you have a `stack-lts12.yaml` config file of course). (Other versioned stack.yaml filenames like stack-ghc-8.8.yaml are not supported currently.)+### Overriding stack.yaml+`stack-all` can use `stack-ltsXX.yaml` files to override the default `stack.yaml`+file for particular lts major versions. Note that a `stack-ltsXX.yaml` file+will also be used for earlier lts major versions until+another `stack-ltsYY.yaml` file is found. -You can specify the oldest working LTS for a project with `stack-all -o lts-13` or set it in a `.stack-all` file containing:+For example if you have `stack-lts14.yaml` and `stack-lts12.yaml` files+in your project,+then `stack.yaml` will be used as normal to build nightly, lts-17 and lts-16,+but `stack-lts14.yaml` will be used for building lts-14 and lts-13,+and `stack-lts12.yaml` will be used for lts-12, lts-11 (and earlier).+Since `stack-all` overrides the resolver with `--resolver lts-XX`+the exact minor lts version specified in the `stack*.yaml` files+doesn't actually matter: `stack-all` always uses the latest minor release of+the lts major version according to Stackage.++(Other versioned stack.yaml filenames like stack-ghc-8.8.yaml+are not currently supported.)++### Configuring the oldest lts to build+You can configure the oldest working LTS major version for your project+by running for example `stack-all -c -o lts-13` which generates a `.stack-all`+project config file like this: ``` [versions]-# lts-12 foo-bar too old+# lts-12 too old oldest = lts-13 ```-which can be created with `stack-all -c -o lts-13`.+(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-13. -You can also pass stack commands and options on the command line: eg+### Specifying lts versions+You can abbreviate `lts-XX` args to `ltsXX` on the commandline.++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 lts13`.+Otherwise if not configured the default oldest lts is currently `lts-11`.++Similarly you can specify the newest lts version to build from with+`stack-all -n lts16`. (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 lts14` if you only wish to build that version.++### Running other stack commands+By default `stack-all` just runs the stack `build` command over lts versions.++You can also specify the stack command to run and its options on the commandline:+eg ```-$ stack-all test+$ stack-all test --no-rerun-tests ```-will run `stack test` over the LTS versions, etc (instead of `stack build`).+will run `stack test` over the LTS versions instead. Happy stack building! ## Install-Run `stack install` or `cabal install` in the source.+The project is released on Hackage. -## Contribute or discuss-at https://github.com/juhp/stack-all+You can also build from source with `stack install` or `cabal install`.++## Collaboration+The project is hosted at https://github.com/juhp/stack-all under a BSD license.
src/Main.hs view
@@ -166,11 +166,16 @@ case sort (filter (snap <=) configs) of [] -> [] (cfg:_) -> ["--stack-yaml", showConfig cfg]- args = ["-v" | debug] ++ ["--resolver", showSnap snap] ++- config ++ command+ opts = ["-v" | debug] ++ ["--resolver", showSnap snap] +++ config if debug- then debugBuild args- else cmd_ "stack" args+ then debugBuild $ opts ++ command+ else do+ ok <- cmdBool "stack" $ opts ++ command+ unless ok $ do+ putStr "\nsnapshot-pkg-db: "+ cmd_ "stack" $ "--silent" : opts ++ ["path", "--snapshot-pkg-db"]+ error' $ "failed for " ++ showSnap snap putStrLn "" where showConfig :: Snapshot -> FilePath
stack-all.cabal view
@@ -1,8 +1,8 @@ name: stack-all-version: 0.2+version: 0.2.1 synopsis: CLI tool for building across Stackage major versions description:- Build your Haskell project over Stackage major versions.+ Build your Haskell project over Stackage major LTS versions. license: BSD3 license-file: LICENSE author: Jens Petersen <juhpetersen@gmail.com>@@ -16,7 +16,7 @@ ChangeLog.md cabal-version: 1.18 tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5,- GHC == 8.8.4, GHC == 8.10.2, GHC == 9.0.1+ GHC == 8.8.4, GHC == 8.10.4, GHC == 9.0.1 source-repository head type: git@@ -27,7 +27,7 @@ other-modules: Paths_stack_all build-depends: base < 5, config-ini,- directory,+ directory >= 1.2.5, extra >= 1.6.15, filepath, process,