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

[develop2] fix require and reference equality #12506

Merged
merged 3 commits into from
Nov 11, 2022

Conversation

memsharded
Copy link
Member

There is an error in 2.0 when two requires, one with revision and other without revision are used:

  • They do not conflict, they are not duplicate
  • They can hang the lockfile resolution, due to internal modification of keys in a dict

The tests make it explicit, but the problem is this situation can happen when a profile [tool_requires] collides with a recipe tool_requires, so it is not just about avoiding duplicates in requirements() method, the model must support it.

Alternatives I have tried:

  • Keeping the RecipeReference.__eq__ the same, and then adding a new RecipeReference.require_equal() that was used from Require.__eq__ to check if two requires are the same. This approach doesn't need to change the Lockfile.add()
  • The proposed one in the PR, in which I change the core RecipeReference.__eq__, that requires changing Lockfile.add(), and now produces an error for a situation that was allowed

@memsharded memsharded added this to the 2.0.0-beta5 milestone Nov 10, 2022
@memsharded memsharded marked this pull request as ready for review November 11, 2022 11:14
@czoido czoido merged commit 6578019 into conan-io:develop2 Nov 11, 2022
@memsharded memsharded deleted the fix/develop2_require_equality branch November 11, 2022 11:24
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.

3 participants