-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdate.sh
executable file
·45 lines (40 loc) · 1.97 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /usr/bin/env nix-shell
#! nix-shell -i bash
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/haskell-updates.tar.gz
#! nix-shell -p "with import (builtins.fetchTarball https://github.com/NixOS/nixpkgs/archive/nixos-23.05.tar.gz) {}; hydra_unstable"
#! nix-shell -p "writers.writeHaskellBin \"hydra-report\" {libraries = with haskellPackages; [aeson req];} (path + \"/maintainers/scripts/haskell/hydra-report.hs\")"
#! nix-shell -p "writers.writeBashBin \"get-nixpkgs-path\" \"echo \${path}\""
# This script updates the README.md with the latest build report from Hydra for
# the `haskell-updates` branch in Nixpkgs.
#
# See https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/HACKING.md
# for more information about this process.
#
# TODO: This file hard-codes the Haskell libraries used by the nixpkgs
# maintainers/scripts/haskell/hydra-report.hs file.
# It would be nice to be able to figure out these libraries automatically.
#
# TODO: The `get-nixpkgs-path` is used to get the path to the nixpkgs repo that
# has been downloaded for the nix-shell -I argument. This is somewhat of a hack.
# I wouldn't be surprised if there wasn't an easier way to get the path to the
# nixpkgs repo from within nix-shell.
#
# TODO: This uses `hydra_unstable` from 23.05 because `hydra-unstable` is sometimes broken
# on `master`.
set -u -e
# Get the updated report from Hydra.
if ! hydra-report get-report; then
echo
echo "Failure when running \`hydra-report get-report\`."
echo "This may have been a timeout, since Hydra is terrible."
echo "Trying again with \`--slow\` flag..."
echo
hydra-report get-report --slow
fi
# Create the markdown output from the report. Save it to the README.md file.
#
# Note that the `hydra-report ping-maintainers` command must be run the root of
# the nixpkgs repo.
(cd "$(get-nixpkgs-path)" && hydra-report ping-maintainers) > README.md
# Add the footer to the end of the README.
cat README-footer.md >> README.md