You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While looking in nixpkgs, I noticed that we use 2 different fix-point strategy, and the difference between the 2 is not clear. #10307 highlight that there is a problem with self and pkgs are almost interchangeable but it is not clear why replacing one by the other does not work.
The problem is more than likely coming from the stdenv overrides added by the mkOverrides function. The way this function is written would cause infinite loops if we were to use pkgs instead of pkgsOrig because the name of the properties are not known ahead.
The problem here is not much about having 2 self-reference fix-points, but mostly about the fact that the first stage (pkgsOrig = pkgsFun pkgs {};) does not have a proper meaning for the 2 self-references. In the first stage, pkgs is the overloaded set of packages, while self is the non overloaded set of packages.
These 2 self-references are extremely confusing since self and pkgs are used interchangeably to lookup dependencies within all-packages.nix, either by relying on with self; or on callPackage (pkgs).
I will recommend that we convert one to the other and make them explicit within all-packages.nix, such that we can give a clear meaning to the first stage (pkgsOrig) which is used to compute the stdenv.
While looking in nixpkgs, I noticed that we use 2 different fix-point strategy, and the difference between the 2 is not clear. #10307 highlight that there is a problem with
self
andpkgs
are almost interchangeable but it is not clear why replacing one by the other does not work.The problem is more than likely coming from the stdenv overrides added by the
mkOverrides
function. The way this function is written would cause infinite loops if we were to usepkgs
instead ofpkgsOrig
because the name of the properties are not known ahead.The problem here is not much about having 2 self-reference fix-points, but mostly about the fact that the first stage (
pkgsOrig = pkgsFun pkgs {};
) does not have a proper meaning for the 2 self-references. In the first stage,pkgs
is the overloaded set of packages, whileself
is the non overloaded set of packages.These 2 self-references are extremely confusing since
self
andpkgs
are used interchangeably to lookup dependencies withinall-packages.nix
, either by relying onwith self;
or oncallPackage
(pkgs
).I will recommend that we convert one to the other and make them explicit within
all-packages.nix
, such that we can give a clear meaning to the first stage (pkgsOrig
) which is used to compute thestdenv
.cc @edolstra
The text was updated successfully, but these errors were encountered: