nixpkgs/pkgs/top-level
Adam Joseph eda44b7415 pkgs/top-level/release-attrpaths-superset.nix: init
This file walks the entire nixpkgs tree and emits a superset of all
release attrnames in only 44 seconds on a 3ghz CPU, using 5 gbytes
of memory.  By comparison, on the same CPU the `nix-env` hack used
by ofborg on every PR submission requires 41 *minutes* and peaks at
60 gbytes, even with checkMeta turned off.  Full details below.

This is:

- 46x faster (or 2.1% of the elapsed time)
- 12.5x less memory (or 8.0% of the peak memory usage)

In order to replace the ofborg check, this list of attrnames must
then be post-filtered for platform-relevance.  However, crucially,
the post-filtering can be done *in parallel* on multiple cores by
splitting the attrname list in to chunks.  Generating the list of
attrnames cannot be parallelized because it is a single-threaded
cppnix task.

This PR also adds `recurseForDerivations` where necessary within
nixpkgs in order to make this possible -- it screens out various
non-tryEval-catchable failures and infinite recursions.  Before
undraftifying, I will add an invocation of this command to the CI
tests, to ensure that the work performed here is not immediately
undone.  My next PR will then add an additional CI check confirming
that the emitted attrpaths are in fact a superset of the release
attrpaths calculated by the slow-memory-hog ofborg method.

I have manually confirmed that this is the case at the tip commit of
this PR, but we need CI to make sure this remains true until ofborg
switches to this more-efficient method of calculation; at that point
the superset-check can be dropped.

According to GNU Time,

        Command being timed: "nix-instantiate --eval --strict --json pkgs/top-level/release-attrpaths-superset.nix -A names"
        User time (seconds): 44.88
        System time (seconds): 8.09
        Percent of CPU this job got: 99%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:53.20
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 4823028
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 3611240
        Voluntary context switches: 113
        Involuntary context switches: 949
        Swaps: 0
        File system inputs: 1480
        File system outputs: 5944
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0

Compared to release-outpaths.nix:

        Command being timed: "nix-env -qaP --no-name --out-path --arg checkMeta false --argstr path /git/work/pr/release-outpaths -f pkgs/top-level/release-outpaths.nix"
        User time (seconds): 2120.67
        System time (seconds): 337.80
        Percent of CPU this job got: 98%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 41:37.91
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 60171768
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 2
        Minor (reclaiming a frame) page faults: 230608113
        Voluntary context switches: 8876
        Involuntary context switches: 22275
        Swaps: 0
        File system inputs: 62624
        File system outputs: 72
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0
2023-12-15 05:13:50 -08:00
..
pkg-config treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
agda-packages.nix
aliases.nix Merge pull request #271569 from kirillrdy/hipchat 2023-12-13 09:50:21 -08:00
all-packages.nix treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
beam-packages.nix treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
by-name-overlay.nix tests.nixpkgs-check-by-name: auto-calling differentiation 2023-10-12 02:27:55 +02:00
config.nix config.rocmSupport: init option 2023-11-14 01:50:59 +01:00
coq-packages.nix treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
cubocore-packages.nix
cuda-packages.nix treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
darwin-packages.nix darwin.stdenv: use CoreFoundation instead of CF 2023-11-02 21:20:55 -04:00
default.nix pkgs/top-level: use lib.systems.equals for crossSystem 2023-09-13 07:22:52 +03:00
dhall-packages.nix
dotnet-packages.nix nuget: move out of dotnet-packages and the dotnetPackages namespaces 2023-09-25 19:37:17 +02:00
emacs-packages.nix emacs: allow using as shebang on darwin 2023-09-24 19:50:52 -03:00
emscripten-packages.nix
gnuradio-packages.nix gnuradioPackages: Don't inherit python and gnuradio 2023-10-04 13:07:09 +03:00
hare-third-party.nix hareThirdParty.hare-compress: init at unstable-2023-11-01 2023-12-13 18:21:15 +07:00
haskell-packages.nix haskell.compiler.ghc865Binary: don't pass llvmPackages_6 2023-12-04 19:43:07 +01:00
haxe-packages.nix
impure.nix
java-packages.nix treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
kodi-packages.nix Merge pull request #264179 from mguentner/add_kodi_somafm 2023-10-29 11:27:55 -04:00
linux-kernels.nix treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
lua-packages.nix luaPackages: use overrides for toml and toml-edit 2023-10-13 15:06:28 +02:00
make-tarball.nix
metrics.nix
nim-overrides.nix nimOverrides: warn on bad version of hashlib 2023-12-10 09:26:02 +00:00
nixpkgs-basic-release-checks.nix
ocaml-packages.nix ocamlPackages.gluten-eio: init at 0.5.0 2023-12-04 07:28:12 +01:00
octave-packages.nix
packages-config.nix pkgs/top-level/packages-config.nix: remove sconsPackages 2023-11-03 15:00:48 -03:00
perl-packages.nix treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
php-packages.nix Merge pull request #273378 from shyim/frankenphp-extension-support 2023-12-11 10:19:58 +01:00
python2-packages.nix
python-aliases.nix Merge pull request #272576 from NixOS/home-assistant 2023-12-10 14:51:43 +01:00
python-packages.nix Merge pull request #274193 from fabaff/dep-scan 2023-12-15 11:44:19 +01:00
qt5-packages.nix treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
qt6-packages.nix Merge pull request #260886 from OPNA2608/init/lomiri/qzxing 2023-12-02 12:04:56 +01:00
release-alternatives.nix
release-attrpaths-superset.nix pkgs/top-level/release-attrpaths-superset.nix: init 2023-12-15 05:13:50 -08:00
release-cross.nix
release-cuda.nix
release-haskell.nix haskell.compiler.ghc884: remove at 8.8.4 2023-12-04 19:42:44 +01:00
release-lib.nix
release-outpaths.nix pkgs/top-level/release-outpaths.nix: never attempt to build unfree packages, most of them are broken 2023-12-15 04:21:33 -08:00
release-python.nix treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
release-r.nix
release-small.nix pdf2xml: drop 2023-10-23 00:07:53 -03:00
release.nix pkgs/top-level/release.nix: add attrNamesOnly option 2023-12-15 04:21:32 -08:00
ruby-packages.nix rubyPackages: update 2023-11-30 04:20:00 +00:00
splice.nix
stage.nix shellcheck-minimal: init 2023-11-01 06:23:04 +08:00
unixtools.nix
wine-packages.nix