-
Notifications
You must be signed in to change notification settings - Fork 525
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
Packing with prerelease dependencies #1316
Comments
I think we create a wrong version requirement here. Do you know what NuGet would create in package B? |
I'm not quite sure, but from what I understood, there are no prerelease information injected in the dependency version requirement. In the previous example, B should only have a dependency on A with version "1.0.0", not "1.0-prerelease". Then, if we pull on a stable version of package B, it should pull a stable version of B and a stable version of A (e.g. "A 1.0.0"). Likewise, if we specify the B package to be unstable in the .dependencies file, it should pull on the latest version of B and A (including prereleases, but not excluding stable releases, e.g. "A 1.0.0-unstableXX). The applications for "=" dependencies are not that numerous, but the applications for dependency ranges are a bit more problematic. |
I'm investigating the case - It's seems to be a bug, but I don't think the solution is like what you describe. Prerelease flags are not transitive across packages and their dependencies. |
I fixed a bug in this area in 2.39.9 but I assume it's not directly the one that impacts you. |
Sorry for the delay, here is a repro sample : https://github.com/franknarf8/paket-issue-repro/tree/d75918899bc5d65d90dc2cc36bbe847c68814590 |
wow very cool repro sample. Looks like a very very strange edge case. If you repack B with the latest Paket version then it should work. |
Thanks, but I think there is still an issue. Thing is, now if the official A.2.0.0 package is out and A.2.1.0-unstableN also exists, the constraint "B depends on (A 2.0 prerelease)" won't be respected as the package A.2.1.0-unstableN will be selected. I updated the repro repo. |
Should I open a new issue? @forki |
the question is: what dependency would we need then? |
"A (>= 2.0.0-prerelease < 2.0.1)" ? |
As the package version timeline goes like so : I think the constraint "B depends on (A 2.0 prerelease)" should resolve to the closest thing to A.2.0.0. In this case, the possible answers would be [A.2.0.0-unstable2, A.2.0.0-unstable3, A.2.0.0]. I'm not quite sure how to represent this range though. Maybe something like "A (>= 2.0.0-prerelease <= 2.0.0)" |
But even then, it depends on how ">= 2.0.0-prerelease" is evaluated. |
[2.0.0-prerelease,2.0.0] works with your sample. I will create a hotfix |
released |
I just tested it, it works for everything between A.2.0.0-prerelease and A.2.0.0. Thing is now, if I only have a package A.2.0.0-alpha2, it will be ignored and resolution will crash as it is not in the range. |
We would need the smallest valid prerelease name for the min delimiter in [2.0.0-prerelease,2.0.0]... |
[2.0.0-prerelease,2.0.0] should match 2.0.0-alpha2 - that's another bug 2016-01-07 18:58 GMT+01:00 franknarf8 notifications@github.com:
|
ok this is now fixed as well. |
That is awesome, thanks a lot! Now I think there may still be an issue with the ~> operator for prereleases. B resolves correctly to A.3.0.0-alpha1 and creates a package with the following dependency "A(>= 2.0.0-prerelease && < 3.0.0-prerelease)" Unfortunately C still resolves A to A.2.1-unstable1 instead of A.3.0.0-alpha1. See this commit : I think B dependency should be this following range [2.0.0-prerelease, 3.0.0). |
why should ~> 2.0 resolve to 3.0? |
Not to 3.0, but 3.0-alpha. I thought "~> 2" meant everything in the range "[2,3)" and since A.3.0.0-alpha1 < A.3.0.0, it is in the "[2,3)" range. Correct me if I'm wrong, but should "~> 2.0 prerelease" or "[2.0, 3) prerelease" be compatible with the following packages : (and not with the following ones : 2.0.0-alpha, 3.0.0) |
no we should not accept 3.0 prereleases when using ~> 2 since it will probably already break. |
Ok, that makes sense. But then, B should not resolve "~> 2 prerelease" to 3.0.0-alpha1 then, right? |
yes ~> 2 should not resolve 3.0.0-alpha1 - are we doing this? |
ouch. will fix later tonight ;-) |
Ok, if I understood properly, "~> 2.0 prerelease" Does not match : Right? |
Ok cool, thanks! |
"~> 2.0 prerelease" should match 2.0-alpha |
Hello,
Firstly, I want to mention I have been using Paket for a little while now and love the software.
Here is my problem,
I have 3 projects (A, B, C) where
B depends on (A 2.0 prerelease)
C depends on (B 1.0 prerelease)
A, B are libraries and are shipped in their respective nuget packages created using Paket. We are using SemVer with prerelease tags. (using GitFlow)
Nuget packages for A are usually named something like "A 1.0-unstable0021"
Projects B resolve correctly its dependency to A on "paket update". When we use "paket pack" for package B, it creates the following nuget dependencies,
A( = 1.0.0-prerelease)
The thing is, when we try to "paket update" C, it cannot resolve A. I think he is is looking for a package versionned exactly "1.0.0-prerelease".
(The problem also applies to prerelease ranges (~>, <, >, etc.))
I don't quite know how to solve this problem. Maybe it is a comprehension issue, but if it is not, I'd be happy to contribute.
The text was updated successfully, but these errors were encountered: