Skip to content
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

Selective update resolves the graph for selected package #957

Merged
merged 12 commits into from
Aug 4, 2015

Conversation

mrinaldi
Copy link
Contributor

@mrinaldi mrinaldi commented Aug 3, 2015

This PR fixes the behavior of selective update (update specifying a package).

The current behavior is to pin the version for all packages, except the one specified, and resolve the whole graph.

This would cause the dependencies of the specified package to be pinned and the package would not be updated if it requires that one or more dependencies need to be updated as well.

For example:
Castle.Core-log4net 3.2.0 depends on Castle.Core >= 3.2.0
Castle.Core-log4net 3.3.3 depends on Castle.Core >= 3.3.3

If I try to update Castle.Core-log4net from 3.2.0 to 3.3.3, it would not succeed because Castle.Core is pinned to 3.2.0.

This PR only resolve the specified package graph.

@forki
Copy link
Member

forki commented Aug 4, 2015

selective update should unpin all transitive package dependencies right now. do you have a repro case?

@forki
Copy link
Member

forki commented Aug 4, 2015

OK, seems you are right and we have a regression.

I tested the following deps file:

source https://nuget.org/api/v2

nuget Castle.Core-log4net

with lock file:

NUGET
  remote: https://nuget.org/api/v2
  specs:
    Castle.Core (3.2.0)
    Castle.Core-log4net (3.2.0)
      Castle.Core (>= 3.2.0)
      log4net (1.2.10)
    log4net (1.2.10)

and it didn't update after paket update nuget Castle.Core-log4net. That is weird. I will now look into your PR.

@@ -47,12 +47,12 @@ let ``should parse lock file``() =
packages.[1].Source |> shouldEqual PackageSources.DefaultNugetSource
packages.[1].Name |> shouldEqual (PackageName "Castle.Windsor-log4net")
packages.[1].Version |> shouldEqual (SemVer.Parse "3.3")
packages.[1].Dependencies |> shouldEqual (Set.ofList [PackageName "Castle.Windsor", VersionRequirement.AllReleases, []; PackageName "log4net", VersionRequirement.AllReleases, []])
packages.[1].Dependencies |> shouldEqual (Set.ofList [PackageName "Castle.Windsor", VersionRequirement(Minimum(SemVer.Parse "2.0"), PreReleaseStatus.No), []; PackageName "log4net", VersionRequirement(Minimum(SemVer.Parse "1.0"), PreReleaseStatus.No), []])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did these tests change?

@forki
Copy link
Member

forki commented Aug 4, 2015

mhm from looking at the existing code I'm not that sure anymore that this worked before. maybe it only worked in my dreams.

so:

hug

@forki forki merged commit 501a4dd into fsprojects:master Aug 4, 2015
@mrinaldi mrinaldi deleted the selective_update branch August 4, 2015 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants