diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-03-24 11:04:41 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-03-24 11:04:41 +0100 |
commit | 5423cabbbf2b6dec5568f1ecabd288d5d9a642ec (patch) | |
tree | f316a6a921bfefd3a63bd4502c2eb50ff1644f67 /nixpkgs/maintainers/scripts/haskell/hydra-report.hs | |
parent | 46a88117a05c3469af5d99433af140c3de8ca088 (diff) | |
parent | 8aa81f34981add12aecada6c702ddbbd0375ca36 (diff) | |
download | nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.gz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.bz2 nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.lz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.xz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.zst nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.zip |
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/maintainers/scripts/haskell/hydra-report.hs')
-rwxr-xr-x | nixpkgs/maintainers/scripts/haskell/hydra-report.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nixpkgs/maintainers/scripts/haskell/hydra-report.hs b/nixpkgs/maintainers/scripts/haskell/hydra-report.hs index 8b4f798cc543..e911830e8b3e 100755 --- a/nixpkgs/maintainers/scripts/haskell/hydra-report.hs +++ b/nixpkgs/maintainers/scripts/haskell/hydra-report.hs @@ -83,7 +83,7 @@ import Prelude hiding (id) import Data.List (sortOn) import Control.Concurrent.Async (concurrently) import Control.Exception (evaluate) -import qualified Data.IntMap.Strict as IntMap +import qualified Data.IntMap.Lazy as IntMap import qualified Data.IntSet as IntSet import Data.Bifunctor (second) import Data.Data (Proxy) @@ -299,7 +299,7 @@ calculateReverseDependencies depMap = Map.fromDistinctAscList $ zip keys (zip (rdepMap False) (rdepMap True)) where -- This code tries to efficiently invert the dependency map and calculate - -- it’s transitive closure by internally identifying every pkg with it’s index + -- its transitive closure by internally identifying every pkg with its index -- in the package list and then using memoization. keys :: [PkgName] keys = Map.keys depMap @@ -317,11 +317,11 @@ calculateReverseDependencies depMap = intDeps :: [(Int, (Bool, [Int]))] intDeps = zip [0..] (fmap depInfoToIdx depInfos) - rdepMap onlyUnbroken = IntSet.size <$> resultList + rdepMap onlyUnbroken = IntSet.size <$> IntMap.elems resultList where - resultList = go <$> [0..] + resultList = IntMap.fromDistinctAscList [(i, go i) | i <- [0..length keys - 1]] oneStepMap = IntMap.fromListWith IntSet.union $ (\(key,(_,deps)) -> (,IntSet.singleton key) <$> deps) <=< filter (\(_, (broken,_)) -> not (broken && onlyUnbroken)) $ intDeps - go pkg = IntSet.unions (oneStep:((resultList !!) <$> IntSet.toList oneStep)) + go pkg = IntSet.unions (oneStep:((resultList IntMap.!) <$> IntSet.toList oneStep)) where oneStep = IntMap.findWithDefault mempty pkg oneStepMap -- | Generate a mapping of Hydra job names to maintainer GitHub handles. Calls |