Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1/*
2 This file defines the builds that constitute the Nixpkgs.
3 Everything defined here ends up in the Nixpkgs channel. Individual
4 jobs can be tested by running:
5
6 $ nix-build pkgs/top-level/release.nix -A <jobname>.<system>
7
8 e.g.
9
10 $ nix-build pkgs/top-level/release.nix -A coreutils.x86_64-linux
11*/
12{
13 nixpkgs ? {
14 outPath = (import ../../lib).cleanSource ../..;
15 revCount = 1234;
16 shortRev = "abcdef";
17 revision = "0000000000000000000000000000000000000000";
18 },
19 system ? builtins.currentSystem,
20 officialRelease ? false,
21 # The platform doubles for which we build Nixpkgs.
22 supportedSystems ? builtins.fromJSON (builtins.readFile ../../ci/supportedSystems.json),
23 # The platform triples for which we build bootstrap tools.
24 bootstrapConfigs ? [
25 "aarch64-apple-darwin"
26 "aarch64-unknown-linux-gnu"
27 "aarch64-unknown-linux-musl"
28 "i686-unknown-linux-gnu"
29 "x86_64-apple-darwin"
30 "x86_64-unknown-linux-gnu"
31 "x86_64-unknown-linux-musl"
32 # we can uncomment that once our bootstrap tarballs are fixed
33 #"x86_64-unknown-freebsd"
34 ],
35 # Strip most of attributes when evaluating to spare memory usage
36 scrubJobs ? true,
37 # Attributes passed to nixpkgs. Don't build packages marked as unfree.
38 nixpkgsArgs ? {
39 config = {
40 allowAliases = false;
41 allowUnfree = false;
42 inHydra = true;
43 # Exceptional unsafe packages that we still build and distribute,
44 # so users choosing to allow don't have to rebuild them every time.
45 permittedInsecurePackages = [
46 "olm-3.2.16" # see PR #347899
47 "kanidm_1_5-1.5.0"
48 "kanidmWithSecretProvisioning_1_5-1.5.0"
49 ];
50 };
51
52 __allowFileset = false;
53 },
54
55 # This flag, if set to true, will inhibit the use of `mapTestOn`
56 # and `release-lib.packagePlatforms`. Generally, it causes the
57 # resulting tree of attributes to *not* have a ".${system}"
58 # suffixed upon every job name like Hydra expects.
59 #
60 # This flag exists mainly for use by
61 # pkgs/top-level/release-attrnames-superset.nix; see that file for
62 # full details. The exact behavior of this flag may change; it
63 # should be considered an internal implementation detail of
64 # pkgs/top-level/.
65 #
66 attrNamesOnly ? false,
67}:
68
69let
70 release-lib = import ./release-lib.nix {
71 inherit
72 supportedSystems
73 scrubJobs
74 nixpkgsArgs
75 system
76 ;
77 };
78
79 inherit (release-lib) mapTestOn pkgs;
80
81 inherit (release-lib.lib)
82 collect
83 elem
84 genAttrs
85 hasInfix
86 hasSuffix
87 id
88 isDerivation
89 optionals
90 recursiveUpdate
91 ;
92
93 inherit (release-lib.lib.attrsets) unionOfDisjoint;
94
95 supportDarwin = genAttrs [
96 "x86_64"
97 "aarch64"
98 ] (arch: elem "${arch}-darwin" supportedSystems);
99
100 nonPackageJobs = rec {
101 tarball = import ./make-tarball.nix {
102 inherit
103 pkgs
104 lib-tests
105 nixpkgs
106 officialRelease
107 ;
108 };
109
110 release-checks = import ./nixpkgs-basic-release-checks.nix {
111 inherit pkgs nixpkgs supportedSystems;
112 };
113
114 manual = pkgs.nixpkgs-manual.override { inherit nixpkgs; };
115 metrics = import ./metrics.nix { inherit pkgs nixpkgs; };
116 lib-tests = import ../../lib/tests/release.nix {
117 pkgs = import nixpkgs (
118 recursiveUpdate
119 (recursiveUpdate {
120 inherit system;
121 config.allowUnsupportedSystem = true;
122 } nixpkgsArgs)
123 {
124 config.permittedInsecurePackages = nixpkgsArgs.config.permittedInsecurePackages or [ ] ++ [
125 "nix-2.3.18"
126 ];
127 }
128 );
129 };
130 pkgs-lib-tests = import ../pkgs-lib/tests { inherit pkgs; };
131
132 darwin-tested =
133 if supportDarwin.x86_64 || supportDarwin.aarch64 then
134 pkgs.releaseTools.aggregate {
135 name = "nixpkgs-darwin-${jobs.tarball.version}";
136 meta.description = "Release-critical builds for the Nixpkgs darwin channel";
137 constituents = [
138 jobs.tarball
139 jobs.release-checks
140 ]
141 ++ optionals supportDarwin.x86_64 [
142 jobs.cabal2nix.x86_64-darwin
143 jobs.ghc.x86_64-darwin
144 jobs.git.x86_64-darwin
145 jobs.go.x86_64-darwin
146 jobs.mariadb.x86_64-darwin
147 jobs.nix.x86_64-darwin
148 jobs.nixpkgs-review.x86_64-darwin
149 jobs.nix-info.x86_64-darwin
150 jobs.nix-info-tested.x86_64-darwin
151 jobs.openssh.x86_64-darwin
152 jobs.openssl.x86_64-darwin
153 jobs.pandoc.x86_64-darwin
154 jobs.postgresql.x86_64-darwin
155 jobs.python3.x86_64-darwin
156 jobs.ruby.x86_64-darwin
157 jobs.rustc.x86_64-darwin
158 # blocking ofBorg CI 2020-02-28
159 # jobs.stack.x86_64-darwin
160 jobs.stdenv.x86_64-darwin
161 jobs.vim.x86_64-darwin
162 jobs.cachix.x86_64-darwin
163 jobs.darwin.linux-builder.x86_64-darwin
164
165 # UI apps
166 # jobs.firefox-unwrapped.x86_64-darwin
167 jobs.qt5.qtmultimedia.x86_64-darwin
168 jobs.inkscape.x86_64-darwin
169 jobs.gimp.x86_64-darwin
170 jobs.emacs.x86_64-darwin
171 jobs.wireshark.x86_64-darwin
172 jobs.transmission_3-gtk.x86_64-darwin
173 jobs.transmission_4-gtk.x86_64-darwin
174
175 # Tests
176 /*
177 jobs.tests.cc-wrapper.default.x86_64-darwin
178 jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-darwin
179 jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-darwin
180 jobs.tests.stdenv-inputs.x86_64-darwin
181 jobs.tests.macOSSierraShared.x86_64-darwin
182 jobs.tests.stdenv.hooks.patch-shebangs.x86_64-darwin
183 */
184 ]
185 ++ optionals supportDarwin.aarch64 [
186 jobs.cabal2nix.aarch64-darwin
187 jobs.ghc.aarch64-darwin
188 jobs.git.aarch64-darwin
189 jobs.go.aarch64-darwin
190 jobs.mariadb.aarch64-darwin
191 jobs.nix.aarch64-darwin
192 jobs.nixpkgs-review.aarch64-darwin
193 jobs.nix-info.aarch64-darwin
194 jobs.nix-info-tested.aarch64-darwin
195 jobs.openssh.aarch64-darwin
196 jobs.openssl.aarch64-darwin
197 jobs.pandoc.aarch64-darwin
198 jobs.postgresql.aarch64-darwin
199 jobs.python3.aarch64-darwin
200 jobs.ruby.aarch64-darwin
201 jobs.rustc.aarch64-darwin
202 # blocking ofBorg CI 2020-02-28
203 # jobs.stack.aarch64-darwin
204 jobs.stdenv.aarch64-darwin
205 jobs.vim.aarch64-darwin
206 jobs.cachix.aarch64-darwin
207 jobs.darwin.linux-builder.aarch64-darwin
208
209 # UI apps
210 # jobs.firefox-unwrapped.aarch64-darwin
211 jobs.qt5.qtmultimedia.aarch64-darwin
212 jobs.inkscape.aarch64-darwin
213 jobs.gimp.aarch64-darwin
214 jobs.emacs.aarch64-darwin
215 jobs.wireshark.aarch64-darwin
216 jobs.transmission_3-gtk.aarch64-darwin
217 jobs.transmission_4-gtk.aarch64-darwin
218
219 # Tests
220 /*
221 jobs.tests.cc-wrapper.default.aarch64-darwin
222 jobs.tests.cc-wrapper.llvmPackages.clang.aarch64-darwin
223 jobs.tests.cc-wrapper.llvmPackages.libcxx.aarch64-darwin
224 jobs.tests.stdenv-inputs.aarch64-darwin
225 jobs.tests.macOSSierraShared.aarch64-darwin
226 jobs.tests.stdenv.hooks.patch-shebangs.aarch64-darwin
227 */
228 ];
229 }
230 else
231 null;
232
233 unstable = pkgs.releaseTools.aggregate {
234 name = "nixpkgs-${jobs.tarball.version}";
235 meta.description = "Release-critical builds for the Nixpkgs unstable channel";
236 constituents = [
237 jobs.tarball
238 jobs.release-checks
239 jobs.metrics
240 jobs.manual
241 jobs.lib-tests
242 jobs.pkgs-lib-tests
243 jobs.stdenv.x86_64-linux
244 jobs.cargo.x86_64-linux
245 jobs.go.x86_64-linux
246 jobs.linux.x86_64-linux
247 jobs.nix.x86_64-linux
248 jobs.pandoc.x86_64-linux
249 jobs.python3.x86_64-linux
250 # Needed by contributors to test PRs (by inclusion of the PR template)
251 jobs.nixpkgs-review.x86_64-linux
252 # Needed for support
253 jobs.nix-info.x86_64-linux
254 jobs.nix-info-tested.x86_64-linux
255 # Ensure that X11/GTK are in order.
256 jobs.firefox-unwrapped.x86_64-linux
257 jobs.cachix.x86_64-linux
258 jobs.devenv.x86_64-linux
259
260 /*
261 TODO: re-add tests; context: https://github.com/NixOS/nixpkgs/commit/36587a587ab191eddd868179d63c82cdd5dee21b
262
263 jobs.tests.cc-wrapper.default.x86_64-linux
264
265 # broken see issue #40038
266
267 jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-linux
268 jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-linux
269 jobs.tests.cc-multilib-gcc.x86_64-linux
270 jobs.tests.cc-multilib-clang.x86_64-linux
271 jobs.tests.stdenv-inputs.x86_64-linux
272 jobs.tests.stdenv.hooks.patch-shebangs.x86_64-linux
273 */
274 ]
275 ++ collect isDerivation jobs.stdenvBootstrapTools
276 ++ optionals supportDarwin.x86_64 [
277 jobs.stdenv.x86_64-darwin
278 jobs.cargo.x86_64-darwin
279 jobs.cachix.x86_64-darwin
280 jobs.devenv.x86_64-darwin
281 jobs.go.x86_64-darwin
282 jobs.python3.x86_64-darwin
283 jobs.nixpkgs-review.x86_64-darwin
284 jobs.nix.x86_64-darwin
285 jobs.nix-info.x86_64-darwin
286 jobs.nix-info-tested.x86_64-darwin
287 jobs.git.x86_64-darwin
288 jobs.mariadb.x86_64-darwin
289 jobs.vim.x86_64-darwin
290 jobs.inkscape.x86_64-darwin
291 jobs.qt5.qtmultimedia.x86_64-darwin
292 jobs.darwin.linux-builder.x86_64-darwin
293 /*
294 jobs.tests.cc-wrapper.default.x86_64-darwin
295 jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-darwin
296 jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-darwin
297 jobs.tests.stdenv-inputs.x86_64-darwin
298 jobs.tests.macOSSierraShared.x86_64-darwin
299 jobs.tests.stdenv.hooks.patch-shebangs.x86_64-darwin
300 */
301 ]
302 ++ optionals supportDarwin.aarch64 [
303 jobs.stdenv.aarch64-darwin
304 jobs.cargo.aarch64-darwin
305 jobs.cachix.aarch64-darwin
306 jobs.devenv.aarch64-darwin
307 jobs.go.aarch64-darwin
308 jobs.python3.aarch64-darwin
309 jobs.nixpkgs-review.aarch64-darwin
310 jobs.nix.aarch64-darwin
311 jobs.nix-info.aarch64-darwin
312 jobs.nix-info-tested.aarch64-darwin
313 jobs.git.aarch64-darwin
314 jobs.mariadb.aarch64-darwin
315 jobs.vim.aarch64-darwin
316 jobs.inkscape.aarch64-darwin
317 jobs.qt5.qtmultimedia.aarch64-darwin
318 jobs.darwin.linux-builder.aarch64-darwin
319 # consider adding tests, as suggested above for x86_64-darwin
320 ];
321 };
322
323 stdenvBootstrapTools = genAttrs bootstrapConfigs (
324 config:
325 if hasInfix "-linux-" config then
326 let
327 bootstrap = import ../stdenv/linux/make-bootstrap-tools.nix {
328 pkgs = import ../.. {
329 localSystem = { inherit config; };
330 };
331 };
332 in
333 {
334 inherit (bootstrap) build test;
335 }
336 else if hasSuffix "-darwin" config then
337 let
338 bootstrap = import ../stdenv/darwin/make-bootstrap-tools.nix {
339 localSystem = { inherit config; };
340 };
341 in
342 {
343 # Lightweight distribution and test
344 inherit (bootstrap) build test;
345 # Test a full stdenv bootstrap from the bootstrap tools definition
346 # TODO: Re-enable once the new bootstrap-tools are in place.
347 #inherit (bootstrap.test-pkgs) stdenv;
348 }
349 else if hasSuffix "-freebsd" config then
350 let
351 bootstrap = import ../stdenv/freebsd/make-bootstrap-tools.nix {
352 pkgs = import ../.. {
353 localSystem = { inherit config; };
354 };
355 };
356 in
357 {
358 inherit (bootstrap) build; # test does't exist yet
359 }
360 else
361 abort "No bootstrap implementation for system: ${config}"
362 );
363 };
364
365 # Do not allow attribute collision between jobs inserted in
366 # 'nonPackageAttrs' and jobs pulled in from 'pkgs'.
367 # Conflicts usually cause silent job drops like in
368 # https://github.com/NixOS/nixpkgs/pull/182058
369 jobs =
370 let
371 packagePlatforms = release-lib.recursiveMapPackages (
372 if attrNamesOnly then id else release-lib.getPlatforms
373 );
374 packageJobs = packagePlatforms pkgs // {
375 haskell.compiler = packagePlatforms pkgs.haskell.compiler;
376 haskellPackages = packagePlatforms pkgs.haskellPackages;
377 # Build selected packages (HLS) for multiple Haskell compilers to rebuild
378 # the cache after a staging merge
379 haskell.packages =
380 genAttrs
381 [
382 # TODO: share this list between release.nix and release-haskell.nix
383 "ghc90"
384 "ghc92"
385 "ghc94"
386 "ghc96"
387 "ghc98"
388 "ghc910"
389 "ghc912"
390 ]
391 (compilerName: {
392 inherit (packagePlatforms pkgs.haskell.packages.${compilerName})
393 haskell-language-server
394 ;
395 });
396
397 pkgsLLVM.stdenv = [
398 "x86_64-linux"
399 "aarch64-linux"
400 ];
401 pkgsArocc.stdenv = [
402 "x86_64-linux"
403 "aarch64-linux"
404 ];
405 pkgsZig.stdenv = [
406 "x86_64-linux"
407 "aarch64-linux"
408 ];
409 pkgsMusl.stdenv = [
410 "x86_64-linux"
411 "aarch64-linux"
412 ];
413 pkgsStatic.stdenv = [
414 "x86_64-linux"
415 "aarch64-linux"
416 ];
417
418 # Fails CI in its current state
419 ocamlPackages = { };
420 };
421 mapTestOn-packages = if attrNamesOnly then packageJobs else mapTestOn packageJobs;
422 in
423 unionOfDisjoint nonPackageJobs mapTestOn-packages;
424
425in
426jobs