lib.oldestSupportedReleaseIsAtLeast: rename from bad name#347258
lib.oldestSupportedReleaseIsAtLeast: rename from bad name#347258infinisil merged 2 commits intoNixOS:masterfrom
Conversation
…te after 24.11 It seems impossible to describe this condition more concisely without making it incomprehensible.
| cartesianProductOfSets = warnIf (oldestSupportedReleaseIsAtLeast 2405) | ||
| "lib.cartesianProductOfSets is a deprecated alias of lib.cartesianProduct." cartesianProduct; |
There was a problem hiding this comment.
This is maybe a bit too long, but I think it's a much better description:
| cartesianProductOfSets = warnIf (oldestSupportedReleaseIsAtLeast 2405) | |
| "lib.cartesianProductOfSets is a deprecated alias of lib.cartesianProduct." cartesianProduct; | |
| cartesianProductOfSets = warnIf (allSupportedReleasesSupportAlternativeOriginallyIntroducedIn 2405) | |
| "lib.cartesianProductOfSets is a deprecated alias of lib.cartesianProduct." cartesianProduct; |
Hard to remove parts without distorting the meaning though :/
There was a problem hiding this comment.
The difference is that this description includes the policy, whereas mine only describes the mechanism. I think that's a sensible rule of thumb.
The policy should be documented, certainly, but maybe not in the name of the function.
Also, more high level level functions are possible, such as
foo =
deprecateForAlternativeIn
2405
"use bar instead of foo"
bar;
# or similar to `mkRenamedOptionModule` iirc, though could be misread
foo = deprecate { old = "package foo"; new = "bar"; sinceRelease 2405; } bar;Also, such a function could both warn and throw if we decide a standard time frame for that.
Anyway, before veering too far off topic, I think we could do with a slightly better named low level function first.
It will save a few brain cycles when developing the higher level ones.
There was a problem hiding this comment.
Makes sense and again reminds me of NixOS/rfcs#33 :)
…and deprecate after 24.11
It seems impossible to describe this condition more concisely without making it incomprehensible.
I've considered removing the old end-of-life gates, but they're still useful as "comments" that describe when an alias was deprecated, and we could instead remove the aliases altogether. We could set a policy for that, but I'd like to do one thing at a time.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.