Skip to content

Commit 17532e1

Browse files
committed
nixos/release-combined.nix: Build pkgs/by-name tester
(cherry picked from commit 34c8b0a)
1 parent c6b0fc0 commit 17532e1

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

nixos/release-combined.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ in rec {
158158
(onFullSupported "nixpkgs.emacs")
159159
(onFullSupported "nixpkgs.jdk")
160160
["nixpkgs.tarball"]
161+
162+
# Ensure that nixpkgs-check-by-name is available in all release channels and nixos-unstable,
163+
# so that a pre-built version can be used in CI for PR's on the corresponding development branches.
164+
# See ../pkgs/test/nixpkgs-check-by-name/README.md
165+
(onSystems ["x86_64-linux"] "nixpkgs.tests.nixpkgs-check-by-name")
161166
];
162167
};
163168
}

pkgs/test/nixpkgs-check-by-name/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This is part of the implementation of [RFC 140](https://github.com/NixOS/rfcs/pu
55

66
## API
77

8-
This API may be changed over time if the CI making use of it is adjusted to deal with the change appropriately.
8+
This API may be changed over time if the CI making use of it is adjusted to deal with the change appropriately, see [Hydra builds](#hydra-builds).
99

1010
- Command line: `nixpkgs-check-by-name <NIXPKGS>`
1111
- Arguments:
@@ -80,3 +80,18 @@ Tests are declared in [`./tests`](./tests) as subdirectories imitating Nixpkgs w
8080
- `expected` (optional):
8181
A file containing the expected standard output.
8282
The default is expecting an empty standard output.
83+
84+
## Hydra builds
85+
86+
This program will always be available pre-built for `x86_64-linux` on the `nixos-unstable` channel and `nixos-XX.YY` channels.
87+
This is ensured by including it in the `tested` jobset description in [`nixos/release-combined.nix`](../../../nixos/release-combined.nix).
88+
89+
This allows CI for PRs to development branches `master` and `release-XX.YY` to fetch the pre-built program from the corresponding channel and use that to check the PR. This has the following benefits:
90+
- It allows CI to check all PRs, even if they would break the CI tooling.
91+
- It makes the CI check very fast, since no Nix builds need to be done, even for mass rebuilds.
92+
- It improves security, since we don't have to build potentially untrusted code from PRs.
93+
The tool only needs a very minimal Nix evaluation at runtime, which can work with [readonly-mode](https://nixos.org/manual/nix/stable/command-ref/opt-common.html#opt-readonly-mode) and [restrict-eval](https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-restrict-eval).
94+
- It allows anybody to make updates to the tooling and for those updates to be automatically used by CI without needing a separate release mechanism.
95+
96+
The tradeoff is that there's a delay between updates to the tool and those updates being used by CI.
97+
This needs to be considered when updating the [API](#api).

0 commit comments

Comments
 (0)