ci/eval/compare: don't treat renames as rebuilds#431448
ci/eval/compare: don't treat renames as rebuilds#431448wolfgangwalther merged 1 commit intoNixOS:masterfrom
Conversation
28783b9 to
07015f8
Compare
47bdb4a to
24efeab
Compare
24efeab to
7f22594
Compare
When a package's attrpath is renamed it is currently treated as a rebuild, even though the outpath already exists and is already cached. This also happens when adding new names for packagesets that already exist, for example when starting to eval `perlPackages` in CI, which is just the same as `perl540Packages` currently. It would also happen when `perlPackages` is switched from `perl540Packages` to `perl999Packages`. Assuming that `perl999Packages` had already been built before, this doesn't really cause any rebuilds.
7f22594 to
c5c7cd5
Compare
philiptaron
left a comment
There was a problem hiding this comment.
I suspect there's a load of performance work we could do here, but it likely doesn't matter.
| old: new: | ||
| let | ||
| filterKeys = cond: attrs: lib.attrNames (lib.filterAttrs cond attrs); | ||
| oldOutputs = lib.pipe old [ |
There was a problem hiding this comment.
This can be computed without respect to the new and hence can be in a let block before the new.
let
filterKeys = ...;
in
old:
let
oldOutputs = ...;
in
new:There was a problem hiding this comment.
filterKeys was before the arguments before. Does any of this make a difference if this diff function is only ever called exactly once?
There was a problem hiding this comment.
Since filterKeys is a function itself, I suspect it doesn't matter.
| (lib.mapAttrsToList (_: lib.attrValues)) | ||
| lib.concatLists | ||
| (lib.flip lib.genAttrs (_: true)) |
There was a problem hiding this comment.
My mind tells me there's an opportunity to use builtins.intersectAttrs here to good effect, but I'm too lazy to do the work needed to productionize it.
It also tells me that there's something in builtins.hasAttr that might be of use below but I'm not sure what exactly.
|
Successfully created backport PR for |
When a package's attrpath is renamed it is currently treated as a rebuild, even though the outpath already exists and is already cached.
This also happens when adding new names for packagesets that already exist, for example when starting to eval
perlPackagesin CI, which is just the same asperl540Packagescurrently. It would also happen whenperlPackagesis switched fromperl540Packagestoperl999Packages. Assuming thatperl999Packageshad already been built before, this doesn't really cause any rebuilds.Things done
perlPackages = {}inrelease.nix, should result in no rebuilds (only works in my fork, because the comparison changes need to be on the target branch already)Add a 👍 reaction to pull requests you find important.