-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Prepare RubyGems 4.0.9 and Bundler 4.0.9 #9424
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
Changes from all commits
f863096
938e3f7
9d0f846
6f8afd6
e2f04de
059550f
b3aab56
db9f6b7
b69c23e
0f2372b
bb3ecc5
cb2f39b
559383c
a200eeb
2ee6dde
69fac54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -24,6 +24,10 @@ def enqueued? | |||
| state == :enqueued | ||||
| end | ||||
|
|
||||
| def enqueue_with_priority? | ||||
| state == :installable && spec.extensions.any? | ||||
| end | ||||
|
|
||||
| def failed? | ||||
| state == :failed | ||||
| end | ||||
|
|
@@ -32,6 +36,12 @@ def ready_to_enqueue? | |||
| state == :none | ||||
| end | ||||
|
|
||||
| def ready_to_install?(installed_specs) | ||||
| return false unless state == :downloaded | ||||
|
|
||||
| spec.extensions.none? || dependencies_installed?(installed_specs) | ||||
| end | ||||
|
|
||||
| def has_post_install_message? | ||||
| !post_install_message.empty? | ||||
| end | ||||
|
|
@@ -84,6 +94,7 @@ def initialize(installer, all_specs, size, standalone, force, local: false, skip | |||
|
|
||||
| def call | ||||
| if @rake | ||||
| do_download(@rake, 0) | ||||
| do_install(@rake, 0) | ||||
| Gem::Specification.reset | ||||
| end | ||||
|
|
@@ -107,26 +118,54 @@ def failed_specs | |||
| end | ||||
|
|
||||
| def install_with_worker | ||||
| enqueue_specs | ||||
| process_specs until finished_installing? | ||||
| installed_specs = {} | ||||
| enqueue_specs(installed_specs) | ||||
|
|
||||
| process_specs(installed_specs) until finished_installing? | ||||
| end | ||||
|
|
||||
| def install_serially | ||||
| until finished_installing? | ||||
| raise "failed to find a spec to enqueue while installing serially" unless spec_install = @specs.find(&:ready_to_enqueue?) | ||||
| spec_install.state = :enqueued | ||||
| do_download(spec_install, 0) | ||||
| do_install(spec_install, 0) | ||||
| end | ||||
| end | ||||
|
|
||||
| def worker_pool | ||||
| @worker_pool ||= Bundler::Worker.new @size, "Parallel Installer", lambda {|spec_install, worker_num| | ||||
| do_install(spec_install, worker_num) | ||||
| case spec_install.state | ||||
| when :enqueued | ||||
| do_download(spec_install, worker_num) | ||||
| when :installable | ||||
| do_install(spec_install, worker_num) | ||||
| else | ||||
| spec_install | ||||
| end | ||||
| } | ||||
| end | ||||
|
|
||||
| def do_install(spec_install, worker_num) | ||||
| def do_download(spec_install, worker_num) | ||||
| Plugin.hook(Plugin::Events::GEM_BEFORE_INSTALL, spec_install) | ||||
|
|
||||
|
Comment on lines
150
to
+151
|
||||
| Plugin.hook(Plugin::Events::GEM_BEFORE_INSTALL, spec_install) |
Copilot
AI
Mar 25, 2026
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.
process_specs re-enqueues specs that are in :downloaded state but not yet ready_to_install?. Since the worker lambda returns the spec unchanged for unknown states, this can create a tight enqueue/dequeue loop (high CPU) until dependencies are installed. Only enqueue when there's actual work (:enqueued download or :installable install), and trigger installation enqueueing after dependency state changes (e.g., after a spec becomes :installed).
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -74,6 +74,14 @@ def options_to_lock | |||||
| {} | ||||||
| end | ||||||
|
|
||||||
| # Download the gem specified by the spec at appropriate path. | ||||||
| # | ||||||
| # A source plugin can implement this method to split the download and the | ||||||
| # installation of a gem. | ||||||
| # | ||||||
| # @return [Boolean] Whether the download of the gem succeeded. | ||||||
| def download(spec, opts); end | ||||||
|
||||||
| def download(spec, opts); end | |
| def download(spec, opts = {}); end |
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.
The changelog heading format is inconsistent with the surrounding entries in this file (this entry uses
4.0.9 / YYYY-MM-DDwhile the next entry uses parentheses). Align the heading style for consistency withinbundler/CHANGELOG.md.