packages feed

stack-all 0.4.0.1 → 0.4.1

raw patch · 4 files changed

+31/−24 lines, 4 files

Files

ChangeLog.md view
@@ -1,5 +1,8 @@ # Release history for stack-all +## 0.4.1 (2023-02-20)+- ignore nightly as a base when creating a new lts file+ ## 0.4.0.1 (2022-03-27) - fix build with simple-cmd-0.2.4 
README.md view
@@ -7,7 +7,8 @@ ## Usage  `stack-all` by default runs `stack build` over Stackage Nightly and-LTS major versions (current default is nightly & LTS 19, 18, 16, 14, 13, 12, 11)+LTS major versions+(current default is nightly & LTS 20, 19, 18, 16, 14, 13, 12, 11) corresponding to latest major ghc minor versions, with appropriate stack `--resolver` options. @@ -23,11 +24,11 @@ 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-lts14.yaml` and `stack-lts12.yaml` files+For example if you have `stack-lts18.yaml` and `stack-lts13.yaml` files in your project,-then `stack.yaml` will be used as normal to build nightly, lts-18 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 older).+then `stack.yaml` will be used as normal to build nightly, lts-20 and lts-19,+but `stack-lts18.yaml` will be used for building lts-18 and lts-16,+and `stack-lts14.yaml` will be used for lts-14, lts-13 (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@@ -50,25 +51,25 @@ 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 lts16`. (The default is to build from nightly.)+eg `stack-all -n lts18`. (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.+for as arguments: eg `stack-all lts16` 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-13` which generates a `.stack-all`+by running for example `stack-all -c -o lts-16` which generates a `.stack-all` project config file like this: ``` [versions]-# lts-12 too old-oldest = lts-13+# 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-13.+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 lts18` or setting `newest = lts-18`.+`stack-all -c -n lts19` or setting `newest = lts-19`.  ### Running other stack commands By default `stack-all` just runs the stack `build` command over
src/Main.hs view
@@ -57,7 +57,7 @@         else makeStackLTS versions     DefaultRun -> do       (versions, cargs) <- getVersionsCmd-      configs <- mapMaybe readStackConf <$> listDirectory "."+      configs <- readStackConfigs       let newestFilter = maybe id (filter . (>=)) mnewest       mapM_ (stackBuild configs keepgoing debug cargs) (newestFilter versions)   where@@ -108,10 +108,14 @@         inRange :: MajorVer -> MajorVer -> MajorVer -> Bool         inRange newest oldest v = v >= oldest && v <= newest -readStackConf :: FilePath -> Maybe MajorVer-readStackConf "stack-lts.yaml" = error' "unversioned stack-lts.yaml is unsupported"-readStackConf f =-  stripPrefix "stack-" f >>= stripSuffix ".yaml" >>= readCompactMajor+readStackConfigs :: IO [MajorVer]+readStackConfigs = do+ sort . mapMaybe readStackConf <$> listDirectory "."+ where+   readStackConf :: FilePath -> Maybe MajorVer+   readStackConf "stack-lts.yaml" = error' "unversioned stack-lts.yaml is unsupported"+   readStackConf f =+     stripPrefix "stack-" f >>= stripSuffix ".yaml" >>= readCompactMajor  stackAllFile :: FilePath stackAllFile = ".stack-all"@@ -157,15 +161,14 @@  makeStackLTS :: [MajorVer] -> IO () makeStackLTS vers = do-  configs <- mapMaybe readStackConf <$> listDirectory "."-  forM_ vers $ \ ver -> do+  configs <- readStackConfigs+  forM_ vers $ \ver -> do     let newfile = configFile ver     if ver `elem` configs       then do       error' $ newfile ++ " already exists!"       else do-      let mcurrentconfig =-            listToMaybe $ sort (filter (ver <=) configs)+      let mcurrentconfig = find (ver <=) (delete Nightly configs)       case mcurrentconfig of         Nothing -> copyFile "stack.yaml" newfile         Just conf -> do
stack-all.cabal view
@@ -1,5 +1,5 @@ name:                stack-all-version:             0.4.0.1+version:             0.4.1 synopsis:            CLI tool for building across Stackage major versions description:         Build your Haskell project over Stackage major LTS versions.@@ -7,7 +7,7 @@ license-file:        LICENSE author:              Jens Petersen <juhpetersen@gmail.com> maintainer:          Jens Petersen <juhpetersen@gmail.com>-copyright:           2020-2021  Jens Petersen <juhpetersen@gmail.com>+copyright:           2020-2023  Jens Petersen <juhpetersen@gmail.com> category:            Distribution homepage:            https://github.com/juhp/stack-all bug-reports:         https://github.com/juhp/stack-all/issues@@ -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.7, GHC == 9.0.2+                     GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.5  source-repository head   type:                git