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 # FIXME: these are just temporarily omitted until fixed
276 # see https://hydra.nixos.org/build/303330677#tabs-constituents
277 #++ collect isDerivation jobs.stdenvBootstrapTools
278 ++ optionals supportDarwin.x86_64 [
279 jobs.stdenv.x86_64-darwin
280 jobs.cargo.x86_64-darwin
281 jobs.cachix.x86_64-darwin
282 jobs.devenv.x86_64-darwin
283 jobs.go.x86_64-darwin
284 jobs.python3.x86_64-darwin
285 jobs.nixpkgs-review.x86_64-darwin
286 jobs.nix.x86_64-darwin
287 jobs.nix-info.x86_64-darwin
288 jobs.nix-info-tested.x86_64-darwin
289 jobs.git.x86_64-darwin
290 jobs.mariadb.x86_64-darwin
291 jobs.vim.x86_64-darwin
292 jobs.inkscape.x86_64-darwin
293 jobs.qt5.qtmultimedia.x86_64-darwin
294 jobs.darwin.linux-builder.x86_64-darwin
295 /*
296 jobs.tests.cc-wrapper.default.x86_64-darwin
297 jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-darwin
298 jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-darwin
299 jobs.tests.stdenv-inputs.x86_64-darwin
300 jobs.tests.macOSSierraShared.x86_64-darwin
301 jobs.tests.stdenv.hooks.patch-shebangs.x86_64-darwin
302 */
303 ]
304 ++ optionals supportDarwin.aarch64 [
305 jobs.stdenv.aarch64-darwin
306 jobs.cargo.aarch64-darwin
307 jobs.cachix.aarch64-darwin
308 jobs.devenv.aarch64-darwin
309 jobs.go.aarch64-darwin
310 jobs.python3.aarch64-darwin
311 jobs.nixpkgs-review.aarch64-darwin
312 jobs.nix.aarch64-darwin
313 jobs.nix-info.aarch64-darwin
314 jobs.nix-info-tested.aarch64-darwin
315 jobs.git.aarch64-darwin
316 jobs.mariadb.aarch64-darwin
317 jobs.vim.aarch64-darwin
318 jobs.inkscape.aarch64-darwin
319 jobs.qt5.qtmultimedia.aarch64-darwin
320 jobs.darwin.linux-builder.aarch64-darwin
321 # consider adding tests, as suggested above for x86_64-darwin
322 ];
323 };
324
325 stdenvBootstrapTools = genAttrs bootstrapConfigs (
326 config:
327 if hasInfix "-linux-" config then
328 let
329 bootstrap = import ../stdenv/linux/make-bootstrap-tools.nix {
330 pkgs = import ../.. {
331 localSystem = { inherit config; };
332 };
333 };
334 in
335 {
336 inherit (bootstrap) build test;
337 }
338 else if hasSuffix "-darwin" config then
339 let
340 bootstrap = import ../stdenv/darwin/make-bootstrap-tools.nix {
341 localSystem = { inherit config; };
342 };
343 in
344 {
345 # Lightweight distribution and test
346 inherit (bootstrap) build test;
347 # Test a full stdenv bootstrap from the bootstrap tools definition
348 # TODO: Re-enable once the new bootstrap-tools are in place.
349 #inherit (bootstrap.test-pkgs) stdenv;
350 }
351 else if hasSuffix "-freebsd" config then
352 let
353 bootstrap = import ../stdenv/freebsd/make-bootstrap-tools.nix {
354 pkgs = import ../.. {
355 localSystem = { inherit config; };
356 };
357 };
358 in
359 {
360 inherit (bootstrap) build; # test does't exist yet
361 }
362 else
363 abort "No bootstrap implementation for system: ${config}"
364 );
365 };
366
367 # Do not allow attribute collision between jobs inserted in
368 # 'nonPackageAttrs' and jobs pulled in from 'pkgs'.
369 # Conflicts usually cause silent job drops like in
370 # https://github.com/NixOS/nixpkgs/pull/182058
371 jobs =
372 let
373 packagePlatforms = release-lib.recursiveMapPackages (
374 if attrNamesOnly then id else release-lib.getPlatforms
375 );
376 packageJobs = packagePlatforms pkgs // {
377 haskell.compiler = packagePlatforms pkgs.haskell.compiler;
378 haskellPackages = packagePlatforms pkgs.haskellPackages;
379 # Build selected packages (HLS) for multiple Haskell compilers to rebuild
380 # the cache after a staging merge
381 haskell.packages =
382 genAttrs
383 [
384 # TODO: share this list between release.nix and release-haskell.nix
385 "ghc90"
386 "ghc92"
387 "ghc94"
388 "ghc96"
389 "ghc98"
390 "ghc910"
391 "ghc912"
392 ]
393 (compilerName: {
394 inherit (packagePlatforms pkgs.haskell.packages.${compilerName})
395 haskell-language-server
396 ;
397 });
398 idrisPackages = packagePlatforms pkgs.idrisPackages;
399 agdaPackages = packagePlatforms pkgs.agdaPackages;
400
401 pkgsLLVM.stdenv = [
402 "x86_64-linux"
403 "aarch64-linux"
404 ];
405 pkgsArocc.stdenv = [
406 "x86_64-linux"
407 "aarch64-linux"
408 ];
409 pkgsZig.stdenv = [
410 "x86_64-linux"
411 "aarch64-linux"
412 ];
413 pkgsMusl.stdenv = [
414 "x86_64-linux"
415 "aarch64-linux"
416 ];
417 pkgsStatic.stdenv = [
418 "x86_64-linux"
419 "aarch64-linux"
420 ];
421
422 tests = packagePlatforms pkgs.tests;
423
424 # Language packages disabled in https://github.com/NixOS/nixpkgs/commit/ccd1029f58a3bb9eca32d81bf3f33cb4be25cc66
425
426 #emacsPackages = packagePlatforms pkgs.emacsPackages;
427 #rPackages = packagePlatforms pkgs.rPackages;
428 ocamlPackages = { };
429 perlPackages = { };
430
431 darwin = packagePlatforms pkgs.darwin // {
432 xcode = { };
433 };
434 };
435 mapTestOn-packages = if attrNamesOnly then packageJobs else mapTestOn packageJobs;
436 in
437 unionOfDisjoint nonPackageJobs mapTestOn-packages;
438
439in
440jobs