ytop: Add "ytop" to ytop's error message#101098
Merged
samueldr merged 1 commit intoNixOS:masterfrom Oct 20, 2020
Merged
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.
cole-h
approved these changes
Oct 20, 2020
Member
cole-h
left a comment
There was a problem hiding this comment.
Diff LGTM. Just ran into this when bumping nixos-unstable. Thanks!
Contributor
|
Actually in that file there are some other occurrences like this, maybe we can fix them all? |
10 tasks
Member
|
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. |
Contributor
Author
Contributor
Contributor
|
Still as this seems a common and easy enough mistake to make, we should probably think about some form of automation. |
Member
|
Linking the RFC mentioned on IRC: NixOS/rfcs#33 |
9999years
added a commit
to 9999years/nixpkgs
that referenced
this pull request
Oct 20, 2020
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.
Contributor
Author
|
Opened #101210 to automatically add attr names, so this mistake can't be made manually any more. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now, running
nixos-rebuildgives an obscure error:(And
--show-traceadds no useful information.)The error message doesn't indicate that
ytopis what's causing the problem.By adding
ytopto the error message, configurations that still referenceytopwill be easier to debug and fix.