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 520 forks source link

Can't install prerelease with `>=` contraint #2514

Open 304NotModified opened 7 years ago

304NotModified commented 7 years ago

Description

I can't update my package to a prerelease version.

Repro steps

1.run paket update nuget Core version 9.7-PRimageresizeal-r329 (this is a private feed)

Expected behavior

I could update a package to a prerelease version larger than 8.0

Actual behavior

I get the error:

Resolving packages for group Main:
 - Core is pinned to 9.7-PRimageresizeal-r327
 - MVC 9.1.0
   Incompatible dependency: Core >= 8.0 conflicts with resolved version 9.7-PRimageresizeal-r327
   Incompatible dependency: Core >= 8.0 conflicts with resolved version 9.7-PRimageresizeal-r327
 - MVC 9.0.0
   Incompatible dependency: Core >= 8.0 conflicts with resolved version 9.7-PRimageresizeal-r327

I don't get it. 9.7-PRimageresizeal-r327 >= 8.0? Also tried creating a package with 9.7.0-PRimageresizeal-r327, same result

notes: Updating to 9.6 (non-prerelease) works.

Paket version 5.2.5

Known workarounds

None. Tried also updating the paket.dependencies with the fixed prerelease version, same error

Thanks in advance!

forki commented 7 years ago

can you try newer paket version?

304NotModified commented 7 years ago

with Paket version 5.6.10, almost the same issue: can't install it

Tried 9.7-PRimageresizeal-r329 and 9.7.0-PRimageresizeal-r329

paket update Core --version 9.7-PRimageresizeal-r329
Paket version 5.6.10
Updating Core to version 9.7-PRimageresizeal-r329 in C:\project\paket.dependencies group Main
Performance:
 - Runtime: 1 second
Paket failed with:
-> Version 9.7-PRimageresizeal-r329 doesn't match the version requirement >= 9.0 < 10.0 for package Core that was specified in paket.dependencies
paket update Core --version 9.7.0-PRimageresizeal-r329
Paket version 5.6.10
Updating Core to version 9.7.0-PRimageresizeal-r329 in C:\project\paket.dependencies group Main
Performance:
 - Runtime: 1 second
Paket failed with:
-> Version 9.7.0-PRimageresizeal-r329 doesn't match the version requirement >= 9.0 < 10.0 for package Core that was specified in paket.dependencies
paket --version
Paket version 5.6.10
forki commented 7 years ago

Ok I think I need a repro.

304NotModified commented 7 years ago

I will try an older paket first. It worked and I spent already to much time in installing a package.

304NotModified commented 7 years ago

mmm even with Paket 4 it won't work.

Tried also constrains like ~> 9, >= 9, <10, > 9.6, < 9.7, all of them won't match the version requirement with "9.7-PRimageresizeal-r329". Tried also "9.7-PRimageresizeal" as package name, the same.

What's the official way to denote a prelease version?

forki commented 7 years ago

does the following line in the deps file work:

 nuget Core == 9.7-PRimageresizeal-r329

?

304NotModified commented 7 years ago
 nuget Core 9.7-PRimageresizeal-r329

works, but then it got stuck somewhere else als the requirement in a dependency is >= 8

forki commented 7 years ago

that's why I asked for ==

304NotModified commented 7 years ago

same as without ==.

Tried now 9.7-beta1 (renamed the package),

got then:

Incompatible dependency: Core >= 8.0 conflicts with resolved version 9.7-beta1

forki commented 7 years ago

What about nuget Core prerelease ?

304NotModified commented 7 years ago

yes that works!

304NotModified commented 7 years ago

~for 9.7-beta1 it worked, but not for 9.7-PRtexttemplated-r284~

it works for the latest Paket 5.6.10, not Paket 5.2.5

forki commented 7 years ago

OK that are 2 issues now. Give me a sec - I will try something.

But I guess at least you have a workaround for now, right?

forki commented 7 years ago

just for confirmation:

nuget Core 9.7-beta1 did not work nuget Core prerelease did work

?

304NotModified commented 7 years ago

OK that are 2 issues now. Give me a sec - I will try something.

I think it's one issue, updated mu post.

But I guess at least you have a workaround for now, right?

Yes, thanks!

304NotModified commented 7 years ago

just for confirmation:

nuget Core 9.7-beta1 did not work nuget Core prerelease did work

?

Indeed

To be complete:

this works: (in paket.dependencies)

this won't (in paket.dependencies)

While doing:

paket update nuget Core version 9.7-beta1
forki commented 7 years ago

ok this is really weird.

I just tried with @stift's repro from https://github.com/fsprojects/Paket/issues/2471

it has

source Externals/NugetStore

nuget PackageA
nuget PackageB 1.0.11204-custom

and I tried:

paket.exe update nuget PackageB --version 1.0.11204-custom

and it worked with latest paket. Can you spot the difference?

304NotModified commented 7 years ago

"nuget PackageB 1.0.11204-custom" could work depending of PackageA.

I'm my repo PackageA has dependency PackageB >= 1.0

forki commented 7 years ago
NUGET
  remote: Externals/NugetStore
    PackageA (1.0.11250)
      PackageB (>= 1.0 < 2.0)
    PackageB (1.0.11204-custom)
304NotModified commented 7 years ago

maybe it was the issue that the .lock file was in the old format. I see a lot has been changed. Will try to test that

304NotModified commented 7 years ago

does nuget PackageB ~> 1.0 work for

paket.exe update nuget PackageB --version 1.0.11204-custom

?

forki commented 7 years ago

no you need to specify in the deps file that you want a prerelease. This can be dpne with either:

nuget PackageB 1.0.11204-custom

or

nuget PackageB prerelease
304NotModified commented 7 years ago

nuget PackageB ~> 1.0 prelease is also not supported?

forki commented 7 years ago

nuget PackageB ~> 1.0 prelease should work

304NotModified commented 7 years ago

OK, will test that today. Thanks!

jamescrowley commented 6 years ago

Is there any way around this without updating the paket.dependencies file? Just hit this today too.

forki commented 6 years ago

@jamescrowley you hit what exactly?

jamescrowley commented 6 years ago

We have a paket.dependencies file that said:

nuget FundApps.RulePackage.TestApi >= 1.0.34196

and sometimes as part of our build process, we do

.paket\paket.exe update FundApps.RulePackage.TestApi --version 1.0.35691-beta

to test against a beta version, which now fails with

Version 1.0.35691-beta doesn't match the version requirement >= 1.0.34196 for package FundApps.RulePackage.TestApi that was specified in paket.dependencies

Checking with the team, looks like we bumped the version of paket a while back which has probably broken this. Still broken on the latest version of paket.

Is this expected behaviour now, or a bug?

jamescrowley commented 6 years ago

We bumped from version 3.6.0, which probably isn't that helpful.... (!)

forki commented 6 years ago

mmm I guess it's expected because it conflicts the deps file.