Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Support package restore to work with "highest" while following constraints #2657

Closed
giggio opened this issue Sep 9, 2015 · 7 comments
Closed
Milestone

Comments

@giggio
Copy link
Contributor

giggio commented Sep 9, 2015

We need to be able to tell dnu (and VS) to restore the highest available version from a dnx package. Right now it always resolves to lowest.

For example, if my app dependes on "[1,2)", this means I depend on at least version 1, and I accept anything up to version 2. But if 1.0.0 and 1.1.0 exist, dnu will always get 1.0.0.
There is no config at this moment that allows dnu to get the highest available version that works with a version spec. A higher version will only be selected if there is another package restricting the dependence to a higher range.

This is really important for package authors for fixing security issues, releasing minors, etc.

Node is a good example on how to work this.
Node allows patch updates with ~, like ~1.0.0 (anything from 1.0.0 to 1.1.0 - not included) and minor updates with ^, like ^1.0.0 (anything from 1.0.0 to 2.0.0 - not included).
Node also allow for wildcards with the x, like 1.x (anything greater or equal to 1.0 and lower than 2).

@davidfowl
Copy link
Member

We're not going to diverge from the nuget behavior. We currently don't support 1.* but nuget does. So possible we may do something more with wild cards in the future but you should file an issue on nuget as well.

@giggio
Copy link
Contributor Author

giggio commented Sep 9, 2015

@davidfowl Opened issue on nuget: NuGet/Home#1360
I don't care much about the format dnu uses for informing ranges, as long I can inform, on project.json, per dependency, how I want them to be fetched, if using lowest or highest versions. If you choose to use 1.x, or ^1.0, that is fine. I would only add that ^1.0 conveys more info, as I could say "at lest version 1.3 up to 2" with ^1.3, while 1.x would mean "anything from 1.0 or higher up to 2", there is no way to specify a minimum minor version (or patch). And if it is an x or a *, it makes no difference. Just pick a format, but please support this.

@muratg muratg modified the milestones: 1.0.0 backlog, Discussion Sep 9, 2015
@giggio
Copy link
Contributor Author

giggio commented Sep 12, 2015

@davidfowl Ok, per the latest comment by @emgarten on the nuget repo (NuGet/Home#1360 (comment)) nuget already dupports that with 1.*, which will take the highest dependency available, not the lowest. So if an app specify dependency A as 1.* and versions 1.0 and 1.1 are available, using nuget today, 1.1 would be chosen.
Is this coming to dnu? I expect the answer to be yes, as you said you are not diverging from the nuget behavior. Can we expect that on the 1.0 release of dnx?

@davidfowl
Copy link
Member

@giggio no promises but we do want to eventually use the nuget code base and have been slowly moving in that direction.

@giggio
Copy link
Contributor Author

giggio commented Sep 12, 2015

Ok, at least we know that this will be supported on dnu at some point.

@giggio
Copy link
Contributor Author

giggio commented Feb 21, 2017

@davidfowl I see you closed the issue. Is this planned somehow, or tracked elsewhere? Or dropped?

@davidfowl
Copy link
Member

Dropped, none of these issues are being tracked. I recommend filing an issue on nuget.

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

No branches or pull requests

3 participants