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

Better deal with circular dependencies #6330

Merged
merged 2 commits into from
Feb 2, 2023
Merged

Better deal with circular dependencies #6330

merged 2 commits into from
Feb 2, 2023

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Feb 1, 2023

What was the end-user or developer problem that led to this PR?

When a dependency includes a version with circular dependencies, and the resolver ends up considering it, it gives up with a confusing error.

What is your fix for the problem, implemented in this PR?

Ignore these ill-defined versions.

Fixes #6328.

Make sure the following tasks are checked

This reverts commit a8348d2, and
introduces the alternative approach of ignoring this kind of candidate.
@deivid-rodriguez
Copy link
Member Author

Spec added!

@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review February 2, 2023 13:23
@deivid-rodriguez
Copy link
Member Author

Actually let me try a slightly better approach.

@deivid-rodriguez deivid-rodriguez marked this pull request as draft February 2, 2023 13:36
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review February 2, 2023 14:27
@deivid-rodriguez
Copy link
Member Author

deivid-rodriguez commented Feb 2, 2023

Alright so the new approach is:

  • If the self-referencing dependency is simply redundant, ignore the dependency but consider the version. This makes the case in Bundler: Could not find compatible versions for standalone_migrations + rack combo #6328 now resolve to the self-referencing version, which seems correct (2.0.4) since it's the highest one that meets all requirements.

  • If the self-referencing dependency is incompatible with itself, then we completely ignore the version as a candidate for resolution. I've never seen such an ill-defined gem, but I believe it's currently possible to push such gem, so I handled this just in case.

We should probably raise a validation warning on gem build for the first case above, and an error for the latter.

@deivid-rodriguez
Copy link
Member Author

I also proposed a similar change upstream.

@simi
Copy link
Member

simi commented Feb 2, 2023

🤔 I can take over to introduce gemspec validations once merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bundler: Could not find compatible versions for standalone_migrations + rack combo
2 participants