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

'choco install --version MAJOR.MINOR' installs MAJOR.MINOR.0 instead of latest patch #1874

Closed
bergmeister opened this issue Jul 5, 2019 · 10 comments

Comments

@bergmeister
Copy link

I know that chocolatey does not support semantic versioning as per issue #1610 but despite that I'd still expect that chocolatey picks the latest patched version when the patch version is not specified.

Example: choco install kubernetes-cli --version=1.14
Expected: Installs version 1.14.3, which is the latest patched version.
Actual: Installs 1.14.0.

@AdmiringWorm
Copy link
Member

I would say that is expected.
After all the version 1.14 is equal to 1.14.0. At least in terms of chocolatey.

@bergmeister
Copy link
Author

bergmeister commented Jul 5, 2019

I disagree, if I specified 1.14.0 explicitly, yes, but the expectation is that if the full version is not specified the latest patched version is used. Especially for patches, they are by definition not breaking and therefore in the majority of the cases the users wants to use the latest patched version and in terms of security best practices, chocolatey should recommend this as well.
I am not sure what the behaviour is in terms of minor version, I suppose for the minor version one should either apply the same or explicitly ask the user but the behaviour for patches is much less debatable IMHO

@AdmiringWorm
Copy link
Member

I disagree, ff I specified 1.14.0 explicitly, yes, but the expectation is that if the full version is not specified the latest patched version is used.

A full version would be a 4 part version, meaning that you would have needed to specify 1.14.0.0 to get the actual version (yes, there are plenty of softwares still using all 4 parts).

Especially for patches, they are by definition not breaking and therefore in the majority of the cases the users wants to use the latest patched version and in terms of security best practices, chocolatey should recommend this as well.

That is only true if the software actually follows semver, I have seen plenty of softwares that do not. Which adds breaking changes both in minor, patch and build versions.

I am not sure what the behaviour is in terms of minor version, I suppose for the minor version one should either apply the same or explicitly ask the user but the behaviour for patches is much less debatable IMHO

If going by the semver v2, then minor releases should also be non-breaking. The only accepted (after v 1.0) to include breaking changes is major releases (1.0, 2.0, 3.0, etc), however as I mentioned before not all software developers follow semver v2 (or even v1)

But lets get back on topic, as I already mentioned. The version 1.14 is equal to 1.14.0, and I believe this is not something that will likely change, and is also how other package managers I have used handles versioning (both on windows, and on linux).
I could be wrong though, I am not a part of the team that maintains choco itself (or even any of the available chocolatey software)

Now, with this said, I would love to see a way to specify a version range that you would want to install (for instance similar to how npm/yarn do this. Using the format ^1.4.0 would typically install the latest minor version, and ~1.4.0 would typically install the latest patch version available).

Allowing version ranges is tracked over here though (but with a different format): #800

@ferventcoder
Copy link
Member

ferventcoder commented Jul 6, 2019

I know that chocolatey does not support semantic versioning

Chocolatey supports semver 1, so just wanted to clear that up. 👍

@ferventcoder
Copy link
Member

ferventcoder commented Jul 6, 2019

Chocolatey does not support calling part of a version on the command line and having it find the latest in that range. So it is correct that if you call for 1.14, that is equal to 1.14.0 and 1.14.0.0, thus that is what you should get back, not 1.14.3. Bumping to support SemVer2 won't change that aspect.

@ferventcoder
Copy link
Member

Duplicate of #800

@ferventcoder ferventcoder marked this as a duplicate of #800 Jul 6, 2019
@ferventcoder
Copy link
Member

@bergmeister from what you described, this sounds like #800. If you believe it is different, please let me know. Otherwise please subscribe to that issue. This issue is now linked to that one as well so the conversation here will be take into account when that is worked on. 👍

@bergmeister
Copy link
Author

bergmeister commented Jul 6, 2019

Ok, thanks for the feedback and the provided details 😊

@rafrafek
Copy link

How can I install latest Python 3.9 ?

PS C:\WINDOWS\system32> choco upgrade python --version "3.9"
Chocolatey v0.11.2
Upgrading the following packages:
python
By upgrading, you accept licenses for the packages.
Progress: Downloading python3 3.9.0... 91%
CTRL-C
WTF?
PS C:\WINDOWS\system32> choco upgrade python --version "<3.10"
Chocolatey v0.11.2
Upgrading the following packages:
python
By upgrading, you accept licenses for the packages.

Chocolatey upgraded 0/0 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Did you know the proceeds of Pro (and some proceeds from other
 licensed editions) go into bettering the community infrastructure?
 Your support ensures an active community, keeps Chocolatey tip-top,
 plus it nets you some awesome features!
 https://chocolatey.org/compare
'<3.10' is not a valid version string.
Parameter name: version
PS C:\WINDOWS\system32>

If I have to go to Python's website to check what is the latest 3.9 version, what is the point of using choco? I can just use website to update my Python. I thought that choco is made for easy managing software installations from command line.

@pauby
Copy link
Member

pauby commented Oct 11, 2021

@rafrafek That's not how Chocolatey works. My suggestion would be to ask a question over at https://github.com/chocolatey/choco/discussions as this issue is closed.

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

No branches or pull requests

5 participants