-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib.oldestSupportedReleaseIsAtLeast: rename from bad name #347258
lib.oldestSupportedReleaseIsAtLeast: rename from bad name #347258
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 = relaxed
sandbox = true
nix-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.