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: | 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() }} 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..c3b8d790fbbce9 100644 --- a/lib/bundler/feature_flag.rb +++ b/lib/bundler/feature_flag.rb @@ -27,8 +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(: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/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 diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 7923ba51c36630..64f0c9900eb285 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -83,6 +83,8 @@ class Settings "BUNDLE_VERSION" => "lockfile", "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 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