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

[RFC] mkDerivation: support version suffix, which is part of derivation nam… #75813

Closed
wants to merge 1 commit into from

Conversation

danbst
Copy link
Contributor

@danbst danbst commented Dec 17, 2019

mkDerivation: support version suffix, which is part of derivation name but is not part of meta.name.

Inspired by #73228
Helps with #74494
cc @AMDmi3 if this makes life easier for Repology.

cc @davidak

$ for x in \
     amarok dsseries purple-discord QuadProgpp mkl bazel-remote postgresql nix nixFlakes\
  ; do nix eval -f. $x.meta.name; done

Previous meta.name (published to Repology):

"amarok-2.9.0-20190824"
"libsane-dsseries-1.0.5-1"
"purple-discord-unstable-2018-04-10"
"QuadProgpp-4b6bd65f09fbff99c172a86d6e96ca74449b323f"
"mkl-2019.5.281"
"bazel-remote-2019-01-12"
"postgresql-11.6"
"nix-2.3.1"
"nix-2.4pre20191022_9cac895"

New meta.name:

"amarok-2.9.1pre"
"libsane-dsseries-1.0.5-1"
"purple-discord-2018.04.10"
"QuadProgpp-1.2.2pre"
"mkl-2019.5.281"
"bazel-remote-2019.01.12"
"postgresql-11.6"
"nix-2.3.1"
"nix-2.4pre"

Previous names:

"amarok-2.9.0-20190824"
"libsane-dsseries-1.0.5-1"
"purple-discord-unstable-2018-04-10"
"QuadProgpp-4b6bd65f09fbff99c172a86d6e96ca74449b323f"
"mkl-2019.5.281"
"bazel-remote-2019-01-12"
"postgresql-11.6"
"nix-2.3.1"
"nix-2.4pre20191022_9cac895"

New names:

"amarok-2.9.1pre20190824"
"libsane-dsseries-1.0.5-1"
"purple-discord-2018.04.10_9a97886"
"QuadProgpp-1.2.2pre_4b6bd65"
"mkl-2019.5.281"
"bazel-remote-2019.01.12"
"postgresql-11.6.p6"
"nix-2.3.1"
"nix-2.4pre20191022_9cac895"

@davidak
Copy link
Member

davidak commented Dec 17, 2019

@danbst Thanks for your effort.

What is the goal of having a version suffix?

The pre versions are not good because you don't know the next version until it is released. Even if it was announced, a patch release might be needed.

I don't like the YYYY.MM.DD syntax. ISO 8601 defines a standard that is commonly used. It can be recognized as a date and parsed by tools like repology. https://xkcd.com/1179/

Should the derivation name and meta.name differ? Might be less confusing if they don't.

@danbst
Copy link
Contributor Author

danbst commented Dec 17, 2019

@davidak
Version suffix is part of derivation name, which has special handling in nix-env -u. So if we update a package, but don't bump version (e.g. another Git revision), it should be reflected in name.

But I don't think this nuance should be reflected in Repology. Who even cares about explicit Git revision of a package in repology? That's why meta.name is cleaned up.

The pre versions are not good

I just stick to what nixUnstable uses. Sure, we don't know what next version will be. The alternative is to use 2.3.1+ to relfect we are on explicit revision based upon 2.3.1 version. Would that be better?

I don't like the YYYY.MM.DD syntax. ISO 8601 defines a standard that is commonly used. It can be recognized as a date and parsed by tools like repology. https://xkcd.com/1179/

This is also kinda stadard https://calver.org/ . If repology can recognize this as date, it is awesome, as this is exactly what we want (2019.1.1, 2019.01.01, 2019-1-1 and 2019-01-01 should all be same version).

Might be less confusing if they don't.

We have at least 1 case when meta.name != name, it is when we crosscompile. So I don't think it will hurt to have those different, especially as we publish meta.name.

@davidak
Copy link
Member

davidak commented Dec 17, 2019

Version suffix is part of derivation name, which has special handling in nix-env -u. So if we update a package, but don't bump version (e.g. another Git revision), it should be reflected in name.

The comment in #73228 (comment) states that it is not needed:

Nix can distinguish if a package changes based on the hash of the derivation generated by the expression, so it does not need such extra attribute.

(or do i understand it wrong?)

I just stick to what nixUnstable uses.

In this case we are upstream and the pre release version is similar to an official release. So not good to generalize it.

The alternative is to use 2.3.1+ to relfect we are on explicit revision based upon 2.3.1 version. Would that be better?

I think that is very intuitive for a user.

We could add the number of commits since the version (2.3.1+42), but we have to get it somewhere. A package maintainer should not have to count them. fetchFromGitHub gets a tarball when a revision is given, right? When the git repo would be cloned, git can give this information.

I don't know if there is a consensus how to describe unreleased versions best. As always i would get in contact to other distros maintainers since they have the same challenges. @AMDmi3 might also have some good insights. But i think we had this discussion before, here or in repology.

This is also kinda stadard https://calver.org/ .

Ah, yes. Might imply it's an official release. We still need some good word that it's an unstable package version.

And it could cause problems when you compare it to a semver version.

@danbst
Copy link
Contributor Author

danbst commented Dec 17, 2019

The comment in #73228 (comment) states that it is not needed:

Nix can distinguish if a package changes based on the hash of the derivation generated by the >>expression, so it does not need such extra attribute.

(or do i understand it wrong?)

that is correct, however we have plenty of cases when hash changes, but package source - doesn't. If we have version (source version) and patches info in name, then external tools (such as nix-diff) can show that not only hash had changed, but some patches were also added.

@FRidh FRidh added this to WIP in Staging via automation Dec 19, 2019
@FRidh FRidh changed the base branch from master to staging December 19, 2019 08:28
@Profpatsch
Copy link
Member

Can we please get rid of the dot stuff and use ISO-dates? calver looks like a BS standard, because it’s basically: “people use different things, so it’s fine to use whatever”. That’s counterproductive …

@uri-canva
Copy link
Contributor

Is this PR still relevant or is it abandoned?

@danbst
Copy link
Contributor Author

danbst commented Jun 16, 2020

@uri-canva this proposal of change, it's definitely not about being merged as is. But yeah, given I don't have enough willpower to make it proper RFC, let's close

@danbst danbst closed this Jun 16, 2020
Staging automation moved this from WIP to Done Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants