treewide/pkgs: remove with lib;, part 2#335232
Conversation
ce4fc55 to
b63e155
Compare
|
https://gist.github.com/GrahamcOfBorg/1eab084267c1f1130592f05cc6e94380 huh I'll take a look tomorrow at these and figure out why the rebuild. |
There was a problem hiding this comment.
This change causes a rebuild because it pulls in everything in the directory.
I think for an updater script, that's fine, if bad manners.
pkgs/pkgs-lib/formats.nix
Outdated
There was a problem hiding this comment.
nixpkgs/nixos/modules/misc/documentation.nix
Lines 102 to 103 in 6fe849b
This change causes a rebuild because lazy-options.json uses pkgs.path and thereby takes a reference on pkgs/pkgs-lib and nixos -- so any changes in those directories will cause a rebuild.
The actual output is identical.
There was a problem hiding this comment.
seems totally fine to me
emilazy
left a comment
There was a problem hiding this comment.
I feel satisfied with the explanation for the rebuilds and like the change. The merge conflicts are probably going to be annoying. I suspect that some will prefer let inherit (lib) …; to the changes here, but it seems okay for those people to bikeshed that in their own packages later.
b63e155 to
086aa4f
Compare
|
Thank you all! |
| cudaPackages.cuda_cudart | ||
| cudaPackages.cuda_cccl # <thrust/*> | ||
| cudaPackages.libnpp # npp.h | ||
| cudaPackages.nvidia-optical-flow-sdk |
There was a problem hiding this comment.
@philiptaron nvidia-optical-flow-sdk is not contained in cudaPackages, this breaks opencv builds with cuda enabled.
There was a problem hiding this comment.
Yes, I messed this up. Fixed in #335880.
There was a problem hiding this comment.
A good example of the pitfalls of with!
| inherit (lib) mkOptionType; | ||
| inherit (lib.types) nullOr oneOf coercedTo listOf nonEmptyListOf attrsOf either; | ||
| inherit (lib.types) bool int float str path; |
There was a problem hiding this comment.
@philiptaron was it intentional that these are inherited into the public/final pkgs.formats attrset?
I assume these should've been inherited into a let in block instead of directly into the rec { attrset.
There was a problem hiding this comment.
They should have been in a let / in block. Will gladly merge that fix PR.
Introduced in NixOS#335232 (commit 1f6ce17)
Motivation for change
with lib;#208242Description of changes
Follow-on to this PR:
meta = with lib;was only mutated if it contained non-regular statements, like if statements or//or the like.I validated this change by comparing the
outPathof all derivations that evaluated on master vs. the ones on this branch.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)