diff --git a/CURATORS.md b/CURATORS.md index 89ee5394..da594cb2 100644 --- a/CURATORS.md +++ b/CURATORS.md @@ -335,9 +335,9 @@ LTS minor bumps typically are run on Sundays. ### Diskspace errors (and website sync debugging) -* You can detect the problem by running `df`. If you see that `/` is out of space, we have a problem +* You can detect the problem by running `df`. If you see that `/` is out of space, we have a problem. * If you see that `/var/stackage/` is out of space, you can: - * 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) + * run `./etc/diskspace/clean-old-stack-libs.sh [nightly|lts-XX]` (hopefully sufficient) optionally (not recommended?): * `rm -r /var/stackage/stackage/automated/work/lts*/unpack-dir/unpacked/` diff --git a/build-constraints.yaml b/build-constraints.yaml index fee17d47..af5336fa 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -86,7 +86,7 @@ packages: "Robert Vollmert @robx": - configurator-pg - - postgrest + - postgrest < 7.0.1 # https://github.com/commercialhaskell/stackage/issues/5383 "Sandy Maguire @isovector": - ecstasy @@ -2589,7 +2589,7 @@ packages: - mighty-metropolis - speedy-slice - hasty-hamiltonian - - declarative + - declarative < 0.5.2 # https://github.com/commercialhaskell/stackage/issues/5384 - sampling - flat-mcmc - urbit-hob @@ -3266,7 +3266,7 @@ packages: - validation "Tony Day @tonyday567": - - numhask + - numhask < 0.5 # https://github.com/commercialhaskell/stackage/issues/5382 - numhask-array < 0 - numhask-prelude < 0 - numhask-space < 0 @@ -3625,7 +3625,7 @@ packages: - ilist - life-sync - membrain - - relude < 0.7 # https://github.com/commercialhaskell/stackage/issues/5361 + - relude - shellmet - shortcut-links - summoner @@ -4038,7 +4038,7 @@ packages: - secp256k1-haskell - rocksdb-haskell - rocksdb-query - - haskoin-core + - haskoin-core < 0.13.5 # https://github.com/haskoin/haskoin-core/issues/385 - haskoin-node - haskoin-store < 0 # https://github.com/haskoin/haskoin-store/issues/12 @@ -4244,7 +4244,7 @@ packages: "Rickey Visinski @rickeyski": - slack-api - + "Dobromir Nikolov @dnikolovv": - it-has @@ -4409,6 +4409,7 @@ packages: - functor-combinators < 0 # via dependent-sum - generic-arbitrary - generics-sop-lens + - ghc-byteorder - ghc-compact - ghc-paths - ghc-prof @@ -4820,15 +4821,9 @@ packages: # https://github.com/commercialhaskell/stackage/issues/5335 - brick <0.53 - # https://github.com/commercialhaskell/stackage/issues/5336 - - colourista < 0.1.0.0 - # https://github.com/commercialhaskell/stackage/issues/5347 - persistent-template < 2.8.3 - # https://github.com/commercialhaskell/stackage/issues/5346 - - validation-selective < 0.1.0.0 - # https://github.com/commercialhaskell/stackage/issues/5348 - tasty < 1.3 - tasty-golden < 2.3.3.3 @@ -4839,6 +4834,8 @@ packages: # https://github.com/commercialhaskell/stackage/issues/5351 - pantry < 0.5 + # https://github.com/commercialhaskell/path/issues/161 + - path < 0.7.1 # end of packages # Package flags are applied to individual packages, and override the values of diff --git a/etc/diskspace/clean-old-stack-libs.sh b/etc/diskspace/clean-old-stack-libs.sh new file mode 100755 index 00000000..e63044f9 --- /dev/null +++ b/etc/diskspace/clean-old-stack-libs.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +if [ $# != 1 ]; then + echo "Usage: $0 [nightly|lts-xx]" + exit 1 +fi + +cd ~/stackage/automated/work/$1/unpack-dir/.stack-work/install/x86_64-linux/*/*/lib/x86_64-linux-ghc-* +pwd + +stack --resolver lts-14.27 script ~/stackage/etc/diskspace/remove-old-stack-work-libs.hs diff --git a/etc/diskspace/remove-old-stack-work-libs.hs b/etc/diskspace/remove-old-stack-work-libs.hs old mode 100755 new mode 100644 index 7e81b5e7..a2cd4e3b --- a/etc/diskspace/remove-old-stack-work-libs.hs +++ b/etc/diskspace/remove-old-stack-work-libs.hs @@ -8,11 +8,13 @@ import Data.List import System.Directory +import System.FilePath +import Text.Regex.TDFA main = do files <- sort <$> listDirectory "." - (libdirs,dynlibs) <- partitionM doesDirectoryExist files - let pkglibdirs = groupBy samePkgLibDir libdirs + let (dynlibs,libdirs) = partition (".so" `isExtensionOf`) files + pkglibdirs = groupBy samePkgLibDir libdirs pkgdynlibs = groupBy samePkgDynLib dynlibs mapM_ (removeOlder removeDirectoryRecursive) pkglibdirs mapM_ (removeOlder removeFile) pkgdynlibs @@ -20,22 +22,27 @@ main = do samePkgLibDir l1 l2 = pkgDirName l1 == pkgDirName l2 where pkgDirName p = - if countDashes p < 2 - then error $ p ++ " not in name-version-hash format" - else (removeDashSegment . removeDashSegment) p + if length p < 25 + then error $ p ++ " too short to be in correct name-version-hash format" + else extractNameInternal p - countDashes = length . filter (== '-') - - removeDashSegment = init . dropWhileEnd (/= '-') + extractNameInternal :: String -> String + extractNameInternal p = + let (name,match,internal) = p =~ "-[0-9.]+-[0-9A-Za-z]{20,22}" :: (String, String, String) + in if null match || null name then error $ p ++ " not in correct name-version-hash format" + else name ++ internal samePkgDynLib d1 d2 = pkgDynName d1 == pkgDynName d2 where pkgDynName p = - if countDashes p < 3 - then error $ p ++ " not in libname-version-hash-ghc*.so format" - else (removeDashSegment . removeDashSegment . removeDashSegment) p + if length p < 42 + then error $ p ++ " too short to be libHSname-version-hash-ghc*.so format" + else (extractNameInternal . removeDashSegment) p + + removeDashSegment = dropWhileEnd (/= '-') removeOlder remover files = do + -- keep 2 latest builds oldfiles <- drop 2 . reverse <$> sortByAge files mapM_ remover oldfiles @@ -45,11 +52,3 @@ main = do return $ map fst $ sortBy compareSnd fileTimes compareSnd (_,t1) (_,t2) = compare t1 t2 - --- borrowed from Control.Monad.Extra -partitionM :: Monad m => (a -> m Bool) -> [a] -> m ([a], [a]) -partitionM f [] = pure ([], []) -partitionM f (x:xs) = do - res <- f x - (as,bs) <- partitionM f xs - pure ([x | res]++as, [x | not res]++bs)