about summary refs log tree commit diff
path: root/maintainers/scripts/haskell
diff options
context:
space:
mode:
Diffstat (limited to 'maintainers/scripts/haskell')
-rw-r--r--maintainers/scripts/haskell/dependencies.nix6
-rwxr-xr-xmaintainers/scripts/haskell/hydra-report.hs10
-rwxr-xr-xmaintainers/scripts/haskell/regenerate-hackage-packages.sh4
-rwxr-xr-xmaintainers/scripts/haskell/update-stackage.sh2
4 files changed, 10 insertions, 12 deletions
diff --git a/maintainers/scripts/haskell/dependencies.nix b/maintainers/scripts/haskell/dependencies.nix
index fd8338c0029a..5965b1ba1828 100644
--- a/maintainers/scripts/haskell/dependencies.nix
+++ b/maintainers/scripts/haskell/dependencies.nix
@@ -2,8 +2,10 @@
 let
   pkgs = import ../../.. {};
   inherit (pkgs) lib;
-  getDeps = _: pkg: {
-    deps = builtins.filter (x: x != null) (map (x: x.pname or null) (pkg.propagatedBuildInputs or []));
+  getDeps = _: pkg: let
+    pname = pkg.pname or null;
+  in {
+    deps = builtins.filter (x: x != null && x != pname) (map (x: x.pname or null) (pkg.propagatedBuildInputs or []));
     broken = (pkg.meta.hydraPlatforms or [null]) == [];
   };
 in
diff --git a/maintainers/scripts/haskell/hydra-report.hs b/maintainers/scripts/haskell/hydra-report.hs
index 8b4f798cc543..e911830e8b3e 100755
--- a/maintainers/scripts/haskell/hydra-report.hs
+++ b/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
diff --git a/maintainers/scripts/haskell/regenerate-hackage-packages.sh b/maintainers/scripts/haskell/regenerate-hackage-packages.sh
index 96a18aa8ed87..8f629c53102f 100755
--- a/maintainers/scripts/haskell/regenerate-hackage-packages.sh
+++ b/maintainers/scripts/haskell/regenerate-hackage-packages.sh
@@ -66,10 +66,6 @@ done
 
 HACKAGE2NIX="${HACKAGE2NIX:-hackage2nix}"
 
-# To prevent hackage2nix fails because of encoding.
-# See: https://github.com/NixOS/nixpkgs/pull/122023
-export LC_ALL=C.UTF-8
-
 config_dir=pkgs/development/haskell-modules/configuration-hackage2nix
 
 run_hackage2nix() {
diff --git a/maintainers/scripts/haskell/update-stackage.sh b/maintainers/scripts/haskell/update-stackage.sh
index 5dc52abdd668..fdb1cd184f69 100755
--- a/maintainers/scripts/haskell/update-stackage.sh
+++ b/maintainers/scripts/haskell/update-stackage.sh
@@ -8,7 +8,7 @@ set -eu -o pipefail
 # (should be capitalized like the display name)
 SOLVER=LTS
 # Stackage solver verson, if any. Use latest if empty
-VERSION=21
+VERSION=
 TMP_TEMPLATE=update-stackage.XXXXXXX
 readonly SOLVER
 readonly VERSION