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.
14 mark_broken_list_flags
=""
22 mark_broken_list_flags
="$mark_broken_list_flags $arg"
25 echo "$0: unknown flag: $arg"
31 broken_config
="pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml"
34 trap "rm ${tmpfile}" 0
36 echo "Remember that you need to manually run 'maintainers/scripts/haskell/hydra-report.hs get-report' sometime before running this script."
37 echo "Generating a list of broken builds and displaying for manual confirmation ..."
38 maintainers
/scripts
/haskell
/hydra-report.hs mark-broken-list
$mark_broken_list_flags |
sort -i > "$tmpfile"
42 tail -n +3 "$broken_config" >> "$tmpfile"
44 cat > "$broken_config" << EOF
46 # These packages don't compile.
49 # clear environment here to avoid things like allowing broken builds in
50 sort -iu "$tmpfile" >> "$broken_config"
51 clear="env -u HOME -u NIXPKGS_CONFIG"
52 $clear maintainers
/scripts
/haskell
/regenerate-hackage-packages.sh
53 evalline
=$
(maintainers
/scripts
/haskell
/hydra-report.hs eval-info
)
56 git add
$broken_config
57 git add pkgs
/development
/haskell-modules
/configuration-hackage2nix
/transitive-broken.yaml
58 git add pkgs
/development
/haskell-modules
/hackage-packages.nix
59 git commit
-F - << EOF
60 haskellPackages: mark builds failing on hydra as broken
62 This commit has been generated by maintainers/scripts/haskell/mark-broken.sh based on
64 from the haskell-updates jobset on hydra under https://hydra.nixos.org/jobset/nixpkgs/haskell-updates