-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all-packages: warn when using deprecated attributes
The aliases are split into two groups, as mass-renaming is anticipated. Also added fold markers as in the rest of file. #9456 (cherry picked from commit c53018c)
- Loading branch information
Showing
1 changed file
with
17 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8e8e23d
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 undesirable:
8e8e23d
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.
Hmm, is there a way to distinguish a nix-env listing from a specifically requested attribute? I believe deprecated aliases shouldn't be in nix-env results anyway.
8e8e23d
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.
Well, I've come up with a hacky solution to this
Currently there are only two renames that go silent with it, and the notorious
overrideDerivation
is only used when printing the message (i.e. not often). Should I push it, or can anyone see a better option?8e8e23d
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.
Dunno, it's a bit too hacky for me...
I don't really see a good short-term solution other than removing the trace messages. Long-term solution would be to have a separate attribute set containing the packages for nix-env.
8e8e23d
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.
I'm not so sure about that. The behavior with patch above is that
nix-env -q
shows no warning, butnix-env -i
does (i.e. it warns iff you instantiate through a deprecated name).8e8e23d
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.
@edolstra, is the hackiness level of this low enough?
For me it reports on instantiation and does nothing
nix-env -qa
. It doesn't cover all cases, as e.g. onnix-instantiate -A inotifyTools.out
it reports nothing, but IMHO it's fairly close to what we want. It does cover the case of using the attribute inbuildInputs
. We can improve later, if need be and/or we find a better way. EDIT: usingnix-env -qas
still triggers a report, but that seems hard to avoid, as some kind of instantiation is done in that case. Demo: 9e84cb3.