-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
doc: update unstable version naming conventions #100833
Conversation
As discussed on IRC, there are two orthogonal use cases: regular packages fetched from VCS (even temporarily), and projects that have both stable and unstable branch packaged. This PR currently covers the former (IMHO) correctly but we should probably also mention the latter. |
Apparently, the
Maybe we could make |
A bit of bikeshedding, but here's a rewording I find easier to follow:
|
Incorporated @AluisioASG 's suggestion. |
Could we also mention that “If there are multiple version branches of a project installed, their |
Updated to include @jtojnar's suggestion. Rendered: |
I agree that "unstable" should not be in the pname. More bikeshedding: I liked it better at the beginning of the version because that's the most significant part, and it makes sense to first differentiate between stable and unstable, and then by the rest of the version. Overall strong +1! |
I think we should only require |
We need to distinguish them because otherwise, |
At least for me, that's the whole point. If I run (I know about |
For the VCS use case: perhaps we should also consider whether For the 'projects that have both stable and unstable branch packaged' case: how does this relate to packages like etcd, where there's a |
I feel like this is getting bogged down on the pname naming part. Maybe we can just merge the version part and leave the pname part for later, @jtojnar? |
The previous explanation did not make it clear where the word "unstable" should go when name is split into pname and version. By putting it at the end, we can get builtins.parseDrvName to parse things nicely: > builtins.parseDrvName "pname-2020-10-17-unstable" { name = "pname"; version = "2020-10-17-unstable"; } It is not good to put it in the pname, because then the pname will not match with the attrpath.
I updated this to remove the pname part for now, since it needs more thought. |
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 would like to also allow other postfixes rather than only -unstable
(and perhaps even other patterns, such as git describe
-style, could also be useful).
That said, this is already seems like an improvement over the previous convention AFAICS, so 👍
I would like to hear from @edolstra first, as he was vaguely opposed to this IIRC. |
Note that while the official status quo is to suffix
We may want to write a script to automatically convert unstable version prefixes to suffixes. This would help people use the right format with looking at other packages for examples. |
A related discussion to have is how to map attribute names to pnames. Having that would allow looking at the store path or In that regard, I think we should reserve For packages that live in a package set like haskellPackages, we can argue whenever those pnames should also include |
And in any case, it would repeat the mistake of having special characters in the name to denote some meaning (i.e. using |
|
Most of the time there is only unstable package. Either the stable package is so out of date we decided to pull it from git or there were no releases in the first place but there might be some in the future. In those cases, we want |
NixOS/nix#3579 (comment) and #88023 (comment) seem relevant here. |
I think this discussion would benefit from @raboof 's suggestion to distinguish "fetched from VCS"-unstable from "unstable package branch"-unstable. |
It's a multi-dimensional problem so it's hard to find a good solution. I still think that the pname should match the attribute name as much as possible for practical reasons. Eelco is right that |
Bump. This needs clearing up because right now we do |
The original argument was to say that the output of
This would dictate that Similarly, if we want to have multiple variants of a package, then those would be encoded in the pname. |
I don't understand why we can't change that builtin to match what we want.
This means it would need a treewide change after which the date in the version confuses repology even more than right now.
The only packages we have multiple of are big compilers, interpreters and some others but they almost always have a version number in their pname because we are almost never tracking git commits on them. The most common use case of not tracking a release version right now is when something broke with some dependency and the patch does not apply on the latest release because it is simply to old or the latest release is just simply to old. Such packages have almost never two versions in nixpkgs and the unstable is almost always with the version number infront of it. |
That function is terrible by design and cannot really be fixed (compare I have also made a PR with similar change against |
Compatibility.
There is nothing broken about that function. It exposes exactly the semantics that |
It is broken by design because it follows broken semantics of In other words, sure, it follows specification but the specification itself is misdesigned. |
I like the idea to have And in case of a package that has no stable version or the stable version is too old, use When Some current edge cases:
Do you see any case where The string that represents a package in nix-env could be considered a display name that is only meant for a user to read, not used in any technical way. It can be To be compatible with previous nixpkgs versions (that is a feature after all), we can have additional functions to handle it. That is an additional burden, but it's the price for compatibility when we want to move forward at the same time. @edolstra what do you think about the idea to keep the old name handling code around in Nix to handle old nixpkgs versions? would that solve any compatibility problems you see? |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/brainstorming-for-rfc-pname-and-version/12873/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/brainstorming-for-rfc-pname-and-version/12873/2 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/brainstorming-for-rfc-pname-and-version/12873/58 |
Closing this since it looks like people are working on an RFC instead. |
The previous explanation did not make it clear where the word
"unstable" should go when name is split into pname and version.
By putting it at the end, we can get builtins.parseDrvName to parse
things nicely:
{ name = "pname"; version = "2020-10-17-unstable"; }
It is not good to put it in the pname, because then the pname will not
match with the attrpath.
Manual rendered:
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)