···11+# Nix script to lookup maintainer github handles from their email address. Used by ./hydra-report.hs.
22+let
33+ pkgs = import ../../.. {};
44+ maintainers = import ../../maintainer-list.nix;
55+ inherit (pkgs) lib;
66+ mkMailGithubPair = _: maintainer: if maintainer ? github then { "${maintainer.email}" = maintainer.github; } else {};
77+in lib.zipAttrsWith (_: builtins.head) (lib.mapAttrsToList mkMailGithubPair maintainers)
+118
maintainers/scripts/haskell/merge-and-open-pr.sh
···11+#! /usr/bin/env nix-shell
22+#! nix-shell -i bash -p git gh -I nixpkgs=.
33+#
44+# Script to merge the currently open haskell-updates PR into master, bump the
55+# Stackage version and Hackage versions, and open the next haskell-updates PR.
66+77+set -eu -o pipefail
88+99+# exit after printing first argument to this function
1010+function die {
1111+ # echo the first argument
1212+ echo "ERROR: $1"
1313+ echo "Aborting!"
1414+1515+ exit 1
1616+}
1717+1818+function help {
1919+ echo "Usage: $0 HASKELL_UPDATES_PR_NUM"
2020+ echo "Merge the currently open haskell-updates PR into master, and open the next one."
2121+ echo
2222+ echo " -h, --help print this help"
2323+ echo " HASKELL_UPDATES_PR_NUM number of the currently open PR on NixOS/nixpkgs"
2424+ echo " for the haskell-updates branch"
2525+ echo
2626+ echo "Example:"
2727+ echo " \$ $0 137340"
2828+2929+ exit 1
3030+}
3131+3232+# Read in the current haskell-updates PR number from the command line.
3333+while [[ $# -gt 0 ]]; do
3434+ key="$1"
3535+3636+ case $key in
3737+ -h|--help)
3838+ help
3939+ ;;
4040+ *)
4141+ curr_haskell_updates_pr_num="$1"
4242+ shift
4343+ ;;
4444+ esac
4545+done
4646+4747+if [[ -z "${curr_haskell_updates_pr_num-}" ]] ; then
4848+ die "You must pass the current haskell-updates PR number as the first argument to this script."
4949+fi
5050+5151+# Make sure you have gh authentication setup.
5252+if ! gh auth status 2>/dev/null ; then
5353+ die "You must setup the \`gh\` command. Run \`gh auth login\`."
5454+fi
5555+5656+# Fetch nixpkgs to get an up-to-date origin/haskell-updates branch.
5757+echo "Fetching origin..."
5858+git fetch origin >/dev/null
5959+6060+# Make sure we are currently on a local haskell-updates branch.
6161+curr_branch="$(git rev-parse --abbrev-ref HEAD)"
6262+if [[ "$curr_branch" != "haskell-updates" ]]; then
6363+ die "Current branch is not called \"haskell-updates\"."
6464+fi
6565+6666+# Make sure our local haskell-updates branch is on the same commit as
6767+# origin/haskell-updates.
6868+curr_branch_commit="$(git rev-parse haskell-updates)"
6969+origin_haskell_updates_commit="$(git rev-parse origin/haskell-updates)"
7070+if [[ "$curr_branch_commit" != "$origin_haskell_updates_commit" ]]; then
7171+ die "Current branch is not at the same commit as origin/haskell-updates"
7272+fi
7373+7474+# Merge the current open haskell-updates PR.
7575+echo "Merging https://github.com/NixOS/nixpkgs/pull/${curr_haskell_updates_pr_num}..."
7676+gh pr merge --repo NixOS/nixpkgs --merge "$curr_haskell_updates_pr_num"
7777+7878+# Update stackage, Hackage hashes, and regenerate Haskell package set
7979+echo "Updating Stackage..."
8080+./maintainers/scripts/haskell/update-stackage.sh --do-commit
8181+echo "Updating Hackage hashes..."
8282+./maintainers/scripts/haskell/update-hackage.sh --do-commit
8383+echo "Regenerating Hackage packages..."
8484+./maintainers/scripts/haskell/regenerate-hackage-packages.sh --do-commit
8585+8686+# Push these new commits to the haskell-updates branch
8787+echo "Pushing commits just created to the haskell-updates branch"
8888+git push
8989+9090+# Open new PR
9191+new_pr_body=$(cat <<EOF
9292+### This Merge
9393+9494+This PR is the regular merge of the \`haskell-updates\` branch into \`master\`.
9595+9696+This branch is being continually built and tested by hydra at https://hydra.nixos.org/jobset/nixpkgs/haskell-updates.
9797+9898+We roughly aim to merge these \`haskell-updates\` PRs at least once every two weeks. See the @NixOS/haskell [team calendar](https://cloud.maralorn.de/apps/calendar/p/Mw5WLnzsP7fC4Zky) for who is currently in charge of this branch.
9999+100100+### haskellPackages Workflow Summary
101101+102102+Our workflow is currently described in [\`pkgs/development/haskell-modules/HACKING.md\`](https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/HACKING.md).
103103+104104+The short version is this:
105105+* We regularly update the Stackage and Hackage pins on \`haskell-updates\` (normally at the beginning of a merge window).
106106+* The community fixes builds of Haskell packages on that branch.
107107+* We aim at at least one merge of \`haskell-updates\` into \`master\` every two weeks.
108108+* We only do the merge if the [\`mergeable\`](https://hydra.nixos.org/job/nixpkgs/haskell-updates/mergeable) job is succeeding on hydra.
109109+* If a [\`maintained\`](https://hydra.nixos.org/job/nixpkgs/haskell-updates/maintained) package is still broken at the time of merge, we will only merge if the maintainer has been pinged 7 days in advance. (If you care about a Haskell package, become a maintainer!)
110110+111111+---
112112+113113+This is the follow-up to #${curr_haskell_updates_pr_num}. Come to [#haskell:nixos.org](https://matrix.to/#/#haskell:nixos.org) if you have any questions.
114114+EOF
115115+)
116116+117117+echo "Opening a PR for the next haskell-updates merge cycle"
118118+gh pr create --repo NixOS/nixpkgs --base master --head haskell-updates --title "haskellPackages: update stackage and hackage" --body "$new_pr_body"
···11{
22- "commit": "aceceb24b5b4dc95017c3509add3f935d7289cd8",
33- "url": "https://github.com/commercialhaskell/all-cabal-hashes/archive/aceceb24b5b4dc95017c3509add3f935d7289cd8.tar.gz",
44- "sha256": "0bc4csxmm64qq3sxj22g4i0s2q5vpgkf2fgpby6zslhpa01pdlqq",
55- "msg": "Update from Hackage at 2021-09-10T22:56:58Z"
22+ "commit": "6b93e40198f31ac2a9d52e4f3ce90f22f1e9e6f9",
33+ "url": "https://github.com/commercialhaskell/all-cabal-hashes/archive/6b93e40198f31ac2a9d52e4f3ce90f22f1e9e6f9.tar.gz",
44+ "sha256": "1zs9d0h55q6lj3v0d0n19yxl58lhn07lmnw2j5k2y8zbx3pcqi8l",
55+ "msg": "Update from Hackage at 2021-09-17T18:08:40Z"
66}
+11-3
pkgs/development/compilers/ghcjs/8.10/default.nix
···108108109109 inherit passthru;
110110111111- # The emscripten is broken on darwin
112112- meta.platforms = lib.platforms.linux;
113113- meta.maintainers = with lib.maintainers; [ obsidian-systems-maintenance ];
111111+ meta = {
112112+ # The emscripten is broken on darwin
113113+ platforms = lib.platforms.linux;
114114+115115+ # Hydra limits jobs to only outputting 1 gigabyte worth of files.
116116+ # GHCJS outputs over 3 gigabytes.
117117+ # https://github.com/NixOS/nixpkgs/pull/137066#issuecomment-922335563
118118+ hydraPlatforms = lib.platforms.none;
119119+120120+ maintainers = with lib.maintainers; [ obsidian-systems-maintenance ];
121121+ };
114122 }
···20202121Each of these steps is described in a separate section.
22222323+There is a script that automates the workflow for merging the currently open
2424+`haskell-updates` PR into `master` and opening the next PR. It is described
2525+at the end of this document.
2626+2327## Initial `haskell-updates` PR
24282529In this section we create the PR for merging `haskell-updates` into `master`.
···465047511. Push these commits to the `haskell-updates` branch of the NixOS/nixpkgs repository.
48524949-1. Open a PR on Nixpkgs merging `haskell-updates` into `master`.
5050-5151-5252-5353-Use the title `haskellPackages: update stackage and hackage` and the following message body:
5454-5555-```markdown
5656-### This Merge
5757-5858-This PR is the regular merge of the `haskell-updates` branch into `master`.
5959-6060-This branch is being continually built and tested by hydra at https://hydra.nixos.org/jobset/nixpkgs/haskell-updates.
6161-6262-I will aim to merge this PR **by 2021-TODO-TODO**. If I can merge it earlier, there might be successor PRs in that time window. As part of our rotation @TODO will continue these merges from 2021-TODO-TODO to 2021-TODO-TODO.
6363-6464-### haskellPackages Workflow Summary
6565-6666-Our workflow is currently described in
6767-[`pkgs/development/haskell-modules/HACKING.md`](https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/HACKING.md).
6868-6969-The short version is this:
7070-* We regularly update the Stackage and Hackage pins on `haskell-updates` (normally at the beginning of a merge window).
7171-* The community fixes builds of Haskell packages on that branch.
7272-* We aim at at least one merge of `haskell-updates` into `master` every two weeks.
7373-* We only do the merge if the [`mergeable`](https://hydra.nixos.org/job/nixpkgs/haskell-updates/mergeable) job is succeeding on hydra.
7474-* If a [`maintained`](https://hydra.nixos.org/job/nixpkgs/haskell-updates/maintained) package is still broken at the time of merge, we will only merge if the maintainer has been pinged 7 days in advance. (If you care about a Haskell package, become a maintainer!)
7575-7676----
7777-7878-This is the follow-up to #TODO. Come to [#haskell:nixos.org](https://matrix.to/#/#haskell:nixos.org) if you have any questions.
7979-```
8080-8181-Make sure to replace all TODO with the actual values.
5353+1. Open a PR on Nixpkgs for merging `haskell-updates` into `master`. The recommended
5454+ PR title and body text are described in the `merge-and-open-pr.sh` section.
82558356## Notify Maintainers and Fix Broken Packages
8457···11184most recent build report.
1128511386Maintainers should be given at least 7 days to fix up their packages when they
114114-break. If maintainers don't fix up their packages with 7 days, then they
8787+break. If maintainers don't fix up their packages within 7 days, then they
11588may be marked broken before merging `haskell-updates` into `master`.
1168911790### Fix Broken Packages
···180153181154- All updated files will be committed.
182155183183-### Merge `master` into `haskell-updates`
184184-185185-You should occasionally merge the `master` branch into the `haskell-updates`
186186-branch.
187187-188188-In an ideal world, when we merge `haskell-updates` into `master`, it would
189189-cause few Hydra rebuilds on `master`. Ideally, the `nixos-unstable` channel
190190-would never be prevented from progressing because of needing to wait for
191191-rebuilding Haskell packages.
192192-193193-In order to make sure that there are a minimal number of rebuilds after merging
194194-`haskell-updates` into `master`, `master` should occasionally be merged into
195195-the `haskell-updates` branch.
196196-197197-This is especially important after `staging-next` is merged into `master`,
198198-since there is a high chance that this will cause all the Haskell packages to
199199-rebuild.
200200-201156## Merge `haskell-updates` into `master`
202157203158Now it is time to merge the `haskell-updates` PR you opened above.
···241196After merging, **make sure not to delete the `haskell-updates` branch**, since it
242197causes all currently open Haskell-related pull-requests to be automatically closed on GitHub.
243198199199+## Script for Merging `haskell-updates` and Opening a New PR
200200+201201+There is a script that automates merging the current `haskell-updates` PR and
202202+opening the next one. When you want to merge the currently open
203203+`haskell-updates` PR, you can run the script with the following steps:
204204+205205+1. Make sure you have previously authenticated with the `gh` command. The
206206+ script uses the `gh` command to merge the current PR and open a new one.
207207+ You should only need to do this once.
208208+209209+ ```console
210210+ $ gh auth login
211211+ ```
212212+213213+1. Make sure you have correctly marked packages broken. One of the previous
214214+ sections explains how to do this.
215215+216216+1. Merge `master` into `haskell-updates` and make sure to push to the
217217+ `haskell-updates` branch. (This can be skipped if `master` has recently
218218+ been merged into `haskell-updates`.)
219219+220220+1. Go to https://hydra.nixos.org/jobset/nixpkgs/haskell-updates and force an
221221+ evaluation of the `haskell-updates` jobset. See one of the following
222222+ sections for how to do this. Make sure there are no evaluation errors. If
223223+ there are remaining evaluation errors, fix them before continuing with this
224224+ merge.
225225+226226+1. Run the script to merge `haskell-updates`:
227227+228228+ ```console
229229+ $ ./maintainers/scripts/haskell/merge-and-open-pr.sh PR_NUM_OF_CURRENT_HASKELL_UPDATES_PR
230230+ ```
231231+232232+ This does the following things:
233233+234234+ 1. Fetches `origin`, makes sure you currently have the `haskell-updates`
235235+ branch checked out, and makes sure your currently checked-out
236236+ `haskell-updates` branch is on the same commit as
237237+ `origin/haskell-updates`.
238238+239239+ 1. Merges the currently open `haskell-updates` PR.
240240+241241+ 1. Updates Stackage and Hackage snapshots. Regenerates the Haskell package set.
242242+243243+ 1. Pushes the commits updating Stackage and Hackage and opens a new
244244+ `haskell-updates` PR on Nixpkgs. If you'd like to do this by hand,
245245+ look in the script for the recommended PR title and body text.
246246+244247## Update Hackage Version Information
245248246246-After merging into `master` you can update what hackage displays as the current
247247-version in NixOS for every individual package.
248248-To do this you run `maintainers/scripts/haskell/upload-nixos-package-list-to-hackage.sh`.
249249-See the script for how to provide credentials. Once you have configured that
249249+After merging into `master` you can update what Hackage displays as the current
250250+version in NixOS for every individual package. To do this you run
251251+`maintainers/scripts/haskell/upload-nixos-package-list-to-hackage.sh`. See the
252252+script for how to provide credentials. Once you have configured credentials,
250253running this takes only a few seconds.
251254252255## Additional Info
···13131414 buildInputs = [ openssl ];
15151616+ # Force the systemd service file to be regenerated from it's template. This
1717+ # file is erroneously added in version 35 and it has already been deleted from
1818+ # upstream's git repository. So this "postPatch" phase can be deleted in next
1919+ # release.
2020+ postPatch = ''
2121+ rm -f systemd/smartdns.service
2222+ '';
2323+1624 makeFlags = [
1725 "PREFIX=${placeholder "out"}"
1826 "SYSTEMDSYSTEMUNITDIR=${placeholder "out"}/lib/systemd/system"