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 dependency locking for path source #4293
Conversation
Thanks for opening a pull request and helping make RubyGems and Bundler better! Someone from the RubyGems team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality. We use GitHub Actions to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of GitHub Actions in the PR status window below. If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #rubygems or #bundler channel on Slack. For more information about contributing to the RubyGems project feel free to review our CONTRIBUTING guide |
old_runtime_deps = s.dependencies.select {|d| d.type != :development } | ||
# If the dependencies of the path source have changed and locked spec can't satisfy new dependencies, unlock it | ||
next unless new_runtime_deps.sort == old_runtime_deps.sort || new_runtime_deps.all? {|d| satisfies_locked_spec?(d) } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It fixes https://github.com/ayanko/bundler-gemspec-issue.
Not sure how does it impact on other cases.
Method converge_locked_specs
is huge and complicated.
Should we split it to more multiple methods to increase clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be my guest!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome @mtsmfm, thanks so much!
We have a whole different logic for unlocking path sources under converge_paths
, so I don't see any immediate issues with doing this.
Plus, I'm strongly opposed to rejecting PRs that remove code, fix an issue and add a spec for the fixed issue. 😃
Fix dependency locking for path source (cherry picked from commit a127c6c)
What was the end-user or developer problem that led to this PR?
Fix #4098
What is your fix for the problem, implemented in this PR?
To be honest, I don't have enough confidence though I think these dependency check is not necessary because no test fails.
It was added in rubygems/bundler@19192a3 and the test still be there.
rubygems/bundler/spec/install/gemfile/path_spec.rb
Lines 503 to 521 in 9b50ef6
Please let me know if you find a problem with this change.
Make sure the following tasks are checked