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

Fix floating version comparison in new dependency resolver #6187

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Dec 9, 2024

Bug

Fixes: NuGet/Home#13992

Description

The dependency resolver uses a comparison that was not taking into account floating versions. This is because the VersionRange object has special logic that was missed:

IsFloating == other.IsFloating &&
EqualityUtility.EqualsWithNullCheck(Float, other.Float);

This change updates the version range comparison to take into account floating versions which fixes the reported issue where restore is resolving the wrong graph in some situations.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@jeffkl jeffkl self-assigned this Dec 9, 2024
@jeffkl jeffkl requested a review from a team as a code owner December 9, 2024 23:49
martinrrm
martinrrm previously approved these changes Dec 9, 2024
@jeffkl jeffkl dismissed stale reviews from zivkan and martinrrm via fcc3fd9 December 10, 2024 17:35
@jeffkl jeffkl requested review from zivkan and martinrrm December 10, 2024 17:36
Nigusu-Allehu
Nigusu-Allehu previously approved these changes Dec 10, 2024
jgonz120
jgonz120 previously approved these changes Dec 10, 2024
@jeffkl jeffkl dismissed stale reviews from jgonz120 and Nigusu-Allehu via 2135e69 December 16, 2024 18:54
@jeffkl jeffkl force-pushed the dev-jeffkl-floating-versions branch from fcc3fd9 to 2135e69 Compare December 16, 2024 18:54
@jeffkl jeffkl enabled auto-merge (squash) December 16, 2024 19:31
@jeffkl jeffkl merged commit 58c381a into dev Dec 16, 2024
22 of 23 checks passed
@jeffkl jeffkl deleted the dev-jeffkl-floating-versions branch December 16, 2024 20:23
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.

New dependency resolver does not handle floating versions correctly in some situations
6 participants