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
Make sure bundle update <specific_gems>
can always update to the latest resolvable version of each requested gem
#7558
Conversation
077d688
to
c0a65f5
Compare
bundle update <specific_gems>
can always update to the latest resolvable version of each requested gem
It took me a while to figure this out, but I think I found the best approach to tackle this 🎉. I realized that the initial approach here was too naive and could result in unnecessary updates unrelated to updating the requested gems. I had also only implemented the solution for I figured out a better algorithm which is the following. When As a nice extra, this approach should make it easier to implement further improvements, like #3290. |
c0a65f5
to
99e2b56
Compare
Since resolution options don't change.
To make sure we can always update to the latest resolvable version for each gem explicitly requested for update, we first run a full update, and then add explicit exact requirements to the resolved versions. This may lead into conflicts, but our resolver already automatically parses those and unlocks additional gems to fix them.
99e2b56
to
01c0bf3
Compare
Make sure `bundle update <specific_gems>` can always update to the latest resolvable version of each requested gem (cherry picked from commit d95430f)
What was the end-user or developer problem that led to this PR?
Sometimes
bundle update foo
won't actually update foo, even if a cleanbundle install
will resolve to a higher version of foo than the one currently locked.The problem is that other locked dependencies may be setting some constraints on dependencies of foo, preventing it from being upgraded. These locked dependencies are not present on a clean
bundle install
.What is your fix for the problem, implemented in this PR?
My fix is, if
bundle update foo
is requested, and initial try did not update foo, try unlocking other gems, even if they are not dependencies of foo. Keep doing this until foo updates, or it's not possible to unlock more gems.Fixes #3310.
Fixes #5463.
Fixes #7176.
Supersedes #5520.
Make sure the following tasks are checked