New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: improve the implementation of the unique function #59369
Conversation
|
Nice! |
The real question about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change LGTM, but as @edolstra says maybe we don't want this function at all… So I'm going to have a look at where it's used.
lib/types.nix
: merging enum types. Could probably be left out, at the cost of making enum type checks more expensive in probably rare cases?pkgs/top-level/python-packages.nix
: inrequiredPythonModules
, which seems to be a rather odd way of computing a closure on python package dependencies. Used transitively in lots of places maybe?pkgs/top-level/lua-packages.nix
: inrequiredLuaModules
which seems to be a copy-paste of the python thing.nixos/modules/tasks/network-interfaces.nix
: for something I don't quite understand (what's the difference between a WLAN interface and a WLAN device?)pkgs/build-support/fetchdocker/default.nix
: getting each layer only once or something? This could probably be moved to build time?pkgs/misc/vim-plugins/vim-utils.nix
: computing the transitive dependency closure of a pluginpkgs/games/factorio/utils.nix
: more transitive dependency closure stuffpkgs/stdenv/generic/make-derivation.nix
: for impure host depspkgs/development/java-modules/build-maven-package.nix
: looks like more transitive dependency closure stuffpkgs/development/beam-modules/build-rebar3.nix
: removing duplicates frompropagatedBuildInputs
nixos/modules/services/networking/firewall.nix
: for normalising lists of ports. In this case it's sorted as well so the uniqueness check could be simplified.nixos/modules/services/x11/gdk-pixbuf.nix
: unique-ing the packages to generate a loader cache for. Could be done with sorting and moved to build time AFAICT.nixos/modules/tasks/filesystems/zfs.nix
: getting the list of pools without duplicates from the list of filesystems. Generates some bash code directly from these. Could maybe be moved to build time, but it's a bit more complicated since these values are used in multiple places.nixos/modules/services/hardware/udev.nix
: removing duplicates for udev packages for making the combined udev rule package. Could probably be moved to build time cheaply.nixos/modules/services/misc/mesos-slave.nix
: could be moved into a build-time or runtime script.pkgs/build-support/rust/build-rust-crate/default.nix
: dependency closure stuffpkgs/servers/sip/freeswitch/default.nix
: buildInputs uniqueness. Not necessary I think?pkgs/applications/video/kodi/plugins.nix
: dependency closure stuffpkgs/tools/networking/envoy/default.nix
: getting multiple relevant outputs of some package but not the same one multiple timespkgs/applications/networking/cluster/terraform/default.nix
: dependency closure stuffpkgs/applications/science/math/sage/sage-with-env.nix
: dependency closure stuff
I may have overlooked one or two cases. I'm also not sure how useful this list is… But hey, at least we have it now :p
@GrahamcOfBorg eval |
Motivation for this change
http://gsc.io/graph.unstable.svg
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)