-
Notifications
You must be signed in to change notification settings - Fork 258
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
NuGet 3.4 fails to install package ending with zero #2298
Comments
What type of source are you installing from? Online v2? Online v3? Local disk? |
I use ProGet server (http://inedo.com/proget) which supports v2 source. |
@NN--- would you be able to try this using NuGet in Visual Studio with the same proget server and let me know if it works there? https://dist.nuget.org/visualstudio-2015-vsix/v3.4.0-rc/NuGet.Tools.vsix There have been some changes in the V2 protocol and it would help to know if this is a problem in the install command, or if NuGet has a general problem with proget servers and non-normalized package versions. |
Both don't work. ProGet server can be downloaded and installed for free if you want to check it directly. |
I didn't repro this with ProGet on my machine, so can you specify -Verbosity in command Line, then you can see all http call. try the http call, I guess it returns invalid xml. |
|
This what I get with nuget 3.4 RC:
This what I have with 3.3:
|
This is HTTP request of 3.4:
And this is of 3.3
ProGet differs 1.1.1 from 1.1.1.0 that's why it doesn't work with NuGet 3.4. |
That looks like a bug in ProGet, the ID is identical. I don't want to fix this in NuGet this late close to the release of 3.4, either fix the packages or contact ProGet to update their API |
If it is bug in ProGet then It is a bug in all older NuGet versions. In case this will be a default behavior with no regrets , please document it as a breaking change since now you cannot install a package which you could. |
The bug is that the server doesn't respect normalized versions, nuget is making an API call with a normalized version.
I'm not aware of such an issue, that is a breaking change and we will fix it in 3.3. |
I see what you mean. |
I just checked w/ the team here. We had to specifically implement the “4th part quirk” because NuGet (as of 3.3 and earlier treated) considers these as different versions. A significant number of packages and users relied on this behavior (and we received a lot of complaints about this) which is why we specifically added it. Note that NuGet 3.3 and earlier also has the “leading zeros quirk” (for example, 1.01.0 ?= 1.1.0, depending on the query), but we chose not to implement that because only handful of packages (including, I think Ninject or Rhino or something?) used leading zeros to differentiate packages. We agree in principle that "1.1.1 == 1.1.1.0" are identical. But since NuGet 3.3 and earlier (as well as lots of users) disagree, our principle didn't really matter here... however we did stick to our principle that "1.1.1 == 1.01.1". ProGet does not support that, where asNuGet does. To be honest we really didn't want to have to implement the "4th part quirk", and would greatly prefer using semantic versioning (like we do with other package formats), but it's been there since NuGet 1.x, and people use and rely on it. I agree with @nn that this is a breaking change and should be documented as such. It's kind of a big one. We've been getting quite a few complaints about this one already from 3.4-RC users, so it's gonna be a bit of a pain for them, because all we can tell them is "don't upgrade or don't rely on that behavior". |
Hey Alex, I guess the ask is to respect the query but return the metadata as is in the nuspec, that wouldnt be a breaking change. Will double check on our side. |
I'm not sure I understand? NuGet 3.3 and earlier already supports A-1.1.0 and A-1.1.0.0 in the same feed. So, they are currently considered different packages. I think the existing behavior is strange... but seems like it'd be even stranger to specify:
And then this will be even stranger when you consider "connectors" that aggregate multiple feeds. Which basically, everyone in a environment uses. We really can't drop support for the "4th part quirk" in ProGet anytime soon, because many people are still on NuGet 2.x and rely on this behavior. At best, we could do a hack like "enable 4th part quirk mode" on a feed. If you make this change, then it's a breaking API change. NuGet users are used to that. But please please please strongly document it in the release notes as a breaking change, so we can at least point the onslaught of users to that instead and advise them not to upgrade or not to rely on the behavior. |
That's not what we are saying: 1.1 is the same as 1.1.0 in terms of version equality, you cannot and should not have both of them on the same feed. Never However when you restore a package nuget2 uses the nuspec ID to put it in the solution packages folder. Nuget 3 does the same, but normalizes it in the global packages folder. There is no change here other than allowing a search/download request to find the package based on the normalized version. You still need to return the original ID from the nuspec. If you still have concerns let's get on Skype/phone and hash because we are locking down the rtm release and id like to address this if I'm in the wrong |
@yishaigalatzer That is reasonable for me. I don't have duplicates. |
👍 -- we'll see how many folks notice, and enforce it on the ProGet end at some point (maybe as an option, maybe not). I think it's easy enough simply not to upgrade if it's that big of a deal. |
@apapadimoulis Will it be possible given package 1.1.0.0 to ask for 1.1 and get the package successfully ? |
@NN--- I'm afraid not, because then that would be a breaking change on the server side, as 3.4 and pre-3.4 resolution logic is incompatible. So for now, I would suggest to simply not upgrade to 3.4 if you rely on pre-3.4 logic. |
It is not a problem for me to add the same package of 1.1.1.0 with version 1.1.1 and have both in the server. I don't know how many people have really different packages with trailing zeros. |
@apapadimoulis that is not a major breaking change, and you should absolutely support it. Duplicate packages of the same version is a non-scenario. |
@yishaigalatzer I'd thought so too... except there were a lot of folks that had A-1, A1.0, A-1.0.0, etc. in their feed, so we had to implement it to allow them to migrate or use connectors to existing feeds... But I agree, they probably aren't relying on "1.0.0" returning PACKAGE_NOT_FOUND if there is a "1.0.0.0" in the feed. So, we could ship that as a 3.4-compatiability maintenance version if needed. So just to make sure I understand the specs...
|
Short term, we plan to improve the 3.4 behavior as follows - And we will put bits in your hands as soon as they are ready (on the myget nugetbuild feed). 3.4 client will send a normalized version first which is 3 digits or 4 as applicable.
Also we identified that the root issue in the proget repo is that it returns a 200/html instead of 404 for that request. So lets get that fixed as well. If we get a 404 we will get all versions of the packages and pick it from there (this is already in the code but failed because of the 200/html response) |
We are now observing HTTP status codes correctly for V2 feeds with NuGet/NuGet.Client#374. |
NuGet.Server now also supports normalized versions. |
I applied the fix, as mentioned above and @zhili1208 validated this on NuGet.org, ProGet, and NuGet.Server. |
Is this fix up on the VS Extensions and Updates manager? I looked for updates on Nuget Package Manager and found nothing. |
@fahadash Yes, what version do you have installed? |
@yishaigalatzer I have 3.4.4.1321 . I installed VS 2015 Update 2 and it works fine now. Thanks. |
I have package "A" with version 1.1.1.0 .
Prior 3.4 this command works well:
With NuGet 3.4 RC I get:
The text was updated successfully, but these errors were encountered: