lib.customisation.makeScope: Make overrideScope consistent with makeScopeWithSplicing

Right now converting `makeScope` to `makeScopeWithSplicing` is not
transparent to users and requires adding a warning for `overrideScope'`
in the set itself.

Warning and `overrideScope'` were added in 2018 b9dce11712 and there should be no users left after 5 years.
This commit is contained in:
Artturin 2023-08-14 01:42:25 +03:00
parent af9458db2d
commit 3c1f82f99e

View File

@ -269,10 +269,11 @@ rec {
let self = f self // {
newScope = scope: newScope (self // scope);
callPackage = self.newScope {};
overrideScope = g: lib.warn
"`overrideScope` (from `lib.makeScope`) is deprecated. Do `overrideScope' (self: super: { })` instead of `overrideScope (super: self: { })`. All other overrides have the parameters in that order, including other definitions of `overrideScope`. This was the only definition violating the pattern."
(makeScope newScope (lib.fixedPoints.extends (lib.flip g) f));
overrideScope' = g: makeScope newScope (lib.fixedPoints.extends g f);
overrideScope = g: makeScope newScope (lib.fixedPoints.extends g f);
# Remove after 24.11 is released.
overrideScope' = g: lib.warnIf (lib.isInOldestRelease 2311)
"`overrideScope'` (from `lib.makeScope`) has been renamed to `overrideScope`."
(makeScope newScope (lib.fixedPoints.extends g f));
packages = f;
};
in self;