-
Notifications
You must be signed in to change notification settings - Fork 520
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
Update getResolverStrategy for rootRequirements #3670
Conversation
When root requirement, us the resolver strategy for direct dependencies. Even if it also has other requirements
…File These should not be considered as "top level"
79a7982
to
12748c2
Compare
These dependencies are specified in the dependencies file As a result, we should get the latest version of them
@forki this change does update tests...but i think that the tests contradict the documented behaviour. In these tests, the dependencies are specified in the paket.dependencies file |
…quirements is treated like a direct
Is there anything more needed from me to get this merged? |
@@ -159,7 159,7 @@ let ``should favor strategy from parent that overrides strategy``() = | |||
let resolved = | |||
DependenciesFile.FromSource(config) | |||
|> resolve graph2 UpdateMode.UpdateAll | |||
getVersion resolved.[PackageName "Castle.Windsor"] |> shouldEqual "3.2.1" | |||
getVersion resolved.[PackageName "Castle.Windsor"] |> shouldEqual "3.3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this increased? I thought we use min strategy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test:
let graph2 =
OfSimpleGraph [
"Nancy.Bootstrappers.Windsor","0.23",["Castle.Windsor",VersionRequirement(VersionRange.AtLeast "3.2.1",PreReleaseStatus.No)]
"Castle.Windsor","3.2.0",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.2.0",PreReleaseStatus.No)]
"Castle.Windsor","3.2.1",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.2.0",PreReleaseStatus.No)]
"Castle.Windsor","3.3.0",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.3.0",PreReleaseStatus.No)]
"Castle.Windsor-NLog","3.2.0.1",["Castle.Core-NLog",VersionRequirement(VersionRange.AtLeast "3.2.0",PreReleaseStatus.No)]
"Castle.Windsor-NLog","3.3.0",["Castle.Core-NLog",VersionRequirement(VersionRange.AtLeast "3.3.0",PreReleaseStatus.No)]
"Castle.Core-NLog","3.2.0",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.2.0",PreReleaseStatus.No)]
"Castle.Core-NLog","3.3.0",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.3.0",PreReleaseStatus.No)]
"Castle.Core-NLog","3.3.1",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.3.1",PreReleaseStatus.No)]
"Castle.Core","3.2.0",[]
"Castle.Core","3.2.1",[]
"Castle.Core","3.2.2",[]
"Castle.Core","3.3.0",[]
"Castle.Core","3.3.1",[]
]
.....
[<Test>]
let ``should favor strategy from parent that overrides strategy``() =
let config = """
strategy max
source http://www.nuget.org/api/v2
nuget Nancy.Bootstrappers.Windsor !~> 0.23
nuget Castle.Windsor
nuget Castle.Windsor-NLog !> 0
"""
let resolved =
DependenciesFile.FromSource(config)
|> resolve graph2 UpdateMode.UpdateAll
getVersion resolved.[PackageName "Castle.Windsor"] |> shouldEqual "3.3.0"
getVersion resolved.[PackageName "Castle.Windsor-NLog"] |> shouldEqual "3.3.0"
getVersion resolved.[PackageName "Castle.Core-NLog"] |> shouldEqual "3.3.0"
getVersion resolved.[PackageName "Castle.Core"] |> shouldEqual "3.3.0"
getVersion resolved.[PackageName "Nancy.Bootstrappers.Windsor"] |> shouldEqual "0.23"
is set to max but more importantly has Castle.Windsor as a top level dependency. So should take the latest version
thank you |
When root requirement, us the resolver strategy for direct dependencies.
Even if it also has other requirements
Attempted fix for #3669
And meaning that the statement
that all direct dependencies will still get their latest matching versions, no matter the value of the strategy option. If you want to influence the resolution of direct dependencies then read about the lowest_matching option.
in the docs is actually correct