fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
2.02k stars 525 forks source link

paket silently downgrades all non-pinned pre version packages when running update or add #1542

Closed mlidbom closed 8 years ago

mlidbom commented 8 years ago

If you run any of the below commands in the attached folder SolrNet will be downgraded from the preversion installed:0.5.0-alpha2 to the latest stable version:0.4.0.4001

.\.paket\paket.exe update
.\.paket\paket.exe add nuget Newtonsoft.Json

I would expect the update command to have no effect at all. I would expect the add command to add Newtonsoft.Json without changing the version of SolrNet

PaketDowngradesPreVersions.zip

cdrnet commented 8 years ago

The included paket.dependencies file does not permit prereleases, so it updates to the newest version compliant with the dependencies file.

You can allow prereleases e.g. by adding prerelease to the SolrNet line, see Docs: PreReleases

forki commented 8 years ago

yes that's the reason. It detects that 0.5.0-alpha2 doesn't fit the requirements and fixes that. But I wonder why it does that on "add"!? newtonsoft should not affect the graph. I need to revist that part and see why we do that over there.

mlidbom commented 8 years ago

Thank you for spending time on that RTM @cdrnet I can certainly see how that behavior makes sense for update in a command line use case. Apologies for not having RTM carefully enough.

As @forki observes the behavior seems, at least, debatable in the add case. Should I edit the description to only include the add case as up for debate or should I just close this?

forki commented 8 years ago

I looked at the code. I think the resolver is working correct here. It tries to come up with something sound.