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
ytop: Add "ytop" to ytop's error message #101098
Conversation
Right now, running `nixos-rebuild` gives an obscure error: ``` $ nixos-rebuild switch building Nix... building the system configuration... error: Abandoned by upstream. Consider switching to bottom instead (use '--show-trace' to show detailed location information) ``` (And `--show-trace` adds no useful information.) The error message doesn't indicate that `ytop` is what's causing the problem. By adding `ytop` to the error message, configurations that still reference `ytop` will be easier to debug and fix.
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.
Diff LGTM. Just ran into this when bumping nixos-unstable
. Thanks!
Actually in that file there are some other occurrences like this, maybe we can fix them all? |
Sorry, this is a mistake on my end. I had assumed that aliasing a package to throw an error would also give the attribute that failed to evaluate. |
Still as this seems a common and easy enough mistake to make, we should probably think about some form of automation. |
Linking the RFC mentioned on IRC: NixOS/rfcs#33 |
aliases.nix: errors should include package names In `pkgs/top-level/aliases.nix`, `throw` was used to make packages that were removed error with a more useful message than "attribute 'foobar' missing, at <location>". However, if the error message doesn't include the package's attribute name, it can be difficult to determine what caused it. For example, here's what building a configuration that referenced `ytop` looked like recently (see NixOS#101098): ``` $ nixos-rebuild switch building Nix... building the system configuration... error: Abandoned by upstream. Consider switching to bottom instead (use '--show-trace' to show detailed location information) ``` Therefore, we modify string values in `aliases.nix` to prefix `Attribute foobar in <nixpkgs> has been removed` to the reason message. This makes the removed reasons a bit shorter and provides a place to unilaterally improve these error messages in the future, rather than with one-off changes or large sets of manual fixes.
Opened #101210 to automatically add attr names, so this mistake can't be made manually any more.
|
Right now, running
nixos-rebuild
gives an obscure error:(And
--show-trace
adds no useful information.)The error message doesn't indicate that
ytop
is what's causing the problem.By adding
ytop
to the error message, configurations that still referenceytop
will be easier to debug and fix.