Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Autoload the vendored FileUtils - #10001

Merged
hsbt merged 1 commit into
ruby:masterfrom
linyiru:bundler-autoload-fileutils
Nov 4, 2026
Merged

hsbt merged 1 commit into
ruby:masterfrom
linyiru:bundler-autoload-fileutils

Conversation

@linyiru

@linyiru linyiru commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Part of #9998, a set of small, independent boot-time improvements.

What was the end-user or developer problem that led to this PR?

bundler.rb required the vendored FileUtils at load time, and Source::Git required it again, so every require "bundler/setup" compiled it, though setting up an installed bundle never calls it. Measured on master (c2380f6) in a Rails app with 450 activated gems and a 1,500-line lockfile, Ruby 3.4.12, macOS arm64. Loading it costs 2.9 ms.

What is your fix for the problem, implemented in this PR?

Autoload Bundler::FileUtils in the existing autoload list and drop the two eager requires. The added spec checks that bundler/setup leaves it unloaded and that Bundler::FileUtils still resolves; it fails on master.

What this costs

None that I can see: it follows the autoload list right next to it. Code that references Bundler::FileUtils from outside module Bundler before it is loaded still works, since the autoload is on Bundler.

Make sure the following tasks are checked

bundler.rb required the vendored FileUtils up front, and Source::Git
required it again, so every `require "bundler/setup"` compiled it even
though setting up an installed bundle never calls it. Autoload it next to
the other Bundler constants instead.
@hsbt
hsbt merged commit 603fd72 into ruby:master Nov 4, 2026
114 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants