WIP: Refactor fixpoints and overriding in all-packages#11110
Closed
Ericson2314 wants to merge 4 commits intoNixOS:masterfrom
Closed
WIP: Refactor fixpoints and overriding in all-packages#11110Ericson2314 wants to merge 4 commits intoNixOS:masterfrom
Ericson2314 wants to merge 4 commits intoNixOS:masterfrom
Conversation
`pkgFun` just takes one pkg argument, completing the task of moving all fix-point complexity outside it. applyGlobalOverrides uses pkg set which isn't affected by package overrides for stdenv purposes. Probably this could be cleaner still.
Also support "chained" usage
Member
|
I am sorry to say so, but there is already a work-in-progress on these files which goes a bit further, see #10851 which is based on #9400 from @Mathnerd314 . I suggest you close this pull request, and help by reviewing the work done in #10851. |
Member
Author
|
Oh, cool! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Whatever was there before I found...confusing. I'm not sure this is better, but at least I find it much clearer:
pkgsFunno longer ties any knots,overridePackageson the other hand does all the knot tying, even if the user doesn't use have any overrides.Potential highlights, if I understand things correctly:
overridePackagesmore in line with our other functions following theself: super: ...pattern.Superis now only shallowly un-overridden, by which I mean this:vs
selfbound inpkgFunandwith'd, andpkgsbound in the outermost let and returned, were not obviously the same thing, yet used seemingly interchangeably in the body ofpkgFun.selfhas been renamed topkgsto shadow the other, and remove this potential source of inconsistency.applyGlobalOverridesandoverridePackageswere awkwardly similar, but the former is now removed.My biggest concern is I accidentally introduced a new level of stdenv bootstrapping, if pkg overrides effect the stdenv. But if so, I am confused why this wasn't already necessary and suspect it only appeared that way due to bugs in the old code.
If this is accepted, I propose trying to make
all-packages.nixjust containpkgFun(anonymous, of course), and move the rest to a newtop-level/default.nixI highly recommend going looking at the diff commit by commit first.
CC @lethalman this is an outgrowth of the concerns I voiced on IRC.