pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / top-level / release.nix
blobbf69d13c98f1a893f3cfd0a4452d17cb2e72fae6
1 /* This file defines the builds that constitute the Nixpkgs.
2    Everything defined here ends up in the Nixpkgs channel.  Individual
3    jobs can be tested by running:
5    $ nix-build pkgs/top-level/release.nix -A <jobname>.<system>
7    e.g.
9    $ nix-build pkgs/top-level/release.nix -A coreutils.x86_64-linux
11 { nixpkgs ? { outPath = (import ../../lib).cleanSource ../..; revCount = 1234; shortRev = "abcdef"; revision = "0000000000000000000000000000000000000000"; }
12 , system ? builtins.currentSystem
13 , officialRelease ? false
14   # The platform doubles for which we build Nixpkgs.
15 , supportedSystems ? [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]
16   # The platform triples for which we build bootstrap tools.
17 , bootstrapConfigs ? [
18     "aarch64-apple-darwin"
19     "aarch64-unknown-linux-gnu"
20     "aarch64-unknown-linux-musl"
21     "i686-unknown-linux-gnu"
22     "x86_64-apple-darwin"
23     "x86_64-unknown-linux-gnu"
24     "x86_64-unknown-linux-musl"
25     # we can uncomment that once our bootstrap tarballs are fixed
26     #"x86_64-unknown-freebsd"
27   ]
28   # Strip most of attributes when evaluating to spare memory usage
29 , scrubJobs ? true
30   # Attributes passed to nixpkgs. Don't build packages marked as unfree.
31 , nixpkgsArgs ? { config = {
32     allowUnfree = false;
33     inHydra = true;
34     # Exceptional unsafe packages that we still build and distribute,
35     # so users choosing to allow don't have to rebuild them every time.
36     permittedInsecurePackages = [
37       "olm-3.2.16" # see PR #347899
38     ];
39   }; }
41   # This flag, if set to true, will inhibit the use of `mapTestOn`
42   # and `release-lib.packagePlatforms`.  Generally, it causes the
43   # resulting tree of attributes to *not* have a ".${system}"
44   # suffixed upon every job name like Hydra expects.
45   #
46   # This flag exists mainly for use by
47   # pkgs/top-level/release-attrnames-superset.nix; see that file for
48   # full details.  The exact behavior of this flag may change; it
49   # should be considered an internal implementation detail of
50   # pkgs/top-level/.
51   #
52 , attrNamesOnly ? false
55 let
56   release-lib = import ./release-lib.nix {
57     inherit supportedSystems scrubJobs nixpkgsArgs system;
58   };
60   inherit (release-lib) mapTestOn pkgs;
62   inherit (release-lib.lib)
63     collect
64     elem
65     genAttrs
66     hasInfix
67     hasSuffix
68     id
69     isDerivation
70     optionals
71     ;
73   inherit (release-lib.lib.attrsets) unionOfDisjoint;
75   supportDarwin = genAttrs [
76     "x86_64"
77     "aarch64"
78   ] (arch: elem "${arch}-darwin" supportedSystems);
80   nonPackageJobs =
81     { tarball = import ./make-tarball.nix { inherit pkgs nixpkgs officialRelease; };
83       release-checks = import ./nixpkgs-basic-release-checks.nix { inherit pkgs nixpkgs supportedSystems; };
85       manual = pkgs.nixpkgs-manual.override { inherit nixpkgs; };
86       metrics = import ./metrics.nix { inherit pkgs nixpkgs; };
87       lib-tests = import ../../lib/tests/release.nix { inherit pkgs; };
88       pkgs-lib-tests = import ../pkgs-lib/tests { inherit pkgs; };
90       darwin-tested = if supportDarwin.x86_64 then pkgs.releaseTools.aggregate
91         { name = "nixpkgs-darwin-${jobs.tarball.version}";
92           meta.description = "Release-critical builds for the Nixpkgs darwin channel";
93           constituents =
94             [ jobs.tarball
95               jobs.release-checks
96               jobs.cabal2nix.x86_64-darwin
97               jobs.ghc.x86_64-darwin
98               jobs.git.x86_64-darwin
99               jobs.go.x86_64-darwin
100               jobs.mariadb.x86_64-darwin
101               jobs.nix.x86_64-darwin
102               jobs.nixpkgs-review.x86_64-darwin
103               jobs.nix-info.x86_64-darwin
104               jobs.nix-info-tested.x86_64-darwin
105               jobs.openssh.x86_64-darwin
106               jobs.openssl.x86_64-darwin
107               jobs.pandoc.x86_64-darwin
108               jobs.postgresql.x86_64-darwin
109               jobs.python3.x86_64-darwin
110               jobs.ruby.x86_64-darwin
111               jobs.rustc.x86_64-darwin
112               # blocking ofBorg CI 2020-02-28
113               # jobs.stack.x86_64-darwin
114               jobs.stdenv.x86_64-darwin
115               jobs.vim.x86_64-darwin
116               jobs.cachix.x86_64-darwin
117               jobs.darwin.linux-builder.x86_64-darwin
119               # UI apps
120               # jobs.firefox-unwrapped.x86_64-darwin
121               jobs.qt5.qtmultimedia.x86_64-darwin
122               jobs.inkscape.x86_64-darwin
123               jobs.gimp.x86_64-darwin
124               jobs.emacs.x86_64-darwin
125               jobs.wireshark.x86_64-darwin
126               jobs.transmission_3-gtk.x86_64-darwin
127               jobs.transmission_4-gtk.x86_64-darwin
129               # Tests
130               /*
131               jobs.tests.cc-wrapper.default.x86_64-darwin
132               jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-darwin
133               jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-darwin
134               jobs.tests.stdenv-inputs.x86_64-darwin
135               jobs.tests.macOSSierraShared.x86_64-darwin
136               jobs.tests.stdenv.hooks.patch-shebangs.x86_64-darwin
137               */
138             ];
139         } else null;
141       unstable = pkgs.releaseTools.aggregate
142         { name = "nixpkgs-${jobs.tarball.version}";
143           meta.description = "Release-critical builds for the Nixpkgs unstable channel";
144           constituents =
145             [ jobs.tarball
146               jobs.release-checks
147               jobs.metrics
148               jobs.manual
149               jobs.lib-tests
150               jobs.pkgs-lib-tests
151               jobs.stdenv.x86_64-linux
152               jobs.cargo.x86_64-linux
153               jobs.go.x86_64-linux
154               jobs.linux.x86_64-linux
155               jobs.nix.x86_64-linux
156               jobs.pandoc.x86_64-linux
157               jobs.python3.x86_64-linux
158               # Needed by contributors to test PRs (by inclusion of the PR template)
159               jobs.nixpkgs-review.x86_64-linux
160               # Needed for support
161               jobs.nix-info.x86_64-linux
162               jobs.nix-info-tested.x86_64-linux
163               # Ensure that X11/GTK are in order.
164               jobs.firefox-unwrapped.x86_64-linux
165               jobs.cachix.x86_64-linux
166               jobs.devenv.x86_64-linux
168               /*
169               TODO: re-add tests; context: https://github.com/NixOS/nixpkgs/commit/36587a587ab191eddd868179d63c82cdd5dee21b
171               jobs.tests.cc-wrapper.default.x86_64-linux
172               jobs.tests.cc-wrapper.gcc7Stdenv.x86_64-linux
173               jobs.tests.cc-wrapper.gcc8Stdenv.x86_64-linux
175               # broken see issue #40038
177               jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-linux
178               jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-linux
179               jobs.tests.cc-multilib-gcc.x86_64-linux
180               jobs.tests.cc-multilib-clang.x86_64-linux
181               jobs.tests.stdenv-inputs.x86_64-linux
182               jobs.tests.stdenv.hooks.patch-shebangs.x86_64-linux
183               */
184             ]
185             ++ collect isDerivation jobs.stdenvBootstrapTools
186             ++ optionals supportDarwin.x86_64 [
187               jobs.stdenv.x86_64-darwin
188               jobs.cargo.x86_64-darwin
189               jobs.cachix.x86_64-darwin
190               jobs.devenv.x86_64-darwin
191               jobs.go.x86_64-darwin
192               jobs.python3.x86_64-darwin
193               jobs.nixpkgs-review.x86_64-darwin
194               jobs.nix.x86_64-darwin
195               jobs.nix-info.x86_64-darwin
196               jobs.nix-info-tested.x86_64-darwin
197               jobs.git.x86_64-darwin
198               jobs.mariadb.x86_64-darwin
199               jobs.vim.x86_64-darwin
200               jobs.inkscape.x86_64-darwin
201               jobs.qt5.qtmultimedia.x86_64-darwin
202               jobs.darwin.linux-builder.x86_64-darwin
203               /*
204               jobs.tests.cc-wrapper.default.x86_64-darwin
205               jobs.tests.cc-wrapper.gcc7Stdenv.x86_64-darwin
206               jobs.tests.cc-wrapper.gcc8Stdenv.x86_64-darwin
207               jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-darwin
208               jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-darwin
209               jobs.tests.stdenv-inputs.x86_64-darwin
210               jobs.tests.macOSSierraShared.x86_64-darwin
211               jobs.tests.stdenv.hooks.patch-shebangs.x86_64-darwin
212               */
213             ]
214             ++ optionals supportDarwin.aarch64 [
215               jobs.stdenv.aarch64-darwin
216               jobs.cargo.aarch64-darwin
217               jobs.cachix.aarch64-darwin
218               jobs.devenv.aarch64-darwin
219               jobs.go.aarch64-darwin
220               jobs.python3.aarch64-darwin
221               jobs.nixpkgs-review.aarch64-darwin
222               jobs.nix.aarch64-darwin
223               jobs.nix-info.aarch64-darwin
224               jobs.nix-info-tested.aarch64-darwin
225               jobs.git.aarch64-darwin
226               jobs.mariadb.aarch64-darwin
227               jobs.vim.aarch64-darwin
228               jobs.inkscape.aarch64-darwin
229               jobs.qt5.qtmultimedia.aarch64-darwin
230               jobs.darwin.linux-builder.aarch64-darwin
231               /* consider adding tests, as suggested above for x86_64-darwin */
232             ];
233         };
235       stdenvBootstrapTools = genAttrs bootstrapConfigs (config:
236           if hasInfix "-linux-" config then
237             let
238               bootstrap = import ../stdenv/linux/make-bootstrap-tools.nix {
239                 pkgs = import ../.. {
240                   localSystem = { inherit config; };
241                 };
242               };
243             in {
244               inherit (bootstrap) build test;
245             }
246           else if hasSuffix "-darwin" config then
247             let
248               bootstrap = import ../stdenv/darwin/make-bootstrap-tools.nix {
249                 localSystem = { inherit config; };
250               };
251             in {
252               # Lightweight distribution and test
253               inherit (bootstrap) build test;
254               # Test a full stdenv bootstrap from the bootstrap tools definition
255               # TODO: Re-enable once the new bootstrap-tools are in place.
256               #inherit (bootstrap.test-pkgs) stdenv;
257             }
258           else if hasSuffix "-freebsd" config then
259             let
260               bootstrap = import ../stdenv/freebsd/make-bootstrap-tools.nix {
261                 pkgs = import ../.. {
262                   localSystem = { inherit config; };
263                 };
264               };
265             in {
266               inherit (bootstrap) build;  # test does't exist yet
267             }
268           else
269             abort "No bootstrap implementation for system: ${config}"
270         );
271     };
273   # Do not allow attribute collision between jobs inserted in
274   # 'nonPackageAttrs' and jobs pulled in from 'pkgs'.
275   # Conflicts usually cause silent job drops like in
276   #   https://github.com/NixOS/nixpkgs/pull/182058
277   jobs = let
278     packagePlatforms = if attrNamesOnly then id else release-lib.packagePlatforms;
279     packageJobs = {
280       haskell.compiler = packagePlatforms pkgs.haskell.compiler;
281       haskellPackages = packagePlatforms pkgs.haskellPackages;
282       # Build selected packages (HLS) for multiple Haskell compilers to rebuild
283       # the cache after a staging merge
284       haskell.packages = genAttrs [
285         # TODO: share this list between release.nix and release-haskell.nix
286         "ghc90"
287         "ghc92"
288         "ghc94"
289         "ghc96"
290         "ghc98"
291       ] (compilerName: {
292         inherit (packagePlatforms pkgs.haskell.packages.${compilerName})
293           haskell-language-server;
294       });
295       idrisPackages = packagePlatforms pkgs.idrisPackages;
296       agdaPackages = packagePlatforms pkgs.agdaPackages;
298       pkgsLLVM.stdenv = [ "x86_64-linux" "aarch64-linux" ];
299       pkgsArocc.stdenv = [ "x86_64-linux" "aarch64-linux" ];
300       pkgsZig.stdenv = [ "x86_64-linux" "aarch64-linux" ];
301       pkgsMusl.stdenv = [ "x86_64-linux" "aarch64-linux" ];
302       pkgsStatic.stdenv = [ "x86_64-linux" "aarch64-linux" ];
304       tests = packagePlatforms pkgs.tests;
306       # Language packages disabled in https://github.com/NixOS/nixpkgs/commit/ccd1029f58a3bb9eca32d81bf3f33cb4be25cc66
308       #emacsPackages = packagePlatforms pkgs.emacsPackages;
309       #rPackages = packagePlatforms pkgs.rPackages;
310       ocamlPackages = { };
311       perlPackages = { };
313       darwin = packagePlatforms pkgs.darwin // {
314         xcode = {};
315       };
316     };
317     mapTestOn-packages =
318       if attrNamesOnly
319       then pkgs // packageJobs
320       else mapTestOn ((packagePlatforms pkgs) // packageJobs);
321   in
322     unionOfDisjoint nonPackageJobs mapTestOn-packages;
324 in jobs