Home Explore Blog Models CI



nixpkgs

4th chunk of `pkgs/development/haskell-modules/HACKING.md`
9204813a3ced603635a31dd9da0ab09b8ca2fabdd479023b0000000100000ad6

1.  Run the script to merge `haskell-updates`:

    ```console
    $ ./maintainers/scripts/haskell/merge-and-open-pr.sh PR_NUM_OF_CURRENT_HASKELL_UPDATES_PR
    ```

    Find the PR number easily [here](https://github.com/nixos/nixpkgs/pulls?q=is%3Apr+is%3Aopen+head%3Ahaskell-updates)

    This does the following things:

    1.  Fetches `origin`, makes sure you currently have the `haskell-updates`
        branch checked out, and makes sure your currently checked-out
        `haskell-updates` branch is on the same commit as
        `origin/haskell-updates`.

    1.  Merges the currently open `haskell-updates` PR.

    1.  Updates the version of Haskell packages in NixOS on Hackage.

    1.  Updates Stackage and Hackage snapshots.  Regenerates the Haskell package set.

    1.  Pushes the commits updating Stackage and Hackage and opens a new
        `haskell-updates` PR on Nixpkgs.  If you'd like to do this by hand,
        look in the script for the recommended PR title and body text.

## Update Hackage Version Information

Remember to regularly update what Hackage displays as the current
version in NixOS for every individual package.  To do this you run
`maintainers/scripts/haskell/upload-nixos-package-list-to-hackage.sh` on a checkout
of `master` (or `nixpkgs-unstable`).  See the script for how to provide credentials.
Once you have configured credentials, running this takes only a few seconds.

The best time to do this is after `staging-next` has been merged since this is
the way Haskell package updates propagate to `master`.

## Additional Info

Here are some additional tips that didn't fit in above.

-   Hydra tries to evaluate the `haskell-updates` branch (in the
    [`nixpkgs:haskell-updates`](https://hydra.nixos.org/jobset/nixpkgs/haskell-updates)
    jobset) every 4 hours.  It is possible to force a new Hydra evaluation without
    waiting 4 hours by the following steps:

    1. Log into Hydra with your GitHub or Google account.
    1. Go to the [nixpkgs:haskell-updates](https://hydra.nixos.org/jobset/nixpkgs/haskell-updates) jobset.
    1. Click the `Actions` button.
    1. Select `Evaluate this jobset`.
    1. If you refresh the page, there should be a new `Evaluation running since:` line.
    1. Evaluations take about 10 minutes to finish.

-   It is sometimes helpful to update the version of
    [`cabal2nix` / `hackage2nix`](https://github.com/NixOS/cabal2nix) that our
    maintainer scripts use.  This can be done with the
    [`maintainers/scripts/haskell/update-cabal2nix-unstable.sh`](../../../maintainers/scripts/haskell/update-cabal2nix-unstable.sh)
    script.

    You might want to do this if a user contributes a fix to `cabal2nix` that
    will immediately fix a Haskell package in Nixpkgs.  First, merge in

Title: Automating Haskell Updates and Maintenance Procedures
Summary
This section details the automated process for merging Haskell updates using the `merge-and-open-pr.sh` script. This script performs several actions: it fetches from `origin`, ensures the correct branch is checked out, merges the current `haskell-updates` PR, updates Haskell package versions on Hackage, refreshes Stackage and Hackage snapshots, regenerates the Haskell package set, and ultimately opens a new `haskell-updates` PR. Furthermore, it outlines the importance of regularly updating Hackage with current NixOS package versions via `upload-nixos-package-list-to-hackage.sh` after `staging-next` merges. Additional tips include how to force a new Hydra evaluation for the `nixpkgs:haskell-updates` jobset and how to update the `cabal2nix`/`hackage2nix` tools using `update-cabal2nix-unstable.sh` to incorporate immediate fixes.