-
Notifications
You must be signed in to change notification settings - Fork 909
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
Expand --version
option to allow range
#800
Comments
I think this has already been logged. If not 👍 |
Similar - #688 |
@dtgm Summary/proposal - do you think this is something we could enhance the template with? |
Pushing this out a bit - it's a good feature, but requires a lot of working parts to change. |
@ferventcoder I figured it had to been logged too, but couldn't find with search. Probably still on the old chocolatey repo issue tracker. Adding to template? On one hand, it clarifies the situation, on the other, it may encourage people to a bunch of packages that should be deprecated when the feature gets implemented. I mean right now we have How does nuget handle interpreting the dependency xml element? Can we leverage what they are doing there? We would probably want to separate out interpreting the version and call on that as required to retrieve the latest version within the provided parameters(?) |
Bigger discussion - .NET 4.6 and 4.6.1 may be side by side installs. |
^^^ Widens scope for sure if needing to handle multiple versions of same id, which dotnet would. That should probably get logged as a new feature enhancement that would build upon this one.
For example, I think the behavior is if There would have to be a way to follow the dependencies strict with |
Our recommendation is that for when the natively installed app can have two versions of it installed, that is two different packages. So .NET Framework 3.5 versus .NET Framework 4.5. Those are different installs, thus different packages. |
I agree and it should continue like that for now, but also ... stop and dream a little, man! Imagine a world where all the dotnetX maintainers worked together.... Most programs just need at least a certain version of installed, say dotnet >=4.0 But many programs also do require a specific version so it's not a solution to merge them all until there is some mechanism to say, "Hey, dependency X, I know we already have a version of you installed, but we need you too, bruh." Requiring side-by-side install of latest release in 4.5.x.x <dependencies>
<dependency id="dotnet" version="[4.5,4.6)" force="yes" />
</dependencies> So by adding an attribute |
I've been thinking about converging the .NET packages for quite a while now (as hinted here). There are exactly two packages needed, one for each .NET "family": 2.x/3.x (2.0, 3.0, 3.5, 3.5.1) and 4.x (4.0, 4.0.1, 4.0.2, 4.0.3, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2). Both families are independent of each other and install side-by-side. Within each family, each new release completely overwrites/supersedes the older ones, while remaining backward-compatible. Back on topic: I fully support this feature suggestion. It would help greatly in cases where subsequent versions of a commercial package have different licensing, for example a license is valid only for a specific major version (e.g. Resharper - there is currently no way to tell choco "I have a license for 9.x, so please install the latest release before 10.0"). |
@jberezanski I agree the convergence is helpful. I also think this is a great feature suggestion. 👍 |
@jberezanski @ferventcoder Forgot I did this meta-analysis of package families with distinct installers awhile back. Specifically, looking at the possibility of combining them and how might be best to specify "editions" to install, or at least having a consistent naming in use dtgm/chocolatey-packages#172 |
👍 To this idea. This would be handy for those of us that use chocolatey in a configuration management setting where we want to enforce a bare minimum baseline for a chocolatey package version but allow users to upgrade at their leisure. In particular, Chef's Having this built into chocolatey itself would mean Chef wouldn't really have to touch the code for their provider at all since we could just update the version string we use in our cookbooks and let chocolatey handle the check for us. Either that or throw an expected non-zero exit code with an additional flag on the command line that we can trap... but this feature just seems way cooler ;) |
Personally I feel like semver ranges as used by npm, Composer etc. are more popular and more intuitive |
@svmastersamurai min version with Chef (or other config mgmt) is typically achieved by having the min version in your sources and then using latest or whatever Chef uses. But then upgrade paths over time when tbe min changes (might be achieved in the same way), but you only want the upgrade if it is below the min. I agree that is a tougher nut to crack. I bet the Chef resource could support a min_version property. You might ask Chef to see what they think. |
Maybe I'm dense, but I don't see the point of having a range. It seems sufficient to support In what circumstances would you want to define a range and NOT have the package manager choose the newest package that satisfies that range? Newest satisfying will never need to look at the bottom end of the range, so |
I don't personally know all of the reasons and constraints folks might have, so I'm not really into limiting them because I don't necessarily understand their needs.
@pklapperich I mean, it's close, but
I think if the upgrade is performed, it would absolutely choose the latest package that satisfies the range, but choosing whether to action or not is really where the range comes in. It's possible that they are sufficiently expressive, but I can't say I understand everyone's situation. |
Wait, what? According to the proposal, this should upgrade if a version newer than 1.0.0 is available. That's how all other package managers I've used work (apt, yum, npm, etc). This statement makes me concerned that setting a version range won't even solve the common use case I see (ie, avoid a bleeding edge version, but still get bug fixes). For example, I pin Node to [8.0,9.0). I have 8.12.0 installed. Node pushes a security update 8.12.1. I ask choco to upgrade and choco says "derpy derp, nothing to do. Constraints are met." On my non-windows systems I either have a package for Node 8.x.x or I have node pinned to <9.0 and I get updates whenever I run the upgrade/update command. I can understand a need for ranges in package dependencies (ex a package depends on [2.0,3.0)) but I still don't see a reason for ranges on either pinning or the command-line. I definitely want 'upgrade' to fetch the newest within the constraints. The proposal above is
For both of these cases, (select the most recent in range) I would expect it to pick the same package unless the latest package were less than 1.0 in which case the top would give an error and the bottom would install something. The bottom end of the range seems of little use. |
Not to be a doggy downer here, but...
Chocolatey is built on top of NuGet v2. With that stated, the range (ranging?) is already baked in. ; i.e https://docs.microsoft.com/en-us/nuget/reference/package-versioning so I think this "argument" might be with the wrong people. :) The original opened issue is about choco.exe processing an install range via command line seems to be an enhancement to actually use more of that possible/available range (ranging?) system. Of course, I could be misunderstanding something, but that's where @ferventcoder steps in. EDIT: Re-reading your last post, could your request/"argument" be summarized as when a package is already installed and an upgrade request is made, if the package is less than the highest available within the range, Chocolatey should update the package to the highest version within the range if it isn't already? That seems like desirable behavior to me and might need a new issue opened to make it happen. |
NuGet allows the ranges for package dependencies, which I said make perfect sense. There are reasons why a package maintainer might need to specify a range, and chocolatey should not prevent that. As far as I know, NuGet's cli But this feature request also includes the command line options for choco, where I don't really think range-start makes sense, only range-end. From the command line, I'm always telling choco to operate on the named packages. That means choco doesn't have to decide whether or not it should perform an operation; it should or I wouldn't have listed the package name in my request... IE per the proposal in the issue description:
all 4 of these commands result in the same outcome: the system now has the latest version of packagename that's less than 8.13 (either it was installed or it was upgraded). The command result was the same with/without the 6. Specifying the 6 was pointless. So why not just just use Package dependencies SHOULD be expressive and support ranges. But from the command line, ranges don't provide any benefit that I can see; it's just extra characters to type. I haven't yet thought of a scenario where a cli operation includes
That's already in the original proposal of this issue, so it seems like it belongs here. But maybe this issue should be split into 2 issues? |
I can foresee a reason where the bottom end of a range could have an effect
Means I require the latest version of Just like if I were to run this today:
and if the latest version of Also I see no reason why
couldn't by an alias for
This could be a valid use case if someone has multiple consumers with access to different Chocolatey sources (or different permissions on those sources). For example, I could have an Alpha-Testers, Beta-Testers, and Pre-Release-Testers source, and if I let my consumers know that my changes will require them to have Then maybe the Alpha-Testers grab 5.12, the Beta-Testers get 4.0, and the Pre-Release-Testers get a message from Chocolatey that their sources cannot meet this version requirement. And every one of them was able to do this running the same command.
Chocolatey not installing an unneeded version of a package is a much better user-scenario then installing a version that won't work for their use case. |
The choco can lookup all versions like Why are currenly no versioning constraints supported? I understand that is will need some modifications of the code and the data structures. For simplicity I would recommend starting with support only for the |
This would be very useful for Python. A leap from 3.7 to 3.8 will break a lot of things, and older versions of Python still receive updates. I'd really like to pin it to |
@ImportTaste a good temporal solution for this is creating your own meta package:
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>python37-pin</id>
<version>3.7</version>
<title>Python 3.7</title>
<owners>jack1142</owners>
<authors>Python Software Foundation</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description><![CDATA[Python 3.x is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python 3.x and see almost immediate gains in productivity and lower maintenance costs.]]></description>
<dependencies>
<dependency id="python3" version="[3.7,3.8)" />
</dependencies>
</metadata>
<files>
</files>
</package>
|
@jack1142 It's tied to both the python and python3 packages. Would I just add Also, should I unpin python and python3 after installing this? |
@ImportTaste nope, just python3, python is metapackage that uses python3 in the end. You may want to uninstall python meta package though. |
@jack1142 Can't, the python metapackage is a dependency to something else. I'm not sure this is working unfortunately. I followed your instructions to the letter and then I ran
|
@ImportTaste they worked just fine cause python didn't get upgraded though it is weird that chocolatey mentions <?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>python37-pin</id>
<version>3.7</version>
<title>Python 3.7</title>
<owners>jack1142</owners>
<authors>Python Software Foundation</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description><![CDATA[Python 3.x is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python 3.x and see almost immediate gains in productivity and lower maintenance costs.]]></description>
<dependencies>
<dependency id="python" version="[3.7,3.8)" />
<dependency id="python3" version="[3.7,3.8)" />
</dependencies>
</metadata>
<files>
</files>
</package> Edit: remember to repack the package with |
Damnit, I tried to correct that before you saw it. I actually typed out that last line manually because I missed it when I was transporting the text from my laptop to my desktop. I was mainly concerned with this warning it threw:
Why does this happen? |
@ImportTaste I'm sorry but actually you should forget my whole advice cause I just figured that chocolatey fails to update python 3.7.4 to 3.7.5 when having that "pin package" installed cause it wants to use python 3.8 which it obviously can't because of dependency but instead of trying to resolve it, it just doesn't upgrade python at all. |
I was directed here to this feature request by some comments regarding python version freezing - and I see that many of the comments here are actually related to python as well. I've logged a new ticket in chocolatey-community/chocolatey-packages#1602 to discuss a reevaluation of granularity for publishing python packages. This new ticket proposes that we think of "minor" Python version releases as if they were each major releases - adopting a strategy of publishing a new public meta-package for each in the chocolatey package directory starting with Would greatly appreciate this group's ideas and combined brain power there in that thread: |
Is there any news around that issue?
In the log file, I was presented with that stack trace:
I looked a bit in I just scratched the surface (I'm quite new to the codebase, and not that familiar with C#). |
This hasn't been assigned to a milestone and isn't something we're working on. Nuspec versioning doesn't work with the |
Dear developers, this feature request have 40 upvotes, please share the hapiness with us all! 🙏 |
Summary
Currently, issuing upgrades of packages restricted to a major version requires a unique id. This is typically done by appending the version to the id such as with community dotnet packages, e.g. dotnet3, dotnet4, etc.
Proposal
Use nuspec versioning (as already used in nuspec files to determine valid dependency version) to select version with choco. This could be for install/upgrade/pin etc.
Current
Proposed
For example, if you wanted to restrict install of a package to version
9.0
Just like when declaring a dependency in
*.nuspec
:one time use:
choco install example --version=[9.0,10.0)
stored use (pin):
choco pin add -n=example --version [9.0,10.0)
Adding #798 would be a very nice complement to this.
Related
Clickup task.
The text was updated successfully, but these errors were encountered: