on master help sign in
Merge branch 'master' into add-it-has
fc7365aJens Petersen
build-constraints.yaml+8−5
@@ -466,7 +466,7 @@ packages:
466
466
467 "Li-yao Xia <lysxia@gmail.com> @Lysxia":
467 "Li-yao Xia <lysxia@gmail.com> @Lysxia":
468 - boltzmann-samplers
468 - boltzmann-samplers
469− - first-class-families < 0.8.0.0
469+ - first-class-families
470 - generic-data
470 - generic-data
471 - generic-data-surgery < 0 # via generic-data
471 - generic-data-surgery < 0 # via generic-data
472 - generic-random
472 - generic-random
@@ -862,7 +862,7 @@ packages:
862 - compensated
862 - compensated
863 - compressed < 0
863 - compressed < 0
864 - concurrent-supply
864 - concurrent-supply
865− - constraints < 0.12 # https://github.com/commercialhaskell/stackage/issues/5124
865+ - constraints
866 - contravariant
866 - contravariant
867 - distributive
867 - distributive
868 - discrimination < 0
868 - discrimination < 0
@@ -3865,10 +3865,10 @@ packages:
3865 - map-syntax < 0 # GHC 8.4 via base-4.11.0.0
3865 - map-syntax < 0 # GHC 8.4 via base-4.11.0.0
3866 - heist < 0 # GHC 8.4 via map-syntax
3866 - heist < 0 # GHC 8.4 via map-syntax
3867 - snap < 0 # GHC 8.4 via base-4.11.0.0
3867 - snap < 0 # GHC 8.4 via base-4.11.0.0
3868− - conferer
3868+ - conferer < 0.4.0.0 # https://github.com/commercialhaskell/stackage/issues/5374
3869 # - conferer-snap # Because snap
3869 # - conferer-snap # Because snap
3870− - conferer-warp
3870+ - conferer-warp < 0.4.0.0 # https://github.com/commercialhaskell/stackage/issues/5374
3871− - conferer-hspec
3871+ - conferer-hspec < 0.4.0.0 # https://github.com/commercialhaskell/stackage/issues/5374
3872 - conferer-provider-json
3872 - conferer-provider-json
3873
3873
3874 "Tim Humphries <tim+stackage@utf8.me> @thumphries":
3874 "Tim Humphries <tim+stackage@utf8.me> @thumphries":
@@ -4245,6 +4245,9 @@ packages:
4245 "Dobromir Nikolov <dnikolovv@hotmail.com> @dnikolovv":
4245 "Dobromir Nikolov <dnikolovv@hotmail.com> @dnikolovv":
4246 - it-has
4246 - it-has
4247
4247
4248+ "Gabriele Sales <gbrsales@gmail.com> @gbrsales":
4249+ - cabal-appimage
4250+
4248 "Grandfathered dependencies":
4251 "Grandfathered dependencies":
4249 - network
4252 - network
4250 - Boolean
4253 - Boolean
etc/diskspace/remove-old-stack-work-libs.hsnew file+55
@@ -0,0 +1,55 @@
1+#!/usr/bin/env stack
2+-- stack --resolver lts-14 script
3+
4+-- Utility to remove old libs installed under .stack-work/ to save diskspace
5+
6+-- Should be run in:
7+-- work/*/unpack-dir/.stack-work/install/x86_64-linux/*/*/lib/x86_64-linux-ghc-*
8+
9+import Data.List
10+import System.Directory
11+
12+main = do
13+ files <- sort <$> listDirectory "."
14+ (libdirs,dynlibs) <- partitionM doesDirectoryExist files
15+ let pkglibdirs = groupBy samePkgLibDir libdirs
16+ pkgdynlibs = groupBy samePkgDynLib dynlibs
17+ mapM_ (removeOlder removeDirectoryRecursive) pkglibdirs
18+ mapM_ (removeOlder removeFile) pkgdynlibs
19+ where
20+ samePkgLibDir l1 l2 = pkgDirName l1 == pkgDirName l2
21+ where
22+ pkgDirName p =
23+ if countDashes p < 2
24+ then error $ p ++ " not in name-version-hash format"
25+ else (removeDashSegment . removeDashSegment) p
26+
27+ countDashes = length . filter (== '-')
28+
29+ removeDashSegment = init . dropWhileEnd (/= '-')
30+
31+ samePkgDynLib d1 d2 = pkgDynName d1 == pkgDynName d2
32+ where
33+ 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
37+
38+ removeOlder remover files = do
39+ oldfiles <- drop 2 . reverse <$> sortByAge files
40+ mapM_ remover oldfiles
41+
42+ sortByAge files = do
43+ timestamps <- mapM getModificationTime files
44+ let fileTimes = zip files timestamps
45+ return $ map fst $ sortBy compareSnd fileTimes
46+
47+ 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)