2023-11-22 06:55:15 +00:00
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
# When using as a callable script, passing `--argstr path some/path` overrides $PWD.
|
2023-11-26 23:51:08 +00:00
|
|
|
#!nix-shell -p nix -i "nix-env -qaP --no-name --out-path --arg checkMeta true -f pkgs/top-level/release-outpaths.nix"
|
2023-11-22 06:55:15 +00:00
|
|
|
|
|
|
|
# Vendored from:
|
|
|
|
# https://raw.githubusercontent.com/NixOS/ofborg/74f38efa7ef6f0e8e71ec3bfc675ae4fb57d7491/ofborg/src/outpaths.nix
|
|
|
|
{ checkMeta
|
2023-11-26 23:51:52 +00:00
|
|
|
, includeBroken ? true # set this to false to exclude meta.broken packages from the output
|
2023-11-23 06:26:53 +00:00
|
|
|
, path ? ./../..
|
2023-11-23 01:10:24 +00:00
|
|
|
|
|
|
|
# used by pkgs/top-level/release-attrnames-superset.nix
|
|
|
|
, attrNamesOnly ? false
|
2023-11-27 01:27:31 +00:00
|
|
|
|
|
|
|
# Set this to `null` to build for builtins.currentSystem only
|
|
|
|
, systems ? [
|
|
|
|
"aarch64-linux"
|
|
|
|
"aarch64-darwin"
|
|
|
|
#"i686-linux" # !!!
|
|
|
|
"x86_64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
]
|
2023-11-22 06:55:15 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
lib = import (path + "/lib");
|
|
|
|
hydraJobs = import (path + "/pkgs/top-level/release.nix")
|
|
|
|
# Compromise: accuracy vs. resources needed for evaluation.
|
|
|
|
{
|
2023-11-23 01:10:24 +00:00
|
|
|
inherit attrNamesOnly;
|
2023-11-27 01:27:31 +00:00
|
|
|
supportedSystems =
|
|
|
|
if systems == null
|
|
|
|
then [ builtins.currentSystem ]
|
|
|
|
else systems;
|
2023-11-22 06:55:15 +00:00
|
|
|
nixpkgsArgs = {
|
|
|
|
config = {
|
|
|
|
allowAliases = false;
|
2023-11-26 23:51:52 +00:00
|
|
|
allowBroken = includeBroken;
|
2023-12-01 21:25:41 +00:00
|
|
|
allowUnfree = false;
|
2023-11-22 06:55:15 +00:00
|
|
|
allowInsecurePredicate = x: true;
|
|
|
|
checkMeta = checkMeta;
|
|
|
|
|
|
|
|
handleEvalIssue = reason: errormsg:
|
|
|
|
let
|
|
|
|
fatalErrors = [
|
|
|
|
"unknown-meta"
|
|
|
|
"broken-outputs"
|
|
|
|
];
|
|
|
|
in
|
|
|
|
if builtins.elem reason fatalErrors
|
|
|
|
then abort errormsg
|
2023-12-01 21:25:41 +00:00
|
|
|
# hydra does not build unfree packages, so tons of them are broken yet not marked meta.broken.
|
|
|
|
else if !includeBroken && builtins.elem reason [ "broken" "unfree" ]
|
2023-11-26 23:51:52 +00:00
|
|
|
then throw "broken"
|
2023-12-04 01:59:48 +00:00
|
|
|
else if builtins.elem reason [ "unsupported" ]
|
|
|
|
then throw "unsupported"
|
2023-11-22 06:55:15 +00:00
|
|
|
else true;
|
|
|
|
|
|
|
|
inHydra = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
recurseIntoAttrs = attrs: attrs // { recurseForDerivations = true; };
|
|
|
|
|
|
|
|
# hydraJobs leaves recurseForDerivations as empty attrmaps;
|
|
|
|
# that would break nix-env and we also need to recurse everywhere.
|
|
|
|
tweak = lib.mapAttrs
|
|
|
|
(name: val:
|
|
|
|
if name == "recurseForDerivations" then true
|
|
|
|
else if lib.isAttrs val && val.type or null != "derivation"
|
|
|
|
then recurseIntoAttrs (tweak val)
|
|
|
|
else val
|
|
|
|
);
|
|
|
|
|
|
|
|
# Some of these contain explicit references to platform(s) we want to avoid;
|
|
|
|
# some even (transitively) depend on ~/.nixpkgs/config.nix (!)
|
|
|
|
blacklist = [
|
|
|
|
"tarball"
|
|
|
|
"metrics"
|
|
|
|
"manual"
|
|
|
|
"darwin-tested"
|
|
|
|
"unstable"
|
|
|
|
"stdenvBootstrapTools"
|
|
|
|
"moduleSystem"
|
|
|
|
"lib-tests" # these just confuse the output
|
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
tweak (builtins.removeAttrs hydraJobs blacklist)
|