Updates NixOS/hydra to the latest git-revision available. Also ensured
that the list of Perl dependencies needed for the server is up-to-date.
Most notably are the following changes:
* HTTP-endpoint at `/prometheus` to export metrics
* New user-roles for minor maintenance tasks
Hydra fails to start on recent recent nixpkgs due to a change in Perl packaging: this has been reported in #72783. @conferno in that thread suggested using lib.closePropagation as a fix, which is apparently deprecated, but works for now.
As Hydra doesn't have a release model, we have to pin git revs for our
package. The current state provides some new fixes and features like a status
plugin for GitLab.
As Nix 2.0 isn't bundled in `master` and `release-19.03` and we don't
support Nix 1.11 for Hydra, I figured that the Nix version checks could
be dropped and boost can always be used as build input.
Yesterday we had a discussion about several Hydra-related problems in the #nixos
IRC channel[1], as a result a lot of stalled PRs were merged.
I think that we want to use the latest Hydra now as it contains lots of
new fixes and folks mentioned that they want to use a self-hosted
Hydra, so they probably use the `nixpkgs` package rather than the
expressions from `NixOS/hydra`.
Simply moving to 2019-03-18 should be fine for now as Hydra doesn't have
a release model.
[1] https://logs.nix.samueldr.com/nixos/2019-03-17#2048416;
The component `hydra-evaluator` requires `pool.hh` from Nix which isn't
provided by Nix 1.x and thus fails with the following error in this
case:
```
hydra-evaluator.cc:3:10: fatal error: pool.hh: No such file or directory
#include "pool.hh"
^~~~~~~~~
compilation terminated.
make[3]: *** [Makefile:443: hydra_evaluator-hydra-evaluator.o] Error 1
```
As the commit is from 2016 and fairly hard to revert for Nix 1.x
support, it's easier to drop that.
This has been tested with fixed perl-bindings for Nix1 as done in #55146.
This bumps Hydra to the latest revision available. As Hydra doesn't have
a release model (and therefore no tags) ATM, the derivation will pin
against the actual git revision and the date of the commit in the
derivation name.
Additionally the following changes have been made:
* Dropped `postUnpack` phase. It is useful when working with the Hydra
source (and no dirty changes shall be used in `release.nix`, but is has
no use in `nixpkgs`).
* Added myself as maintainer to have more folks available in case of
future breakage.
* Implemented support for Nix 2.0 and `unstable` (currently 2.1):
Since 1672bcd230447f1ce0c3291950bdd9a662cee974 in NixOS/nix the
evaluator differentiates between `settings` and `evalSettings`.
Previously `restrictEval` in `hydra-eval-jobs.cc` has been set in
`settings`, this doesn't work anymore in Nix 2.1 and is therefore
incompatible to Nix 2.0 on an API level.
To resolve this, the flag `isGreaterNix20` parses the version string
of `pkgs.nix` and applies a patch if nix.version<=2.0.
Furthermore the Hydra build with Nix 2.1 requires `boost` as build input
which is not needed for Nix 2.0. To avoid unnecessary increase in the
closure size this library will only used as build input for
nix.version>2.0.
* Fixed the NixOS test for `hydra`:
disabled binary cache to allow sandbox builds (otherwise it would
query `cache.nixos.org` during the Hydra build inside the test).
Additionally the trivial.nix jobset required simplification (as done
in NixOS/hydra, e.g. tests/api-test.nix) as bash is not available in
the build sandbox as builder (even when adding pkgs.bash to
systemPackages).
The easiest workaround to confirm a the functionality of a jobset
without importing nixpkgs is to use the default shell /bin/sh which
is mounted from `pkgs.busybox` into the build env
(https://github.com/NixOS/nixpkgs/pull/44841#discussion_r209751972) in the
VM and a named pipe to create $out.
Closes#44044
This was originally removed in d4d0e449d7.
The intent was not to maintain hydra expression at two places.
Nowadays we have enough devs to maintain this despite copy/pasta.
This should encourage more people to use Hydra, which is a really
great piece of software together with Nix.
Tested a deploy using https://github.com/peti/hydra-tutorial