summaryrefslogtreecommitdiff
path: root/lib/bundler/resolver.rb
AgeCommit message (Collapse)Author
2022-10-18Merge RubyGems/Bundler masterHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/6214d00b2315ed37c76b1fbc1c72f61f92ba5a65 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Simplify SpecGroup creationDavid Rodríguez
https://github.com/rubygems/rubygems/commit/788e46e152 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Remove dead codeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/999b644708 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-09-12[rubygems/rubygems] Use a single hash to keep track of prereleasesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/9d7bd177b0
2022-09-12[rubygems/rubygems] Remove unnecessary sortingDavid Rodríguez
Already done by the gem version promoter. https://github.com/rubygems/rubygems/commit/aae2cc9fe0
2022-09-12[rubygems/rubygems] Let specs be sorted just once by the gem version promoterDavid Rodríguez
https://github.com/rubygems/rubygems/commit/3cea25a39d
2022-09-05Merge ↵Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/16c3535413afebcdbab7582c6017c27b5da8a8dc Notes: Merged: https://github.com/ruby/ruby/pull/6326
2022-08-25[rubygems/rubygems] Fix another regression for sorbetDavid Rodríguez
Recently a changed was introduced to update the resolver platforms after it has been created, in order to remove the "ruby" platform from it if it's to be removed from the lockfile. However, it did not update the `@resolving_only_for_ruby` instance variable in that case, so the resolver was not properly doing the right thing anymore. To fix this, I tweaked the code to restore not changing resolver platforms after the resolver has been instantiated. https://github.com/rubygems/rubygems/commit/8fbc30a1d0
2022-08-23Merge rubygems/bundler HEADHiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/6b3a5a9ab0453463381a8164efb6298ea9eb776f Notes: Merged: https://github.com/ruby/ruby/pull/6268
2022-08-06[rubygems/rubygems] Fix yanked gems being unintentionally update when other ↵David Rodríguez
gems are unlocked This is a regression from a change intended to raise errors when user puts a gem under an incorrect source in the Gemfile by mistake. To fix the issue, we revert the change that caused it and implement it in a different way that restores the resolver independency from real specifications. Now it deals only with names and versions and does not try to materialize anything into real specifications before resolving. https://github.com/rubygems/rubygems/commit/d2bf1b86eb
2022-07-27[rubygems/rubygems] Completely drop base parameter from indexDavid Rodríguez
This parameter was coupling the concept of lockfile with the index. I don't think it's necessary. Also I believe it's causing some flaky test failures, which might leak into realworld issues. They are like this: ```` Invoking `/opt/hostedtoolcache/Ruby/3.0.4/x64/bin/ruby -I/home/runner/work/rubygems/rubygems/bundler/spec -r/home/runner/work/rubygems/rubygems/bundler/spec/support/artifice/fail.rb -r/home/runner/work/rubygems/rubygems/bundler/spec/support/hax.rb /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle lock` failed with output: ---------------------------------------------------------------------- --- ERROR REPORT TEMPLATE ------------------------------------------------------- ``` NoMethodError: undefined method `identifier' for #<Gem::Specification:0x00005639ad0db0a0 @extension_dir=nil, @full_gem_path=nil, @gem_dir=nil, @ignored=nil, @bin_dir=nil, @cache_dir=nil, @cache_file=nil, @doc_dir=nil, @ri_dir=nil, @spec_dir=nil, @spec_file=nil, @gems_dir=nil, @base_dir=nil, @loaded=false, @activated=false, @loaded_from=nil, @original_platform="ruby", @installed_by_version=nil, @autorequire=nil, @date=2022-07-25 00:00:00 UTC, @description="This is a completely fake gem, for testing purposes.", @email="foo@bar.baz", @homepage="http://example.com", @name="win32-process", @post_install_message=nil, @signing_key=nil, @summary="This is just a fake gem for testing", @version=#<Gem::Version "0.8.3">, @authors=["no one"], @bindir="bin", @cert_chain=[], @dependencies=[<Gem::Dependency type=:runtime name="ffi" requirements=">= 1.0.0">], @executables=[], @extensions=[], @extra_rdoc_files=[], @files=[], @licenses=[], @metadata={}, @platform="ruby", @rdoc_options=[], @require_paths=["lib"], @required_ruby_version=#<Gem::Requirement:0x00005639ad0dbc80 @requirements=[[">=", #<Gem::Version "0">]]>, @required_rubygems_version=#<Gem::Requirement:0x00005639ad0dba50 @requirements=[[">=", #<Gem::Version "0">]]>, @requirements=[], @rubygems_version="3.2.33", @specification_version=4, @test_files=[], @new_platform="ruby", @full_name="win32-process-0.8.3", @has_rdoc=true, @license=["MIT"] win32-process-0.8.3> /home/runner/work/rubygems/rubygems/bundler/tmp/rubygems/lib/rubygems/specification.rb:2116:in `method_missing' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/remote_specification.rb:115:in `method_missing' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/lazy_specification.rb:34:in `eql?' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/index.rb:189:in `eql?' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/index.rb:189:in `search_by_dependency' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/index.rb:96:in `local_search' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/index.rb:64:in `unsorted_search' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/index.rb:60:in `search' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/resolver.rb:179:in `results_for' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/resolver.rb:113:in `search_for' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/resolver.rb:216:in `block in sort_dependencies' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/resolver.rb:207:in `each' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/resolver.rb:207:in `sort_by' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/resolver.rb:207:in `sort_dependencies' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb:60:in `block in sort_dependencies' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb:77:in `with_no_such_dependency_error_handling' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb:59:in `sort_dependencies' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:754:in `push_state_for_requirements' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:744:in `require_nested_dependencies_for' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:727:in `activate_new_spec' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:684:in `attempt_to_activate' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:254:in `process_topmost_state' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:182:in `resolve' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb:43:in `resolve' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/resolver.rb:50:in `start' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/resolver.rb:24:in `resolve' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/definition.rb:480:in `reresolve' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/definition.rb:283:in `resolve' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/definition.rb:181:in `resolve_remotely!' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/lock.rb:53:in `run' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:674:in `lock' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:31:in `dispatch' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:25:in `start' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/exe/bundle:48:in `block in <top (required)>' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/exe/bundle:36:in `<top (required)>' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle:23:in `load' /home/runner/work/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle:23:in `<main>' ``` ```` I think the issue is that now we eagerly materialize some base specifications before resolving in order to give better errors if user specified an incorrect source in the Gemfile. This means that the key for the index hash will have heterogeneous specification objects (some LazySpecification, some real Specification), and `LazySpecification#eql?` is incompatible with that. By dropping the base parameter from the index, we should no longer have these heterogenous objects as hash keys. https://github.com/rubygems/rubygems/commit/dc179d41c3
2022-07-26Merge rubygems/bundler HEADHiroshi SHIBATA
Merge from https://github.com/rubygems/rubygems/commit/2af2520b4a7ab1c6eb1fdc3d2ef4d8c062d96ad7 Notes: Merged: https://github.com/ruby/ruby/pull/6184
2022-07-13Merge RubyGems and Bundler masterHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6124
2022-06-24Sync RubyGems & Bundler with upstream repoDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/6054
2022-05-31[rubygems/rubygems] Give better conflict resolution adviceDavid Rodríguez
This alternative really uses only the Gemfile, and can never end up being absurd, because it will never be suggested when there's no lockfile, and it suggests deleting the lockfile. https://github.com/rubygems/rubygems/commit/5d154dd50e
2022-05-24[rubygems/rubygems] Fix crash when printing resolution conflicts on metadata ↵David Rodríguez
requirements https://github.com/rubygems/rubygems/commit/b69e1e9374
2022-05-20Merge RubyGems and Bundler HEADHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/125415593ead9ab69a9f0bb5392c9d7ec61b1f51
2022-04-28Merge ↵Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/3f7d0352e84b29d4a2d4cd93b31e5ebdb5f79cc6 Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-02-01Sync latest Bundler & RubyGemsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/5512
2022-01-19Merge rubygems/rubygems HEAD.Hiroshi SHIBATA
Picked at 12aeef6ba9a3be0022be9934c1a3e4c46a03ed3a Notes: Merged: https://github.com/ruby/ruby/pull/5462
2021-12-17[rubygems/rubygems] Improve errors a bit moreDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f481e8f41a
2021-12-17[rubygems/rubygems] Share gem not found logic with transitive dependencies tooDavid Rodríguez
https://github.com/rubygems/rubygems/commit/e4a1a9663d
2021-12-17[rubygems/rubygems] Remove unnecessary line breakDavid Rodríguez
https://github.com/rubygems/rubygems/commit/84e2d6a955
2021-12-17[rubygems/rubygems] Fix crash when no matching variants are found for the ↵David Rodríguez
current platform If we are resolving a dependency against a particular platform, and there are no platform specific variants of the candidates that match that platform, we should not consider those candidates. https://github.com/rubygems/rubygems/commit/f6077fe27d
2021-12-17[rubygems/rubygems] Improve error message if only platform doesn't matchDavid Rodríguez
https://github.com/rubygems/rubygems/commit/077e3c2e4d
2021-12-17[rubygems/rubygems] Improve resolver error messagesDavid Rodríguez
Use a more standard naming for gems. https://github.com/rubygems/rubygems/commit/75121e83f1
2021-12-03[rubygems/rubygems] Improve sources representationDavid Rodríguez
We have two representations of a source. Once used for sorting, which should not depend on the source's state, but solely on its static information, like remotes. Another one used for error and informational messages, which should properly inform about the exact state of the source when the message is printed. This commit makes the latter be the default implementation of `to_s`, so that error and informational messages are more accurate by default. https://github.com/rubygems/rubygems/commit/b5f2b88957
2021-12-01Merge rubygems master fd676ac464491afaa0baf5435cb11b3f86229cbdHiroshi SHIBATA
2021-08-31[rubygems/rubygems] Improve "gem not found in source" errorsDavid Rodríguez
When printing sources inside these error messages, it's useful to only consider the current state of the source. For example, when requiring `bundler/setup`, the source shouldn't be configured to be able to hit the network, so the error message should only mention "locally installed gems" to make that more clear. https://github.com/rubygems/rubygems/commit/30eb14f853 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Only set local variable in the branch using itDavid Rodríguez
https://github.com/rubygems/rubygems/commit/9fd39bd5a3 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Simplify error message building in resolverDavid Rodríguez
Since all requirements have an explicit source now (even if it's the default source). https://github.com/rubygems/rubygems/commit/2c341cfc22 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove redundant part of error messageDavid Rodríguez
It doesn't really add much, in my opinion. We want to be helpful, but also concise when possible. https://github.com/rubygems/rubygems/commit/9d56009cf7 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-07-07Sync latest bundler & rubygems development versionDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/4533
2021-05-11Sync bundler & rubygemsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/4367
2021-03-08Sync latest development version of bundler & rubygemsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/4143
2020-12-18Merge RubyGems 3.2.2 and Bundler 2.2.2Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3930
2020-12-15Prepare to release rubygems-3.2.1 and bundler-2.2.1Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3901
2020-12-08Merge prepare version of Bundler 2.2.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3864
2020-10-15Merge bundler-2.2.0.rc.2Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3659
2020-05-13Update the bundler version with master branchHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3086
2019-06-09Merge bundler master from upstream.Hiroshi SHIBATA
Pick from 8dd59e3ba97eb80a599f8149f31bf40773b69dc0
2019-04-14Merge Bundler 2.1.0.pre.1 as developed version from upstream.hsbt
https://github.com/bundler/bundler/commit/a53709556b95a914e874b22ed2116a46b0528852 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02Added bundler as default gems. Revisit [Feature #12733]hsbt
* bin/*, lib/bundler/*, lib/bundler.rb, spec/bundler, man/*: Merge from latest stable branch of bundler/bundler repository and added workaround patches. I will backport them into upstream. * common.mk, defs/gmake.mk: Added `test-bundler` task for test suite of bundler. * tool/sync_default_gems.rb: Added sync task for bundler. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22Postponing the Bundler merge.hsbt
I faced a big issue about Bundler with ruby core. I have no time to resolve it issue before 2.5 final release. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21Merge release version of bundler-1.16.1 from upstream.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Merge 1-16-stable branch of bundler.hsbt
It's rc version for bundler-1.16.1. I'm going to update it version after official release from bundler team. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01Update bundled bundler to 1.16.0.hsbt
* lib/bundler, spec/bundler: Merge bundler-1.16.0. * common.mk: rspec examples of bundler-1.16.0 needs require option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-08Merge bundler to standard libraries.hsbt
rubygems 2.7.x depends bundler-1.15.x. This is preparation for rubygems and bundler migration. * lib/bundler.rb, lib/bundler/*: files of bundler-1.15.4 * spec/bundler/*: rspec examples of bundler-1.15.4. I applied patches. * https://github.com/bundler/bundler/pull/6007 * Exclude not working examples on ruby repository. * Fake ruby interpriter instead of installed ruby. * Makefile.in: Added test task named `test-bundler`. This task is only working macOS/linux yet. I'm going to support Windows environment later. * tool/sync_default_gems.rb: Added sync task for bundler. [Feature #12733][ruby-core:77172] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e