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

Why do we add trailing zeros to our versions of cabal-install? #7771

Open
andreasabel opened this issue Oct 24, 2021 · 4 comments
Open

Why do we add trailing zeros to our versions of cabal-install? #7771

andreasabel opened this issue Oct 24, 2021 · 4 comments
Assignees
Labels
re: pvp Concerning the Haskell Package Versioning Policy type: discussion

Comments

@andreasabel
Copy link
Member

Hackage shows the following versions of cabal-install:
0.4.0, 0.5.0, 0.5.1, 0.5.2, 0.6.0, 0.6.2, 0.6.4, 0.8.0, 0.8.2, 0.10.0, 0.10.2, 0.14.0, 0.14.1, 1.16.0, 1.16.0.1, 1.16.0.2, 1.16.1.0, 1.18.0, 1.18.0.1, 1.18.0.2, 1.18.0.3, 1.18.0.4, 1.18.0.5, 1.18.0.6, 1.18.0.7, 1.18.0.8, 1.18.1.0, 1.18.2.0, 1.20.0.0, 1.20.0.1, 1.20.0.2, 1.20.0.3, 1.20.0.4, 1.20.0.5, 1.20.0.6, 1.20.1.0, 1.20.2.0, 1.22.0.0, 1.22.0.1, 1.22.2.0, 1.22.3.0, 1.22.4.0, 1.22.5.0, 1.22.6.0, 1.22.7.0, 1.22.8.0, 1.22.9.0, 1.24.0.0, 1.24.0.1, 1.24.0.2, 2.0.0.0, 2.0.0.1, 2.2.0.0, 2.4.0.0, 2.4.1.0, 3.0.0.0, 3.2.0.0, 3.4.0.0, 3.4.1.0, 3.6.0.0, 3.6.2.0

Starting with 1.20.0.0, exactly four version positions are used, even if the last ones are zeros. Before that, three positions were used unless there was a fourth different from zero.

I know there is a culture in IT, even spreading beyond IT, to write 1.0 instead of just 1 to indicate a version number. But why several trailing zeros?

One reason may be that the discussion haskell/pvp#4 isn't finished yet. So there is a theoretical possibility to name consecutive versions 0.0, 0.0.0, 0.0.0.0. By filling the trailing zeros in from the beginning, such abuse is prevented.

Why do I care? I one keeps several versions of cabal-install around it is natural to name them cabal-$VERSION. However, I find e.g. cabal-3.2.0.0 quite unnatural when I can name it cabal-3.2 (try to pronounce both!). A canonical name that is practical is imo a name without the trailing zeros. If this would be the same as the official version (i.e. if we released as 3.2), I could assume that others also name it cabal-3.2. Now, I must assume that some name it cabal-3.2.0.0 and some cabal-3.2.

Note also that the cabal-version field that follows the versions of Cabal and cabal-install does not use trailing zeros.

Maybe there are some written documents on the decision to use 4-position version numbers always for Cabal/cabal-install, helping to understand the current practice?

@phadej
Copy link
Collaborator

phadej commented Oct 24, 2021

cabal-version is not a version of cabal-install or Cabal. It's a version of CABAL spec.

The latest cabal-version (spec version) is kept in sync with version of Cabal because we can keep it. They could diverge, yet people complain that GHC-8.0 comes with base-4.9.0.0 and not base-8.0.0.0.

Note, there is no cabal spec version 3.2. The format didn't change then, that a recent moment where cabal spec versions and Cabal versions would diverge, but we decided not to. https://cabal.readthedocs.io/en/3.6/file-format-changelog.html

In hindsight, cabal format, Cabal library and cabal-install would all had different names (compare: JSON, aeson and jq).

See also https://gist.github.com/merijn/8152d561fb8b011f9313c48d876ceb07, IIRC there was discussion (maybe even an issue) to add that to the Cabal's manual. That would help a lot!

@andreasabel andreasabel added re: pvp Concerning the Haskell Package Versioning Policy type: discussion and removed type: user-question labels Oct 25, 2021
@andreasabel
Copy link
Member Author

@jneira: I intended this rather as a developer discussion, with possible outcome to either add developer documentation to justify the current practice, or to change the current practice (dropping trailing zeros).

@phadej: I am aware of the differences between Cabal, cabal-install, and the CABAL spec (cabal-version) versions. I agree that better documentation would help (cf. #7644). I would however like to discuss the trailing zeros issue here.

@phadej
Copy link
Collaborator

phadej commented Oct 25, 2021

Now, I must assume that some name it cabal-3.2.0.0 and some cabal-3.2.

  • ghcup names cabal-3.2.0.0, you get exactly what you ask for.
  • hvr-ppa names cabal-install-3.2, you usually get the latest in the series. e.g. cabal-install-3.2.1.0.

I'd assume that if ghcup had cabal 3.2 alias it would install the latest in that series.

Compare: We talk about GHC-8.10, but it's GHC-8.10.7 atm. I think this issue is mostly aesthetic, whether we have

  • cabal-install-3.6, cabal-install-3.6.2 and possible cabal-instrall-3.6.2.1 or
  • cabal-install-3.6.0.0, cabal-install-3.6.2.0 and cabal-install-3.6.2.1

We can argue that 3.6.0.0 is actually better, because when we ask a user for a version of cabal-install:

  • If they answer cabal-install-3.6.2.0, it is unambiguous,
  • but if they answer just cabal-install-3.6: do they mean cabal-install-3.6.0.0 or cabal-install-3.6.2.0?

@andreasabel
Copy link
Member Author

GHC avoids this issue by not releasing .0 versions, starting e.g. with 9.0.1. In their case, its is natural because each major version will have several minor versions.

The argument with 3.2 referring to the latest version among 3.2.x.y makes sense to me.

Thanks for the clarification, @phadej!

@andreasabel andreasabel self-assigned this Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
re: pvp Concerning the Haskell Package Versioning Policy type: discussion
Projects
None yet
Development

No branches or pull requests

3 participants