Skip to content

WIP: Refactor fixpoints and overriding in all-packages#11110

Closed
Ericson2314 wants to merge 4 commits intoNixOS:masterfrom
Ericson2314:override
Closed

WIP: Refactor fixpoints and overriding in all-packages#11110
Ericson2314 wants to merge 4 commits intoNixOS:masterfrom
Ericson2314:override

Conversation

@Ericson2314
Copy link
Member

Whatever was there before I found...confusing. I'm not sure this is better, but at least I find it much clearer: pkgsFun no longer ties any knots, overridePackages on 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:

  • This brings overridePackages more in line with our other functions following the self: super: ... pattern. Super is now only shallowly un-overridden, by which I mean this:
let super = defaults self; self = super // overrides self super; in self

vs

let super = defaults super; self = super // overrides self super; in self
  • self bound in pkgFun and with'd, and pkgs bound in the outermost let and returned, were not obviously the same thing, yet used seemingly interchangeably in the body of pkgFun. self has been renamed to pkgs to shadow the other, and remove this potential source of inconsistency.
  • applyGlobalOverrides and overridePackages were 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.nix just contain pkgFun (anonymous, of course), and move the rest to a new top-level/default.nix

I highly recommend going looking at the diff commit by commit first.

CC @lethalman this is an outgrowth of the concerns I voiced on IRC.

`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.
@nbp
Copy link
Member

nbp commented Nov 18, 2015

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.

@nbp nbp added 0.kind: enhancement Add something new or improve an existing system. work-in-progress labels Nov 18, 2015
@Ericson2314
Copy link
Member Author

Oh, cool!

@Ericson2314 Ericson2314 deleted the override branch March 27, 2016 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: enhancement Add something new or improve an existing system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants