Skip to content
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

Improve error message for conflicting priorities #1571

Merged
merged 1 commit into from Oct 12, 2017

Conversation

teto
Copy link
Member

@teto teto commented Sep 21, 2017

I find the error message 'nix-env --set-flag priority NUMBER PKGNAME'
not as helpful as it could be :

  • doesn't share the current priorities
  • doesn't say that the command must be run on the already installed
    PKGNAME (which is confusing the first time)
  • the doc needs careful reading:
    "If there are multiple derivations matching a name in args that have the same name (e.g., gcc-3.3.6 and gcc-4.1.1), then the derivation with the highest priority is used."
    if one stops reading there, he is screwed. Salvation comes with reading "A derivation can define a priority by declaring the meta.priority attribute. This attribute should be a number, with a higher value denoting a lower priority. The default priority is 0."
    To sum it up, lower number wins. I tried to convey this idea in the
    message too.

I haven't used this in production because nixUnstable tends to break my install and I wanted to check for agreement first.

I find the error message 'nix-env --set-flag priority NUMBER PKGNAME'
not as helpful as it could be :
- doesn't share the current priorities
- doesn't say that the command must be run on the already installed
PKGNAME (which is confusing the first time)
- the doc needs careful reading:
"If there are multiple derivations matching a name in args that have the same name (e.g., gcc-3.3.6 and gcc-4.1.1), then the derivation with the highest priority is used."
if one stops reading there, he is screwed. Salvation comes with reading "A derivation can define a priority by declaring the meta.priority attribute. This attribute should be a number, with a higher value denoting a lower priority. The default priority is 0."
To sum it up, lower number wins. I tried to convey this idea in the
message too.
@edolstra edolstra merged commit 9730781 into NixOS:master Oct 12, 2017
@teto teto deleted the improve_priority_msg branch October 12, 2017 11:40
@domenkozar
Copy link
Member

Thank you!

@teto
Copy link
Member Author

teto commented Oct 12, 2017

Thanks for the merge. The previous message did confuse me at the beginning (I know it's true for others too) and I hope this one might help beginners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants