eval/nixpkgs: make no-aliases checks use deeper eval#643
eval/nixpkgs: make no-aliases checks use deeper eval#643lilyinstarlight wants to merge 1 commit intoNixOS:releasedfrom
Conversation
|
I think this needs checking that increased RAM usage can be handled by what's currently running it. |
|
We had two of those today alone. NixOS/nixpkgs#236833 We have to check this, even if the costs are steep. |
|
Thanks for looking into this! I really don't like the idea of blowing up eval time (and likely memory usage)... Although I'm sure the beastly machines we have can handle the increased memory usage, the eval time increase has the potential to make the queue a lot more unmanageable than it currently is... I wonder if we could resurrect #594 and instead add an eval that specifically checks that I'll do some pondering when I have a free moment, but it's likely we'll just have to eat the eval-time cost until we ban aliases in Nixpkgs 😅 |
That should work! And is probably a much better idea since it would reduce eval time and fix issues like aliases showing up in calculated attr changes. I don't know that I'll have time to shift this PR to doing that for a few weeks, though |
|
IMO we should probably leave this PR as is in case globally disabling |
|
Yes, though I believe that disabling aliases in the part that computes rebuild amount should catch enough cases. |
|
I've opened #645 with the suggestion (it turned out to be quite simple). If that PR looks better, I'll close this PR in favor of that one and mark that one ready for review |
|
Closing in favor of #645 |
Right now alias usage is only caught more or less for
callPackageargs, but if an alias is accessed as (for example)buildPackages.pkgconfigin the derivation, then ofborg will show all green for thepackage-list-no-aliasescheck despite the derivation actually failing on systems withallowAliases = falseThis solves the problem by having ofborg eval derivation output paths instead of just a shallow eval package list to ensure there is no alias usage in the derivation (it won't catch things like
passthru.pkg-config = buildPackages.pkgconfigbut that's probably acceptable)I'm open to renaming the check to
package-outputs-no-aliasesto reflect the change in functionalityA few examples of what this would have caught are NixOS/nixpkgs#230188 (review) and NixOS/nixpkgs#236329 (comment), but there are a lot more as it seems to be a recurring issue
The difference in eval timing went from ~8 seconds to ~63 seconds for that check on my laptop and so it is a fairly expensive change, but other than something like #594, I don't know a better way to reliably catch this problem