-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Prepare RubyGems 4.0.9 and Bundler 4.0.9 #9426
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
267bb16
224508e
7ca6583
5bcb26c
998ccb2
0c8abca
c670ce7
6a89954
d79e916
dd4cc31
5bec2a5
515488c
70dd702
01361dd
5033c7e
3ce4a32
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) | ||||||||||||||||||||||||||||||
|
Comment on lines
129
to
132
|
||||||||||||||||||||||||||||||
| 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) | |
| if spec_to_install = @specs.find(&:ready_to_install?) | |
| do_install(spec_to_install, 0) | |
| next | |
| end | |
| spec_to_enqueue = @specs.find(&:ready_to_enqueue?) | |
| raise "failed to find a spec to enqueue while installing serially" unless spec_to_enqueue | |
| spec_to_enqueue.state = :enqueued | |
| do_download(spec_to_enqueue, 0) |
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 even when they are in :downloaded state but not yet ready_to_install?. Since the worker pool lambda treats any non-:enqueued/non-:installable state as a no-op, this can devolve into a tight deq/enq loop (high CPU + queue contention) until dependencies become installed. Consider not re-enqueuing until the spec becomes installable, and instead enqueue downloaded specs when installed_specs changes (e.g., after an install completes, scan for :downloaded specs that are now ready_to_install?).
| 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 = {}) | |
| true | |
| end |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -110,7 +110,8 @@ def install_from_specs(specs) | |||||
| paths = {} | ||||||
|
|
||||||
| specs.each do |spec| | ||||||
| spec.source.install spec | ||||||
| spec.source.download(spec) | ||||||
|
||||||
| spec.source.download(spec) | |
| spec.source.download(spec, {}) |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -63,6 +63,7 @@ def install_and_restart_with(version) | |||||||||
| end | ||||||||||
|
|
||||||||||
| def install(spec) | ||||||||||
| spec.source.download(spec) | ||||||||||
| spec.source.install(spec) | ||||||||||
|
Comment on lines
+66
to
67
|
||||||||||
| spec.source.download(spec) | |
| spec.source.install(spec) | |
| spec.source.download(spec, {}) | |
| spec.source.install(spec, {}) |
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 new 4.0.9 entry doesn’t match the established Bundler changelog format below (e.g.
## 4.0.8 (YYYY-MM-DD)and indented-bullets with PR links, without “Pull request … by …” text). Please reformat this entry to be consistent with the rest ofbundler/CHANGELOG.md.