diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index 0b5193ddf8fdc..ce380ccb46e24 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -20,7 +20,7 @@ inherit_mode: - Exclude AllCops: - TargetRubyVersion: 3.4 + TargetRubyVersion: 4.0 NewCops: enable Include: - "**/*.rbi" diff --git a/Library/Homebrew/.ruby-version b/Library/Homebrew/.ruby-version index 7921bd0c89272..1454f6ed4b751 100644 --- a/Library/Homebrew/.ruby-version +++ b/Library/Homebrew/.ruby-version @@ -1 +1 @@ -3.4.8 +4.0.1 diff --git a/Library/Homebrew/Gemfile b/Library/Homebrew/Gemfile index 99e8d433c0ca8..329e2411f5b64 100644 --- a/Library/Homebrew/Gemfile +++ b/Library/Homebrew/Gemfile @@ -5,9 +5,9 @@ source "https://rubygems.org" # The default case (no envs), should always be a restrictive bound on the lowest supported minor version. # This is the branch that Dependabot will use. if ENV.fetch("HOMEBREW_USE_RUBY_FROM_PATH", "").empty? - ruby "~> 3.4.0" + ruby "~> 4.0.0" else - ruby ">= 3.4.0" + ruby ">= 4.0.0" end # disallowed gems (should not be used) @@ -26,6 +26,9 @@ end group :formula_test, optional: true do gem "minitest", require: false end +group :irb, optional: true do + gem "irb", require: false +end group :livecheck, optional: true do gem "ruby-progressbar", require: false end @@ -54,6 +57,7 @@ group :style, :tests, optional: true do gem "test-prof", require: false end group :tests, optional: true do + gem "ostruct", require: false gem "parallel_tests", require: false gem "rspec", require: false gem "rspec-core", require: false diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index a10de2c650787..ee79861b8c65f 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -11,13 +11,19 @@ GEM coderay (1.1.3) concurrent-ruby (1.3.6) csv (3.3.5) + date (3.5.1) diff-lcs (1.6.2) docile (1.4.1) elftools (1.3.1) bindata (~> 2) + erb (6.0.1) erubi (1.13.1) hana (1.3.7) io-console (0.8.2) + irb (1.16.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) json (2.18.1) json_schemer (2.5.0) bigdecimal @@ -33,6 +39,7 @@ GEM minitest (6.0.1) prism (~> 1.5) netrc (0.11.0) + ostruct (0.6.3) parallel (1.27.0) parallel_tests (5.6.0) parallel @@ -43,11 +50,17 @@ GEM elftools (>= 1.3) logger (~> 1) plist (3.7.2) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) prism (1.9.0) pry (0.16.0) coderay (~> 1.1) method_source (~> 1.0) reline (>= 0.6.0) + psych (5.3.1) + date + stringio public_suffix (7.0.2) pycall (1.5.2) racc (1.8.1) @@ -59,6 +72,10 @@ GEM logger prism (>= 1.3.0) tsort + rdoc (7.1.0) + erb + psych (>= 4.0.0) + tsort redcarpet (3.6.1) regexp_parser (2.11.3) reline (0.6.3) @@ -149,6 +166,7 @@ GEM sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) stackprof (0.2.27) + stringio (3.2.0) tapioca (0.17.10) benchmark bundler (>= 2.2.25) @@ -184,10 +202,12 @@ DEPENDENCIES base64 concurrent-ruby csv + irb json_schemer kramdown method_source minitest + ostruct parallel_tests patchelf plist @@ -226,7 +246,7 @@ DEPENDENCIES yard-sorbet RUBY VERSION - ruby 3.4.8p72 + ruby 4.0.1 BUNDLED WITH - 2.6.9 + 4.0.3 diff --git a/Library/Homebrew/bundle/dumper.rb b/Library/Homebrew/bundle/dumper.rb index 82777e5d7af1e..ec7feef214b37 100644 --- a/Library/Homebrew/bundle/dumper.rb +++ b/Library/Homebrew/bundle/dumper.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "fileutils" -require "pathname" module Homebrew module Bundle diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index 55107b78c1849..d0986e330da97 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -73,6 +73,7 @@ def run Homebrew.install_bundler_gems!(groups: ["pry"]) require "pry" else + Homebrew.install_bundler_gems!(groups: ["irb"]) require "irb" end diff --git a/Library/Homebrew/extend/os/mac/linkage_checker.rb b/Library/Homebrew/extend/os/mac/linkage_checker.rb index b82af034b2121..6d8ecb26fb5d6 100644 --- a/Library/Homebrew/extend/os/mac/linkage_checker.rb +++ b/Library/Homebrew/extend/os/mac/linkage_checker.rb @@ -11,6 +11,22 @@ def system_libraries_exist_in_cache? # In macOS Big Sur and later, system libraries do not exist on-disk and instead exist in a cache. MacOS.version >= :big_sur end + + sig { params(dylib: String).returns(T::Boolean) } + def dylib_found_in_shared_cache?(dylib) + Kernel.require "fiddle" + @dyld_shared_cache_contains_path ||= T.let(begin + libc = Fiddle.dlopen("/usr/lib/libSystem.B.dylib") + + Fiddle::Function.new( + libc["_dyld_shared_cache_contains_path"], + [Fiddle::TYPE_CONST_STRING], + Fiddle::TYPE_BOOL, + ) + end, T.nilable(Fiddle::Function)) + + @dyld_shared_cache_contains_path.call(dylib) + end end end end diff --git a/Library/Homebrew/linkage_checker.rb b/Library/Homebrew/linkage_checker.rb index b4f3174b11f09..a7bf6a78b611d 100644 --- a/Library/Homebrew/linkage_checker.rb +++ b/Library/Homebrew/linkage_checker.rb @@ -232,20 +232,9 @@ def system_libraries_exist_in_cache? false end - sig { params(dylib: String).returns(T::Boolean) } - def dylib_found_in_shared_cache?(dylib) - require "fiddle" - @dyld_shared_cache_contains_path ||= T.let(begin - libc = Fiddle.dlopen("/usr/lib/libSystem.B.dylib") - - Fiddle::Function.new( - libc["_dyld_shared_cache_contains_path"], - [Fiddle::TYPE_CONST_STRING], - Fiddle::TYPE_BOOL, - ) - end, T.nilable(Fiddle::Function)) - - @dyld_shared_cache_contains_path.call(dylib) + sig { params(_dylib: String).returns(T::Boolean) } + def dylib_found_in_shared_cache?(_dylib) + false end sig { diff --git a/Library/Homebrew/sorbet/tapioca/require.rb b/Library/Homebrew/sorbet/tapioca/require.rb index 705827d80b319..baf182a86bd9e 100644 --- a/Library/Homebrew/sorbet/tapioca/require.rb +++ b/Library/Homebrew/sorbet/tapioca/require.rb @@ -23,6 +23,9 @@ next if name == "sorbet-static" next if name == "sorbet-static-and-runtime" + # We don't generate RBIs for pycall + next if name == "pycall" + name = dependency_require_map[name] if dependency_require_map.key?(name) require name additional_requires_map[name]&.each { require(it) } diff --git a/Library/Homebrew/utils/ruby.sh b/Library/Homebrew/utils/ruby.sh index 9ac6e5a6ab047..65ef5fc05e286 100644 --- a/Library/Homebrew/utils/ruby.sh +++ b/Library/Homebrew/utils/ruby.sh @@ -2,9 +2,9 @@ # When bumping to a new major/minor version, also update the bounds in the Gemfile # HOMEBREW_LIBRARY set by bin/brew # shellcheck disable=SC2154 -export HOMEBREW_REQUIRED_RUBY_VERSION="3.4" +export HOMEBREW_REQUIRED_RUBY_VERSION="4.0" HOMEBREW_PORTABLE_RUBY_VERSION="$(cat "${HOMEBREW_LIBRARY}/Homebrew/vendor/portable-ruby-version")" -export HOMEBREW_BUNDLER_VERSION="2.6.9" +export HOMEBREW_BUNDLER_VERSION="4.0.3" # Disable Ruby options we don't need. export HOMEBREW_RUBY_DISABLE_OPTIONS="--disable=gems,rubyopt" diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 4f7358f89eb29..33fa4ef21aef4 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -45,13 +45,27 @@ def self.extension_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/coderay-1.1.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/concurrent-ruby-1.3.6/lib/concurrent-ruby") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/csv-3.3.5/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/date-3.5.1") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/date-3.5.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/diff-lcs-1.6.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/docile-1.4.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/elftools-1.3.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/erb-6.0.1") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/erb-6.0.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/erubi-1.13.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/hana-1.3.7/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/io-console-0.8.2") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/io-console-0.8.2/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/prettyprint-0.2.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/pp-0.6.3/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/stringio-3.2.0") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/stringio-3.2.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/psych-5.3.1") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/psych-5.3.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/tsort-0.2.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rdoc-7.1.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/reline-0.6.3/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/irb-1.16.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/json-2.18.1") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json-2.18.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/regexp_parser-2.11.3/lib") @@ -67,6 +81,7 @@ def self.extension_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/prism-1.9.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/minitest-6.0.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/netrc-0.11.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ostruct-0.6.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel-1.27.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel_tests-5.6.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/racc-1.8.1") @@ -74,12 +89,10 @@ def self.extension_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parser-3.3.10.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/patchelf-1.5.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/plist-3.7.2/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/reline-0.6.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/pry-0.16.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/pycall-1.5.2") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/pycall-1.5.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rainbow-3.1.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/tsort-0.2.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/rbs-4.0.0.dev.5") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbs-4.0.0.dev.5/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbi-0.3.9/lib") diff --git a/Library/Homebrew/vendor/portable-ruby-arm64-darwin b/Library/Homebrew/vendor/portable-ruby-arm64-darwin index 48f06299a0f14..6e39ab2dc827e 100644 --- a/Library/Homebrew/vendor/portable-ruby-arm64-darwin +++ b/Library/Homebrew/vendor/portable-ruby-arm64-darwin @@ -1,2 +1,2 @@ ruby_TAG=arm64_big_sur -ruby_SHA=1c98fa49eacc935640a6f8e10a2bf33f14cfc276804b71ddb658ea45ba99d167 +ruby_SHA=643ad12da2e9265085a961d678f5b3219283fbc5a73cdf0615adc8609ba8539e diff --git a/Library/Homebrew/vendor/portable-ruby-arm64-linux b/Library/Homebrew/vendor/portable-ruby-arm64-linux index 4391d4809f296..c946ae6c4820f 100644 --- a/Library/Homebrew/vendor/portable-ruby-arm64-linux +++ b/Library/Homebrew/vendor/portable-ruby-arm64-linux @@ -1,2 +1,2 @@ ruby_TAG=arm64_linux -ruby_SHA=56b0017d634509e49272a6eccd88f888dd4031404e230f9defb3b21707781310 +ruby_SHA=7cc511b5933ecb4e857994d01ddc66accdbcdb772214ba415664993fe80442f6 diff --git a/Library/Homebrew/vendor/portable-ruby-version b/Library/Homebrew/vendor/portable-ruby-version index 7921bd0c89272..1454f6ed4b751 100644 --- a/Library/Homebrew/vendor/portable-ruby-version +++ b/Library/Homebrew/vendor/portable-ruby-version @@ -1 +1 @@ -3.4.8 +4.0.1 diff --git a/Library/Homebrew/vendor/portable-ruby-x86_64-darwin b/Library/Homebrew/vendor/portable-ruby-x86_64-darwin index 97c8ce2fcc834..582d9d741d0e4 100644 --- a/Library/Homebrew/vendor/portable-ruby-x86_64-darwin +++ b/Library/Homebrew/vendor/portable-ruby-x86_64-darwin @@ -1,2 +1,2 @@ ruby_TAG=catalina -ruby_SHA=80c194381e990a4967a1ae44b8242b688e6a17ab590865a38671137677411469 +ruby_SHA=09a5c468e76c2176c7a5a941831f28463f0035172f2fcf64f8a80f2dc1a31f01 diff --git a/Library/Homebrew/vendor/portable-ruby-x86_64-linux b/Library/Homebrew/vendor/portable-ruby-x86_64-linux index 86eedc53c7963..bd5ef05c6aaff 100644 --- a/Library/Homebrew/vendor/portable-ruby-x86_64-linux +++ b/Library/Homebrew/vendor/portable-ruby-x86_64-linux @@ -1,2 +1,2 @@ ruby_TAG=x86_64_linux -ruby_SHA=63a9c333137e7cf8a568e0f37ec6802c22fbbdd5839f4825c863c26e415d2947 +ruby_SHA=5f52e03e2799621b7f7f103173fb9c7d660d6bc1b9748efbcaab09881bb136cc