From dd8a25528a55a64ee410c1c00e7b5dd9c5471b62 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Sun, 9 May 2021 13:22:46 +0200 Subject: [PATCH] maintainers/scripts/haskell: Add mark-broken.sh --- maintainers/scripts/haskell/mark-broken.sh | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 maintainers/scripts/haskell/mark-broken.sh diff --git a/maintainers/scripts/haskell/mark-broken.sh b/maintainers/scripts/haskell/mark-broken.sh new file mode 100755 index 00000000000..ddf2b1243b1 --- /dev/null +++ b/maintainers/scripts/haskell/mark-broken.sh @@ -0,0 +1,45 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p coreutils git -I nixpkgs=. + +# This script uses the data pulled with +# maintainers/scripts/haskell/hydra-report.hs get-report to produce a list of +# failing builds that get written to the hackage2nix config. Then +# hackage-packages.nix gets regenerated and transitive-broken packages get +# marked as dont-distribute in the config as well. +# This should disable builds for most failing jobs in the haskell-updates jobset. + +set -euo pipefail + +broken_config="pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml" + +tmpfile=$(mktemp) +trap "rm ${tmpfile}" 0 + +echo "Remember that you need to manually run 'maintainers/scripts/haskell/hydra-report.hs get-report' sometime before running this script." +echo "Generating a list of broken builds and displaying for manual confirmation ..." +maintainers/scripts/haskell/hydra-report.hs mark-broken-list | sort -i > $tmpfile + +$EDITOR $tmpfile + +tail -n +3 "$broken_config" >> "$tmpfile" + +cat > "$broken_config" << EOF +broken-packages: + # These packages don't compile. +EOF + +sort -iu "$tmpfile" >> "$broken_config" +maintainers/scripts/haskell/regenerate-hackage-packages.sh +maintainers/scripts/haskell/regenerate-transitive-broken-packages.sh +maintainers/scripts/haskell/regenerate-hackage-packages.sh + +if [[ "${1:-}" == "--do-commit" ]]; then +git add $broken_config +git add pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml +git add pkgs/development/haskell-modules/hackage-packages.nix +git commit -F - << EOF +hackage2nix: Mark failing builds broken + +This commit has been generated by maintainers/scripts/haskell/mark-broken.sh +EOF +fi