From 282b0e3a8342de5fb5466f7b85ead83a9f5ac9f6 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 10 Oct 2025 11:30:41 +0900 Subject: [PATCH 1/6] [rubygems/rubygems] Replaced Bundler.feature_flag.plugins? to Bundler.settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/rubygems/rubygems/commit/ced8ef3a12 Co-authored-by: David Rodríguez <2887858+deivid-rodriguez@users.noreply.github.com> --- lib/bundler/cli.rb | 4 ++-- lib/bundler/cli/install.rb | 2 +- lib/bundler/cli/update.rb | 2 +- lib/bundler/feature_flag.rb | 1 - lib/bundler/inline.rb | 2 +- lib/bundler/plugin.rb | 2 +- lib/bundler/settings.rb | 1 + 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index c577f4981470a4..6ee6bc76aec8ff 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -143,7 +143,7 @@ def help(cli = nil) end def self.handle_no_command_error(command, has_namespace = $thor_runner) - if Bundler.feature_flag.plugins? && Bundler::Plugin.command?(command) + if Bundler.settings[:plugins] && Bundler::Plugin.command?(command) return Bundler::Plugin.exec_command(command, ARGV[1..-1]) end @@ -623,7 +623,7 @@ def pristine(*gems) end end - if Bundler.feature_flag.plugins? + if Bundler.settings[:plugins] require_relative "cli/plugin" desc "plugin", "Manage the bundler plugins" subcommand "plugin", Plugin diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index 57c28379e5f57d..20e22155de8ee9 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -38,7 +38,7 @@ def run Bundler::Fetcher.disable_endpoint = options["full-index"] - Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins? + Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.settings[:plugins] # For install we want to enable strict validation # (rather than some optimizations we perform at app runtime). diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb index 13f576cfa75b15..cf0ceac0bd19c5 100644 --- a/lib/bundler/cli/update.rb +++ b/lib/bundler/cli/update.rb @@ -15,7 +15,7 @@ def run Bundler.self_manager.update_bundler_and_restart_with_it_if_needed(update_bundler) if update_bundler - Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins? + Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.settings[:plugins] sources = Array(options[:source]) groups = Array(options[:group]).map(&:to_sym) diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb index b2b134889573c1..2109f50d785ef0 100644 --- a/lib/bundler/feature_flag.rb +++ b/lib/bundler/feature_flag.rb @@ -28,7 +28,6 @@ def self.settings_method(name, key, &default) (1..10).each {|v| define_method("bundler_#{v}_mode?") { @major_version >= v } } settings_flag(:global_gem_cache) { bundler_5_mode? } - settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") } settings_flag(:update_requires_all_flag) { bundler_5_mode? } settings_option(:default_cli_command) { bundler_4_mode? ? :cli_help : :install } diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb index f2f5b22cd381a8..4e4b51e7a5dfb4 100644 --- a/lib/bundler/inline.rb +++ b/lib/bundler/inline.rb @@ -51,7 +51,7 @@ def gemfile(force_latest_compatible = false, options = {}, &gemfile) Bundler.instance_variable_set(:@bundle_path, Pathname.new(Gem.dir)) Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile" - Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins? + Bundler::Plugin.gemfile_install(&gemfile) if Bundler.settings[:plugins] builder = Bundler::Dsl.new builder.instance_eval(&gemfile) diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb index 44129cc0ff5089..fd6da6cf6dec71 100644 --- a/lib/bundler/plugin.rb +++ b/lib/bundler/plugin.rb @@ -220,7 +220,7 @@ def add_hook(event, &block) # # @param [String] event def hook(event, *args, &arg_blk) - return unless Bundler.feature_flag.plugins? + return unless Bundler.settings[:plugins] unless Events.defined_event?(event) raise ArgumentError, "Event '#{event}' not defined in Bundler::Plugin::Events" end diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 7923ba51c36630..f8065ad277b252 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -83,6 +83,7 @@ class Settings "BUNDLE_VERSION" => "lockfile", "BUNDLE_LOCKFILE_CHECKSUMS" => true, "BUNDLE_CACHE_ALL" => true, + "BUNDLE_PLUGINS" => true, }.freeze def initialize(root = nil) From c37d4068834e7231e8a17046aa7010b77449b6ad Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 9 Oct 2025 21:17:14 -0700 Subject: [PATCH 2/6] ubuntu.yml: Add matrix.os in the notification label At the moment, nothing in the notification tells you whether it was ibm jobs or not. `matrix.os` seems like the easiest way to include that information, so I added it in the label. --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index af849720575652..86e951bcb77e46 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -173,7 +173,7 @@ jobs: - uses: ./.github/actions/slack with: - label: ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }} + label: ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }}${{ matrix.os }} SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot if: ${{ failure() }} From a5def9999c4caa19a54c143ff3be772a40d0448e Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 9 Oct 2025 21:24:26 -0700 Subject: [PATCH 3/6] sync_default_gems.yml: Experiment with fetch-depth: 1 At the moment, we're not sure which gem relies on past renames. So we try this, and revert it if it turns out to be necessary. Given that it slows down every single sync, however, I'm thinking of making tool/sync_default_gems.rb responsible for implementing all necessary renames on cherry-picks using filter-branch (or any modification on commits before pushing them). --- .github/workflows/sync_default_gems.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/sync_default_gems.yml b/.github/workflows/sync_default_gems.yml index 3912f567e388cc..3a811be18a3187 100644 --- a/.github/workflows/sync_default_gems.yml +++ b/.github/workflows/sync_default_gems.yml @@ -30,12 +30,8 @@ jobs: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 name: Check out ruby/ruby with: - fetch-depth: 999999 # Fetch all history to follow past renames. Not using 0 to avoid fetching tags/branches. token: ${{ github.repository == 'ruby/ruby' && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} - - name: Increase rename limit - run: git config merge.renameLimit 999999 - - name: Run tool/sync_default_gems.rb id: sync run: | From 1399134f6a504cf647c02a00c67b6a04ad7c76a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <2887858+deivid-rodriguez@users.noreply.github.com> Date: Tue, 9 Sep 2025 19:21:52 +0200 Subject: [PATCH 4/6] [rubygems/rubygems] Consolidate removal of `Bundler::SpecSet#-` and `Bundler::SpecSet#<<` https://github.com/rubygems/rubygems/commit/aee50b31db --- lib/bundler/spec_set.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 411393ce1bdd7c..4ae03171dc5813 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -179,9 +179,7 @@ def insecurely_materialized_specs end def -(other) - SharedHelpers.major_deprecation 2, "SpecSet#- has been removed with no replacement" - - SpecSet.new(to_a - other.to_a) + SharedHelpers.feature_removed! "SpecSet#- has been removed with no replacement" end def find_by_name_and_platform(name, platform) @@ -212,9 +210,7 @@ def what_required(spec) end def <<(spec) - SharedHelpers.major_deprecation 2, "SpecSet#<< has been removed with no replacement" - - @specs << spec + SharedHelpers.feature_removed! "SpecSet#<< has been removed with no replacement" end def length From 77e32902db6fc6ef34c97bb8c0bc495267e636e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <2887858+deivid-rodriguez@users.noreply.github.com> Date: Tue, 9 Sep 2025 19:21:29 +0200 Subject: [PATCH 5/6] [rubygems/rubygems] Consolidate removal of `Bundler.rubygems.all_specs` https://github.com/rubygems/rubygems/commit/73779331ce --- lib/bundler/rubygems_integration.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 31f255d997a833..d8f95cffb8fcd6 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -416,11 +416,7 @@ def path_separator end def all_specs - SharedHelpers.major_deprecation 2, "Bundler.rubygems.all_specs has been removed in favor of Bundler.rubygems.installed_specs" - - Gem::Specification.stubs.map do |stub| - StubSpecification.from_stub(stub) - end + SharedHelpers.feature_removed! "Bundler.rubygems.all_specs has been removed in favor of Bundler.rubygems.installed_specs" end def installed_specs From b38846db18c34213077a9efaa7b28683b42f12a3 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 10 Oct 2025 14:10:45 +0900 Subject: [PATCH 6/6] [rubygems/rubygems] Make global_gem_cache flag to settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/rubygems/rubygems/commit/bfe15a4712 Co-authored-by: David Rodríguez <2887858+deivid-rodriguez@users.noreply.github.com> --- lib/bundler/feature_flag.rb | 1 - lib/bundler/settings.rb | 1 + lib/bundler/source.rb | 2 +- lib/bundler/source/git.rb | 2 +- lib/bundler/source/rubygems.rb | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb index 2109f50d785ef0..c3b8d790fbbce9 100644 --- a/lib/bundler/feature_flag.rb +++ b/lib/bundler/feature_flag.rb @@ -27,7 +27,6 @@ def self.settings_method(name, key, &default) (1..10).each {|v| define_method("bundler_#{v}_mode?") { @major_version >= v } } - settings_flag(:global_gem_cache) { bundler_5_mode? } settings_flag(:update_requires_all_flag) { bundler_5_mode? } settings_option(:default_cli_command) { bundler_4_mode? ? :cli_help : :install } diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index f8065ad277b252..64f0c9900eb285 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -84,6 +84,7 @@ class Settings "BUNDLE_LOCKFILE_CHECKSUMS" => true, "BUNDLE_CACHE_ALL" => true, "BUNDLE_PLUGINS" => true, + "BUNDLE_GLOBAL_GEM_CACHE" => false, }.freeze def initialize(root = nil) diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 232873503b3933..2b90a0eff1bfbb 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -79,7 +79,7 @@ def path? end def extension_cache_path(spec) - return unless Bundler.feature_flag.global_gem_cache? + return unless Bundler.settings[:global_gem_cache] return unless source_slug = extension_cache_slug(spec) Bundler.user_cache.join( "extensions", Gem::Platform.local.to_s, Bundler.ruby_scope, diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index bb12ff52f514fb..bb669ebba39d21 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -238,7 +238,7 @@ def load_spec_files # across different projects, this cache will be shared. # When using local git repos, this is set to the local repo. def cache_path - @cache_path ||= if Bundler.feature_flag.global_gem_cache? + @cache_path ||= if Bundler.settings[:global_gem_cache] Bundler.user_cache else Bundler.bundle_path.join("cache", "bundler") diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index fdc3a77b248072..2631c860a010ba 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -493,7 +493,7 @@ def download_gem(spec, download_cache_path, previous_spec = nil) # @return [Pathname] The global cache path. # def download_cache_path(spec) - return unless Bundler.feature_flag.global_gem_cache? + return unless Bundler.settings[:global_gem_cache] return unless remote = spec.remote return unless cache_slug = remote.cache_slug