on master help sign in
Merge remote-tracking branch 'upstream/master'
commitc714bc18c8873eced8b47257e8e6e12390a6639e authorKoz Ross <koz.ross@retro-freedom.nz> dateFri 22 May 2020, 08:46 (6 years ago) parentefb2e629240869
4 files changed+42−33
CURATORS.md+2−2 build-constraints.yaml+9−12 etc/diskspace/clean-old-stack-libs.sh+13 etc/diskspace/remove-old-stack-work-libs.hs+18−19
CURATORS.md+2−2
@@ -335,9 +335,9 @@ LTS minor bumps typically are run on Sundays.
335335
336336### Diskspace errors (and website sync debugging)
337337
338−* You can detect the problem by running `df`. If you see that `/` is out of space, we have a problem
338+* You can detect the problem by running `df`. If you see that `/` is out of space, we have a problem.
339339* If you see that `/var/stackage/` is out of space, you can:
340− * run `./stackage/etc/diskspace/remove-old-stack-work-libs.hs` in `/var/stackage/stackage/automated/work/*/unpack-dir/.stack-work/install/x86_64-linux/*/*/` (hopefully sufficient)
340+ * run `./etc/diskspace/clean-old-stack-libs.sh [nightly|lts-XX]` (hopefully sufficient)
341341
342342 optionally (not recommended?):
343343 * `rm -r /var/stackage/stackage/automated/work/lts*/unpack-dir/unpacked/`
build-constraints.yaml+9−12
@@ -86,7 +86,7 @@ packages:
8686
8787 "Robert Vollmert <rob@vllmrt.net> @robx":
8888 - configurator-pg
89− - postgrest
89+ - postgrest < 7.0.1 # https://github.com/commercialhaskell/stackage/issues/5383
9090
9191 "Sandy Maguire <sandy@sandymaguire.me> @isovector":
9292 - ecstasy
@@ -2589,7 +2589,7 @@ packages:
25892589 - mighty-metropolis
25902590 - speedy-slice
25912591 - hasty-hamiltonian
2592− - declarative
2592+ - declarative < 0.5.2 # https://github.com/commercialhaskell/stackage/issues/5384
25932593 - sampling
25942594 - flat-mcmc
25952595 - urbit-hob
@@ -3266,7 +3266,7 @@ packages:
32663266 - validation
32673267
32683268 "Tony Day <tonyday567@gmail.com> @tonyday567":
3269− - numhask
3269+ - numhask < 0.5 # https://github.com/commercialhaskell/stackage/issues/5382
32703270 - numhask-array < 0
32713271 - numhask-prelude < 0
32723272 - numhask-space < 0
@@ -3625,7 +3625,7 @@ packages:
36253625 - ilist
36263626 - life-sync
36273627 - membrain
3628− - relude < 0.7 # https://github.com/commercialhaskell/stackage/issues/5361
3628+ - relude
36293629 - shellmet
36303630 - shortcut-links
36313631 - summoner
@@ -4038,7 +4038,7 @@ packages:
40384038 - secp256k1-haskell
40394039 - rocksdb-haskell
40404040 - rocksdb-query
4041− - haskoin-core
4041+ - haskoin-core < 0.13.5 # https://github.com/haskoin/haskoin-core/issues/385
40424042 - haskoin-node
40434043 - haskoin-store < 0 # https://github.com/haskoin/haskoin-store/issues/12
40444044
@@ -4244,7 +4244,7 @@ packages:
42444244
42454245 "Rickey Visinski <rickeyvisinski+hs@gmail.com> @rickeyski":
42464246 - slack-api
4247−
4247+
42484248 "Dobromir Nikolov <dnikolovv@hotmail.com> @dnikolovv":
42494249 - it-has
42504250
@@ -4409,6 +4409,7 @@ packages:
44094409 - functor-combinators < 0 # via dependent-sum
44104410 - generic-arbitrary
44114411 - generics-sop-lens
4412+ - ghc-byteorder
44124413 - ghc-compact
44134414 - ghc-paths
44144415 - ghc-prof
@@ -4820,15 +4821,9 @@ packages:
48204821 # https://github.com/commercialhaskell/stackage/issues/5335
48214822 - brick <0.53
48224823
4823− # https://github.com/commercialhaskell/stackage/issues/5336
4824− - colourista < 0.1.0.0
4825−
48264824 # https://github.com/commercialhaskell/stackage/issues/5347
48274825 - persistent-template < 2.8.3
48284826
4829− # https://github.com/commercialhaskell/stackage/issues/5346
4830− - validation-selective < 0.1.0.0
4831−
48324827 # https://github.com/commercialhaskell/stackage/issues/5348
48334828 - tasty < 1.3
48344829 - tasty-golden < 2.3.3.3
@@ -4839,6 +4834,8 @@ packages:
48394834 # https://github.com/commercialhaskell/stackage/issues/5351
48404835 - pantry < 0.5
48414836
4837+ # https://github.com/commercialhaskell/path/issues/161
4838+ - path < 0.7.1
48424839# end of packages
48434840
48444841# Package flags are applied to individual packages, and override the values of
etc/diskspace/clean-old-stack-libs.shnew file+13
@@ -0,0 +1,13 @@
1+#!/bin/bash
2+
3+set -e
4+
5+if [ $# != 1 ]; then
6+ echo "Usage: $0 [nightly|lts-xx]"
7+ exit 1
8+fi
9+
10+cd ~/stackage/automated/work/$1/unpack-dir/.stack-work/install/x86_64-linux/*/*/lib/x86_64-linux-ghc-*
11+pwd
12+
13+stack --resolver lts-14.27 script ~/stackage/etc/diskspace/remove-old-stack-work-libs.hs
etc/diskspace/remove-old-stack-work-libs.hsmode 100755 → 100644+18−19
@@ -8,11 +8,13 @@
88
99import Data.List
1010import System.Directory
11+import System.FilePath
12+import Text.Regex.TDFA
1113
1214main = do
1315 files <- sort <$> listDirectory "."
14− (libdirs,dynlibs) <- partitionM doesDirectoryExist files
15− let pkglibdirs = groupBy samePkgLibDir libdirs
16+ let (dynlibs,libdirs) = partition (".so" `isExtensionOf`) files
17+ pkglibdirs = groupBy samePkgLibDir libdirs
1618 pkgdynlibs = groupBy samePkgDynLib dynlibs
1719 mapM_ (removeOlder removeDirectoryRecursive) pkglibdirs
1820 mapM_ (removeOlder removeFile) pkgdynlibs
@@ -20,22 +22,27 @@ main = do
2022 samePkgLibDir l1 l2 = pkgDirName l1 == pkgDirName l2
2123 where
2224 pkgDirName p =
23− if countDashes p < 2
24− then error $ p ++ " not in name-version-hash format"
25− else (removeDashSegment . removeDashSegment) p
25+ if length p < 25
26+ then error $ p ++ " too short to be in correct name-version-hash format"
27+ else extractNameInternal p
2628
27− countDashes = length . filter (== '-')
28−
29− removeDashSegment = init . dropWhileEnd (/= '-')
29+ extractNameInternal :: String -> String
30+ extractNameInternal p =
31+ let (name,match,internal) = p =~ "-[0-9.]+-[0-9A-Za-z]{20,22}" :: (String, String, String)
32+ in if null match || null name then error $ p ++ " not in correct name-version-hash format"
33+ else name ++ internal
3034
3135 samePkgDynLib d1 d2 = pkgDynName d1 == pkgDynName d2
3236 where
3337 pkgDynName p =
34− if countDashes p < 3
35− then error $ p ++ " not in libname-version-hash-ghc*.so format"
36− else (removeDashSegment . removeDashSegment . removeDashSegment) p
38+ if length p < 42
39+ then error $ p ++ " too short to be libHSname-version-hash-ghc*.so format"
40+ else (extractNameInternal . removeDashSegment) p
41+
42+ removeDashSegment = dropWhileEnd (/= '-')
3743
3844 removeOlder remover files = do
45+ -- keep 2 latest builds
3946 oldfiles <- drop 2 . reverse <$> sortByAge files
4047 mapM_ remover oldfiles
4148
@@ -45,11 +52,3 @@ main = do
4552 return $ map fst $ sortBy compareSnd fileTimes
4653
4754 compareSnd (_,t1) (_,t2) = compare t1 t2
48−
49−-- borrowed from Control.Monad.Extra
50−partitionM :: Monad m => (a -> m Bool) -> [a] -> m ([a], [a])
51−partitionM f [] = pure ([], [])
52−partitionM f (x:xs) = do
53− res <- f x
54− (as,bs) <- partitionM f xs
55− pure ([x | res]++as, [x | not res]++bs)