···
1
+
#! /usr/bin/env nix-shell
2
+
#! nix-shell -i bash -p coreutils git -I nixpkgs=.
4
+
# This script uses the data pulled with
5
+
# maintainers/scripts/haskell/hydra-report.hs get-report to produce a list of
6
+
# failing builds that get written to the hackage2nix config. Then
7
+
# hackage-packages.nix gets regenerated and transitive-broken packages get
8
+
# marked as dont-distribute in the config as well.
9
+
# This should disable builds for most failing jobs in the haskell-updates jobset.
13
+
broken_config="pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml"
16
+
trap "rm ${tmpfile}" 0
18
+
echo "Remember that you need to manually run 'maintainers/scripts/haskell/hydra-report.hs get-report' sometime before running this script."
19
+
echo "Generating a list of broken builds and displaying for manual confirmation ..."
20
+
maintainers/scripts/haskell/hydra-report.hs mark-broken-list | sort -i > $tmpfile
24
+
tail -n +3 "$broken_config" >> "$tmpfile"
26
+
cat > "$broken_config" << EOF
28
+
# These packages don't compile.
31
+
sort -iu "$tmpfile" >> "$broken_config"
32
+
maintainers/scripts/haskell/regenerate-hackage-packages.sh
33
+
maintainers/scripts/haskell/regenerate-transitive-broken-packages.sh
34
+
maintainers/scripts/haskell/regenerate-hackage-packages.sh
36
+
if [[ "${1:-}" == "--do-commit" ]]; then
37
+
git add $broken_config
38
+
git add pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml
39
+
git add pkgs/development/haskell-modules/hackage-packages.nix
40
+
git commit -F - << EOF
41
+
hackage2nix: Mark failing builds broken
43
+
This commit has been generated by maintainers/scripts/haskell/mark-broken.sh