rustls-ffi: 0.13.0 -> 0.14.1 (#352584)
[NixPkgs.git] / pkgs / top-level / release-outpaths.nix
blobfd54609efa51b956af5bf42521256df7d56a84df
1 #!/usr/bin/env nix-shell
2 # When using as a callable script, passing `--argstr path some/path` overrides $PWD.
3 #!nix-shell -p nix -i "nix-env -qaP --no-name --out-path --arg checkMeta true -f pkgs/top-level/release-outpaths.nix"
5 # Vendored from:
6 #   https://raw.githubusercontent.com/NixOS/ofborg/74f38efa7ef6f0e8e71ec3bfc675ae4fb57d7491/ofborg/src/outpaths.nix
7 { checkMeta
8 , includeBroken ? true  # set this to false to exclude meta.broken packages from the output
9 , path ? ./../..
11 # used by pkgs/top-level/release-attrnames-superset.nix
12 , attrNamesOnly ? false
14 # Set this to `null` to build for builtins.currentSystem only
15 , systems ? import ../../ci/supportedSystems.nix
17 let
18   lib = import (path + "/lib");
19   hydraJobs = import (path + "/pkgs/top-level/release.nix")
20     # Compromise: accuracy vs. resources needed for evaluation.
21     {
22       inherit attrNamesOnly;
23       supportedSystems =
24         if systems == null
25         then [ builtins.currentSystem ]
26         else systems;
27       nixpkgsArgs = {
28         config = {
29           allowAliases = false;
30           allowBroken = includeBroken;
31           allowUnfree = false;
32           allowInsecurePredicate = x: true;
33           checkMeta = checkMeta;
35           handleEvalIssue = reason: errormsg:
36             let
37               fatalErrors = [
38                 "unknown-meta"
39                 "broken-outputs"
40               ];
41             in
42             if builtins.elem reason fatalErrors
43             then abort errormsg
44             # hydra does not build unfree packages, so tons of them are broken yet not marked meta.broken.
45             else if !includeBroken && builtins.elem reason [ "broken" "unfree" ]
46             then throw "broken"
47             else if builtins.elem reason [ "unsupported" ]
48             then throw "unsupported"
49             else true;
51           inHydra = true;
52         };
53       };
54     };
55   recurseIntoAttrs = attrs: attrs // { recurseForDerivations = true; };
57   # hydraJobs leaves recurseForDerivations as empty attrmaps;
58   # that would break nix-env and we also need to recurse everywhere.
59   tweak = lib.mapAttrs
60     (name: val:
61       if name == "recurseForDerivations" then true
62       else if lib.isAttrs val && val.type or null != "derivation"
63       then recurseIntoAttrs (tweak val)
64       else val
65     );
67   # Some of these contain explicit references to platform(s) we want to avoid;
68   # some even (transitively) depend on ~/.nixpkgs/config.nix (!)
69   blacklist = [
70     "tarball"
71     "metrics"
72     "manual"
73     "darwin-tested"
74     "unstable"
75     "stdenvBootstrapTools"
76     "moduleSystem"
77     "lib-tests" # these just confuse the output
78   ];
81 tweak (builtins.removeAttrs hydraJobs blacklist)