-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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: deprecation, warnRenamed, release constants #19315
Conversation
@Profpatsch, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @nbp and @7c6f434c to be potential reviewers. |
(bikeshedding) I'd prefer changing Additionally using |
9e1d885
to
8610d5e
Compare
Thanks, I was dissatisfied with the name myself. |
Introduce the concept of attribute deprecation. A new library contains deprecation functions (for now only `renamedWarning`) that annotate functions and print a deprecation warning. In order to manage time until a symbol is removed, we introduce release constants that are used in the warning messages and contain release names and dates. As an example, `opusTools` is renamed to `opus-tools`, with the reasoning that the related `vorbis-tools` uses a different naming scheme. Users on master will immediately get a warning, users of stable channels can find out about the changed attribute from the changelog when they update to a new release.
8610d5e
to
6204160
Compare
I remember seeing a checklist for releases somewhere. We should add “search and delete all that is deprecated in this version, add each item to the release notes; do it in one commit”. |
This has been tried before, but the problem is that it makes |
@Profpatsch just landed in master at ed6ea74 |
I’m not sure, I haven’t used |
Still to do would be
|
, releaseDate | ||
}: "${name} (release date ${releaseDate})"; | ||
|
||
next = nixos-17-first; |
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.
Shouldn't this be 17.09 (not 17.03)? If it's 17.03, there is no deprecation period for users of stable channels.
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.
not 17.03)? If it's 17.03, there is no deprecation period for users of stable channels.
When you update your stable channel you are expected to read the changelog and fix any evaluation errors that arise in one swoop. At least for renames it gives a nice evaluation error and will be documented in the changelog.
Ref. about problems with |
At the moment we only have What do you think about introducing a |
Yeah, perhaps. Tools can filter those lines easily enough now (e.g. by a simple grep), though it's not perfectly reliable in principle. |
@vcunat With your changes to |
It's probably a bit late to get this together for 18.09, but I really think either this or something doing the same job is in need. There were a couple sparks flying around lately with regards to deprecation of attributes; We had a chat about something similar recently on #nixos. One main thing differed from your approach in the idea thrown around: instead of approaching the deprecation in two stages (deprecate, remove), add an additional step (pre-deprecate, deprecate, remove). The The three-step approach allows users not to worry with a deprecation warning stemming from some tooling they use. Imagine tool "A" using nix, and using the attribute Let me know your thoughts about that additional step. TLDR: 👍 want to see this or something doing the same job hit 19.03. |
I wouldn’t overcomplicate it, someone has to remember to change these after all. I haven’t seen systems that do it like this so far. Maybe the overhead is not worth the gains in practice.. |
What really is the need for removing compability aliases? It doesn't really cost us anything to keep an alias like Also, |
I am operating only under the assumption that there is a need or want to remove compatibility aliases. Though, something similar would be needed if something is going to be dropped, right? Dropping something from Nixpkgs will cause issues to the end-users (we can easily manage the change inside Nixpkgs). About complicating with pre-deprecation: This is for end-user user-friendliness. The warnings will cause headaches to the end-user using additional tools built on top of nixpkgs. The integrator (a nixpkgs user that built the tool built on top of nixpkgs) would be expected to follow up with the news (reading the release notes, hoping it made it in) or better with the option, using the the option opting-in for the warning one release beforehand. This is not for the simple "nixpkgs and nixpkgs users" situation, but one that has to be thought of, users using tools built by other users of nixpkgs. I will add a bit, and maybe be a bit harsh: Let's not stop or stall the discussion about the deprecation feature because there is no need since we can keep compatibility aliases. Please either review under the assumption the feature being implemented in whole is required and needed, or reject the feature as a whole if undesirable. Right now the half-rejection-because-we-keep-everything makes this a less desirable feature to look at and work on since there's a heavyweight decision maker casting a negative cloud over the future of the feature. In the event the feature is desirable only or some uses, and a technical solution does not exist restricting its use (e.g. dropping aliases for renamed attributes), it'll have to be documented and rely on the committers/members to review appropriately. |
Any updates on this pull request, please? |
Don’t think this will ever happen. Thanks for triaging. |
Introduce the concept of attribute deprecation.
A new library contains deprecation functions (for now only
renamedWarning
) that annotate functions and print a deprecationwarning.
In order to manage time until a symbol is removed, we introduce release
constants that are used in the warning messages and contain release
names and dates.
The printed warning only uses a trace message at the moment, this should
be improved.
As an example,
opusTools
is renamed toopus-tools
, with thereasoning that the related
vorbis-tools
uses a different namingscheme. Users on master will immediately get a warning, users of stable
channels can find out about the changed attribute from the changelog
when they update to a new release.
cc @edolstra @aszlig @vcunat