summaryrefslogtreecommitdiff
path: root/spec/bundler/support
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-04-04 20:52:20 +0200
committergit <svn-admin@ruby-lang.org>2023-04-07 13:53:00 +0000
commit4df7c3946ab8da8af4c3c0e38a41ab3bd890fc7f (patch)
treeca048107736f3a4ce9259e959432e6f4f74cb8f9 /spec/bundler/support
parentf8115ec727b6a63305d143c2869678c3a8210fa7 (diff)
[rubygems/rubygems] Remove one fallback to full indexes on big gemfiles
If Gemfile has a lot of dependencies, we have an optimization that uses the full index in that case, assuming it's going to be faster. I think this is an old optimization that predates compact index API times, I believe we no longer need it these days. Also, since a few releases ago we check for circular dependencies when resolving by looping through all versions of each name and removing those that have circular dependencies that would trip up the resolver. This loop becomes actually very slow when full indexes are used because to find dependencies of a gemspec, we need to explicitly fetch the marshaled gemspec (`gemspec.rz` endpoint) for it, so the optimization has the opposite effect of making things very slow. https://github.com/rubygems/rubygems/commit/2f46289bd3
Diffstat (limited to 'spec/bundler/support')
-rw-r--r--spec/bundler/support/builders.rb12
-rw-r--r--spec/bundler/support/path.rb4
2 files changed, 0 insertions, 16 deletions
diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb
index b546ac7305..7c16470153 100644
--- a/spec/bundler/support/builders.rb
+++ b/spec/bundler/support/builders.rb
@@ -17,18 +17,6 @@ module Spec
Gem::Platform.new(platform)
end
- # Returns a number smaller than the size of the index. Useful for specs that
- # need the API request limit to be reached for some reason.
- def low_api_request_limit_for(gem_repo)
- all_gems = Dir[gem_repo.join("gems/*.gem")]
-
- all_gem_names = all_gems.map do |file|
- File.basename(file, ".gem").match(/\A(?<gem_name>[^-]+)-.*\z/)[:gem_name]
- end.uniq
-
- (all_gem_names - ["bundler"]).size
- end
-
def build_repo1
rake_path = Dir["#{Path.base_system_gems}/**/rake*.gem"].first
diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb
index de03b2746e..2870a8b678 100644
--- a/spec/bundler/support/path.rb
+++ b/spec/bundler/support/path.rb
@@ -71,10 +71,6 @@ module Spec
@spec_dir ||= source_root.join(ruby_core? ? "spec/bundler" : "spec")
end
- def api_request_limit_hack_file
- spec_dir.join("support/api_request_limit_hax.rb")
- end
-
def man_dir
@man_dir ||= lib_dir.join("bundler/man")
end