From c889eb5c661c5c473e3e8fe1f9e4b2fe2fea4c23 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Sun, 5 Nov 2023 08:44:36 -0800 Subject: [PATCH 1/8] bundle update sorbet-static-and-runtime --- Library/Homebrew/Gemfile.lock | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 26c03b34ab..705196b15d 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -134,22 +134,14 @@ GEM simplecov_json_formatter (0.1.4) simpleidn (0.2.1) unf (~> 0.1.4) - sorbet (0.5.10461) - sorbet-static (= 0.5.10461) - sorbet-runtime (0.5.10461) - sorbet-static (0.5.10461-universal-darwin-14) - sorbet-static (0.5.10461-universal-darwin-15) - sorbet-static (0.5.10461-universal-darwin-16) - sorbet-static (0.5.10461-universal-darwin-17) - sorbet-static (0.5.10461-universal-darwin-18) - sorbet-static (0.5.10461-universal-darwin-19) - sorbet-static (0.5.10461-universal-darwin-20) - sorbet-static (0.5.10461-universal-darwin-21) - sorbet-static (0.5.10461-universal-darwin-22) - sorbet-static (0.5.10461-x86_64-linux) - sorbet-static-and-runtime (0.5.10461) - sorbet (= 0.5.10461) - sorbet-runtime (= 0.5.10461) + sorbet (0.5.11116) + sorbet-static (= 0.5.11116) + sorbet-runtime (0.5.11116) + sorbet-static (0.5.11116-universal-darwin) + sorbet-static (0.5.11116-x86_64-linux) + sorbet-static-and-runtime (0.5.11116) + sorbet (= 0.5.11116) + sorbet-runtime (= 0.5.11116) spoom (1.1.11) sorbet (>= 0.5.9204) sorbet-runtime (>= 0.5.9204) From 61691aa48a27d867687396e75cc3d67a16766dc5 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Sun, 5 Nov 2023 08:46:35 -0800 Subject: [PATCH 2/8] git grep -l '10461' | xargs gsed -i 's|10461|11116|g' --- Library/Homebrew/test/utils/backtrace_spec.rb | 18 +++++++++--------- .../Homebrew/vendor/bundle/bundler/setup.rb | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Library/Homebrew/test/utils/backtrace_spec.rb b/Library/Homebrew/test/utils/backtrace_spec.rb index 3757c38da2..0be1a1e051 100644 --- a/Library/Homebrew/test/utils/backtrace_spec.rb +++ b/Library/Homebrew/test/utils/backtrace_spec.rb @@ -23,20 +23,20 @@ describe Utils::Backtrace do let(:backtrace_with_sorbet_paths) do [ "/Library/Homebrew/downloadable.rb:75:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/_methods.rb:270:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/_methods.rb:270:in", "/Library/Homebrew/downloadable.rb:50:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/_methods.rb:270:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/_methods.rb:270:in", "/Library/Homebrew/cmd/fetch.rb:236:in", "/Library/Homebrew/cmd/fetch.rb:201:in", "/Library/Homebrew/cmd/fetch.rb:178:in", "/Library/Homebrew/simulate_system.rb:29:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/_methods.rb:270:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/_methods.rb:270:in", "/Library/Homebrew/cmd/fetch.rb:166:in", "/Library/Homebrew/cmd/fetch.rb:163:in", "/Library/Homebrew/cmd/fetch.rb:163:in", diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 1752b03fb9..73ab5799c2 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -69,7 +69,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/racc-1.7.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parser-3.2.2.4/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/sorbet-runtime-0.5.10461/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-runtime-0.5.11116/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parlour-8.1.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/patchelf-1.4.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/plist-3.7.0/lib") @@ -107,9 +107,9 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov_json_formatter-0.1.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-0.22.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-cobertura-2.1.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-0.5.10461-universal-darwin-22/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-0.5.10461/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-and-runtime-0.5.10461/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-0.5.11116-universal-darwin-22/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-0.5.11116/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-and-runtime-0.5.11116/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/thor-1.3.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/spoom-1.1.11/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/universal-darwin-22/#{Gem.extension_api_version}/stackprof-0.2.25") From 0191af7899e3e39a73d29c7ede1fed68e24f0263 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Sun, 5 Nov 2023 08:55:58 -0800 Subject: [PATCH 3/8] resolve typecheck errors --- Library/Homebrew/cask/artifact/relocated.rb | 2 +- Library/Homebrew/cask/config.rb | 2 ++ Library/Homebrew/cask/url.rb | 2 +- Library/Homebrew/cmd/update-report.rb | 2 +- Library/Homebrew/dependencies.rb | 2 ++ Library/Homebrew/dev-cmd/bump-cask-pr.rb | 4 ++-- Library/Homebrew/extend/pathname.rb | 2 +- Library/Homebrew/extend/predicable.rbi | 3 ++- Library/Homebrew/formula.rb | 2 +- Library/Homebrew/language/node.rb | 3 ++- Library/Homebrew/lazy_object.rb | 2 ++ Library/Homebrew/macos_version.rb | 2 +- Library/Homebrew/software_spec.rb | 4 ++-- Library/Homebrew/sorbet/parlour.rb | 2 +- Library/Homebrew/unpack_strategy.rb | 2 +- Library/Homebrew/unversioned_cask_checker.rb | 4 ++-- Library/Homebrew/utils/bottles.rb | 8 +++++--- .../yard/templates/default/docstring/html/setup.rb | 2 +- 18 files changed, 30 insertions(+), 20 deletions(-) diff --git a/Library/Homebrew/cask/artifact/relocated.rb b/Library/Homebrew/cask/artifact/relocated.rb index 0642db0e2b..97bc0e8dda 100644 --- a/Library/Homebrew/cask/artifact/relocated.rb +++ b/Library/Homebrew/cask/artifact/relocated.rb @@ -13,7 +13,7 @@ module Cask source_string, target_hash = args if target_hash - raise CaskInvalidError unless target_hash.respond_to?(:keys) + raise CaskInvalidError.new(cask) unless target_hash.respond_to?(:keys) target_hash.assert_valid_keys(:target) end diff --git a/Library/Homebrew/cask/config.rb b/Library/Homebrew/cask/config.rb index ae3533e7a8..b546a44f48 100644 --- a/Library/Homebrew/cask/config.rb +++ b/Library/Homebrew/cask/config.rb @@ -78,6 +78,8 @@ module Cask key = k.to_sym if DEFAULT_DIRS.key?(key) + raise TypeError, "Invalid path for default dir #{k}: #{v.inspect}" if v.is_a?(Array) + [key, Pathname(v).expand_path] else [key, v] diff --git a/Library/Homebrew/cask/url.rb b/Library/Homebrew/cask/url.rb index db93901c5b..fd4865f313 100644 --- a/Library/Homebrew/cask/url.rb +++ b/Library/Homebrew/cask/url.rb @@ -236,7 +236,7 @@ module Cask def raw_url_line return @raw_url_line if defined?(@raw_url_line) - @raw_url_line = Pathname(@caller_location.path) + @raw_url_line = Pathname(T.must(@caller_location.path)) .each_line .drop(@caller_location.lineno - 1) .first diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index b5fd1544de..6eef639aa9 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -320,7 +320,7 @@ module Homebrew next unless tap.installed? if tap.git_branch == "master" && - (Date.parse(tap.git_repo.last_commit_date) <= Date.today.prev_month) + (Date.parse(T.must(tap.git_repo.last_commit_date)) <= Date.today.prev_month) ohai "#{tap.name} is old and unneeded, untapping to save space..." tap.uninstall else diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb index 625a874210..1e69bfecdf 100644 --- a/Library/Homebrew/dependencies.rb +++ b/Library/Homebrew/dependencies.rb @@ -59,6 +59,8 @@ class Requirements < SimpleDelegator __getobj__.delete(req) end end + # see https://sorbet.org/docs/faq#how-can-i-fix-type-errors-that-arise-from-super + T.bind(self, T.untyped) super self end diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index 23efb2850e..71f377afda 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -177,7 +177,7 @@ module Homebrew sig { params( cask: Cask::Cask, - new_hash: T.nilable(String), + new_hash: T.any(NilClass, String, Symbol), new_version: BumpVersionParser, replacement_pairs: T::Array[[T.any(Regexp, String), T.any(Regexp, String)]], ).returns(T::Array[[T.any(Regexp, String), T.any(Regexp, String)]]) @@ -234,7 +234,7 @@ module Homebrew end elsif new_hash opoo "Cask contains multiple hashes; only updating hash for current arch." if cask.on_system_blocks_exist? - replacement_pairs << [old_hash.to_s, new_hash] + replacement_pairs << [old_hash.to_s, new_hash.to_s] end end end diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index b169d984d0..c2b5a8a933 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -126,7 +126,7 @@ class Pathname # https://bugs.ruby-lang.org/issues/7707 # In that case, use the system "mv" command. if src.symlink? - raise unless Kernel.system "mv", src, dst + raise unless Kernel.system "mv", src.to_s, dst else FileUtils.mv src, dst end diff --git a/Library/Homebrew/extend/predicable.rbi b/Library/Homebrew/extend/predicable.rbi index cd5e165e4c..027500f579 100644 --- a/Library/Homebrew/extend/predicable.rbi +++ b/Library/Homebrew/extend/predicable.rbi @@ -1,5 +1,6 @@ # typed: strict module Predicable - requires_ancestor { Class } + include Kernel + requires_ancestor { Module } end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index e7b757c5e8..631c47fbc2 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -343,7 +343,7 @@ class Formula # The path that was specified to find this formula. def specified_path - default_specified_path = Pathname(alias_path) if alias_path.present? + default_specified_path = Pathname(T.must(alias_path)) if alias_path.present? default_specified_path ||= @unresolved_path return default_specified_path if default_specified_path.presence&.exist? diff --git a/Library/Homebrew/language/node.rb b/Library/Homebrew/language/node.rb index 5974e3bc25..3e90e2fe94 100644 --- a/Library/Homebrew/language/node.rb +++ b/Library/Homebrew/language/node.rb @@ -17,7 +17,8 @@ module Language # fed to `npm install` only symlinks are created linking back to that # directory, consequently breaking that assumption. We require a tarball # because npm install creates a "real" installation when fed a tarball. - if (package = Pathname("package.json")) && package.exist? + package = Pathname("package.json") + if package.exist? begin pkg_json = JSON.parse(package.read) rescue JSON::ParserError diff --git a/Library/Homebrew/lazy_object.rb b/Library/Homebrew/lazy_object.rb index 4dfcbdb4e6..831fb9fe74 100644 --- a/Library/Homebrew/lazy_object.rb +++ b/Library/Homebrew/lazy_object.rb @@ -23,6 +23,8 @@ class LazyObject < Delegator # Forward to the inner object to make lazy objects type-checkable. def is_a?(klass) + # see https://sorbet.org/docs/faq#how-can-i-fix-type-errors-that-arise-from-super + T.bind(self, T.untyped) __getobj__.is_a?(klass) || super end end diff --git a/Library/Homebrew/macos_version.rb b/Library/Homebrew/macos_version.rb index f728b610ca..b871c3d0c7 100644 --- a/Library/Homebrew/macos_version.rb +++ b/Library/Homebrew/macos_version.rb @@ -42,7 +42,7 @@ class MacOSVersion < Version def initialize(version) raise MacOSVersion::Error, version unless /\A1\d+(?:\.\d+){0,2}\Z/.match?(version) - super(version) + super(T.must(version)) @comparison_cache = {} end diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 016c80382e..4af61b3d72 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -541,11 +541,11 @@ class BottleSpecification end alias eql? == - sig { params(tag: Utils::Bottles::Tag).returns(T.any(Symbol, String)) } + sig { params(tag: Utils::Bottles::Tag).returns(String) } def tag_to_cellar(tag = Utils::Bottles.tag) spec = collector.specification_for(tag) if spec.present? - spec.cellar + spec.cellar.to_s else tag.default_cellar end diff --git a/Library/Homebrew/sorbet/parlour.rb b/Library/Homebrew/sorbet/parlour.rb index 6c64b82b53..66ca7aa820 100644 --- a/Library/Homebrew/sorbet/parlour.rb +++ b/Library/Homebrew/sorbet/parlour.rb @@ -10,7 +10,7 @@ end module Homebrew # Parlour type signature generator helper class for Homebrew. module Parlour - ROOT_DIR = T.let(Pathname(__dir__).parent.realpath.freeze, Pathname).freeze + ROOT_DIR = T.let(Pathname(T.must(__dir__)).parent.realpath.freeze, Pathname).freeze sig { returns(T::Array[Parser::AST::Node]) } def self.ast_list diff --git a/Library/Homebrew/unpack_strategy.rb b/Library/Homebrew/unpack_strategy.rb index 3f6f93d61f..d52d633db8 100644 --- a/Library/Homebrew/unpack_strategy.rb +++ b/Library/Homebrew/unpack_strategy.rb @@ -132,7 +132,7 @@ module UnpackStrategy children = tmp_unpack_dir.children - if children.count == 1 && !children.first.directory? + if children.size == 1 && !children.fetch(0).directory? s = UnpackStrategy.detect(children.first, prioritize_extension: prioritize_extension) s.extract_nestedly(to: to, verbose: verbose, prioritize_extension: prioritize_extension) diff --git a/Library/Homebrew/unversioned_cask_checker.rb b/Library/Homebrew/unversioned_cask_checker.rb index fb3d02d040..842181365e 100644 --- a/Library/Homebrew/unversioned_cask_checker.rb +++ b/Library/Homebrew/unversioned_cask_checker.rb @@ -158,7 +158,7 @@ module Homebrew top_level_info_plist_paths.each(&parse_info_plist) ensure Cask::Utils.gain_permissions_remove(extract_dir) - extract_dir.mkpath + Pathname(extract_dir).mkpath end end @@ -252,7 +252,7 @@ module Homebrew }.uniq ensure Cask::Utils.gain_permissions_remove(extract_dir) - extract_dir.mkpath + Pathname(extract_dir).mkpath end end diff --git a/Library/Homebrew/utils/bottles.rb b/Library/Homebrew/utils/bottles.rb index 1c11ecf630..a4ee5d9e7f 100644 --- a/Library/Homebrew/utils/bottles.rb +++ b/Library/Homebrew/utils/bottles.rb @@ -65,12 +65,14 @@ module Utils receipt_file = file_from_bottle(bottle_file, receipt_file_path) tap = Tab.from_file_content(receipt_file, "#{bottle_file}/#{receipt_file_path}").tap "#{tap}/#{name}" if tap.present? && !tap.core_tap? - elsif (bottle_json_path = Pathname(bottle_file.sub(/\.(\d+\.)?tar\.gz$/, ".json"))) && - bottle_json_path.exist? && + else + bottle_json_path = Pathname(bottle_file.sub(/\.(\d+\.)?tar\.gz$/, ".json")) + if bottle_json_path.exist? && (bottle_json_path_contents = bottle_json_path.read.presence) && (bottle_json = JSON.parse(bottle_json_path_contents).presence) && bottle_json.is_a?(Hash) - bottle_json.keys.first.presence + bottle_json.keys.first.presence + end end full_name ||= name diff --git a/Library/Homebrew/yard/templates/default/docstring/html/setup.rb b/Library/Homebrew/yard/templates/default/docstring/html/setup.rb index 27272f9ff6..860f921ef5 100644 --- a/Library/Homebrew/yard/templates/default/docstring/html/setup.rb +++ b/Library/Homebrew/yard/templates/default/docstring/html/setup.rb @@ -4,7 +4,7 @@ def init # `sorbet` is available transitively through the `yard-sorbet` plugin, but we're # outside of the standalone sorbet config, so `checked` is enabled by default - T.bind(self, YARD::Templates::Template, checked: false) + T.bind(self, T.all(Class, YARD::Templates::Template), checked: false) super return if sections.empty? From 75179e923973166d75324355b721e665791acbe7 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Sun, 5 Nov 2023 09:10:28 -0800 Subject: [PATCH 4/8] brew style --fix --- Library/Homebrew/cask/artifact/relocated.rb | 2 +- Library/Homebrew/utils/bottles.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cask/artifact/relocated.rb b/Library/Homebrew/cask/artifact/relocated.rb index 97bc0e8dda..ecb6ba3242 100644 --- a/Library/Homebrew/cask/artifact/relocated.rb +++ b/Library/Homebrew/cask/artifact/relocated.rb @@ -13,7 +13,7 @@ module Cask source_string, target_hash = args if target_hash - raise CaskInvalidError.new(cask) unless target_hash.respond_to?(:keys) + raise CaskInvalidError, cask unless target_hash.respond_to?(:keys) target_hash.assert_valid_keys(:target) end diff --git a/Library/Homebrew/utils/bottles.rb b/Library/Homebrew/utils/bottles.rb index a4ee5d9e7f..43fb16dd92 100644 --- a/Library/Homebrew/utils/bottles.rb +++ b/Library/Homebrew/utils/bottles.rb @@ -68,9 +68,9 @@ module Utils else bottle_json_path = Pathname(bottle_file.sub(/\.(\d+\.)?tar\.gz$/, ".json")) if bottle_json_path.exist? && - (bottle_json_path_contents = bottle_json_path.read.presence) && - (bottle_json = JSON.parse(bottle_json_path_contents).presence) && - bottle_json.is_a?(Hash) + (bottle_json_path_contents = bottle_json_path.read.presence) && + (bottle_json = JSON.parse(bottle_json_path_contents).presence) && + bottle_json.is_a?(Hash) bottle_json.keys.first.presence end end From ca90f9866a54fc7886cf99d89707ec2ac026b3f2 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Sun, 5 Nov 2023 09:20:34 -0800 Subject: [PATCH 5/8] Resolve type error --- Library/Homebrew/formula_installer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 891e3209d5..41ec3200b5 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -175,7 +175,7 @@ class FormulaInstaller unless bottle.compatible_locations? if output_warning - prefix = Pathname(bottle.cellar).parent + prefix = Pathname(bottle.cellar.to_s).parent opoo <<~EOS Building #{formula.full_name} from source as the bottle needs: - HOMEBREW_CELLAR: #{bottle.cellar} (yours is #{HOMEBREW_CELLAR}) From 3c0506e2760ef82f769871eb46eb01db8fa72fde Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Sun, 5 Nov 2023 12:23:42 -0800 Subject: [PATCH 6/8] Fix tag_to_cellar --- Library/Homebrew/software_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 4af61b3d72..c1042875c9 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -541,11 +541,11 @@ class BottleSpecification end alias eql? == - sig { params(tag: Utils::Bottles::Tag).returns(String) } + sig { params(tag: Utils::Bottles::Tag).returns(T.any(Symbol, String)) } def tag_to_cellar(tag = Utils::Bottles.tag) spec = collector.specification_for(tag) if spec.present? - spec.cellar.to_s + spec.cellar else tag.default_cellar end @@ -557,7 +557,7 @@ class BottleSpecification return true if RELOCATABLE_CELLARS.include?(cellar) - prefix = Pathname(cellar).parent.to_s + prefix = Pathname(cellar.to_s).parent.to_s cellar_relocatable = cellar.size >= HOMEBREW_CELLAR.to_s.size && ENV["HOMEBREW_RELOCATE_BUILD_PREFIX"].present? prefix_relocatable = prefix.size >= HOMEBREW_PREFIX.to_s.size && ENV["HOMEBREW_RELOCATE_BUILD_PREFIX"].present? From bf33991d80ceb85d07efef0753375def625985a5 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Sun, 5 Nov 2023 08:56:10 -0800 Subject: [PATCH 7/8] Revert "git grep -l '10461' | xargs gsed -i 's|10461|11116|g'" This reverts commit 61691aa48a27d867687396e75cc3d67a16766dc5. --- Library/Homebrew/test/utils/backtrace_spec.rb | 18 +++++++++--------- .../Homebrew/vendor/bundle/bundler/setup.rb | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Library/Homebrew/test/utils/backtrace_spec.rb b/Library/Homebrew/test/utils/backtrace_spec.rb index 0be1a1e051..3757c38da2 100644 --- a/Library/Homebrew/test/utils/backtrace_spec.rb +++ b/Library/Homebrew/test/utils/backtrace_spec.rb @@ -23,20 +23,20 @@ describe Utils::Backtrace do let(:backtrace_with_sorbet_paths) do [ "/Library/Homebrew/downloadable.rb:75:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/_methods.rb:270:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/_methods.rb:270:in", "/Library/Homebrew/downloadable.rb:50:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/_methods.rb:270:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/_methods.rb:270:in", "/Library/Homebrew/cmd/fetch.rb:236:in", "/Library/Homebrew/cmd/fetch.rb:201:in", "/Library/Homebrew/cmd/fetch.rb:178:in", "/Library/Homebrew/simulate_system.rb:29:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/call_validation.rb:157:in", - "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.11116/lib/_methods.rb:270:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/call_validation.rb:157:in", + "/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/_methods.rb:270:in", "/Library/Homebrew/cmd/fetch.rb:166:in", "/Library/Homebrew/cmd/fetch.rb:163:in", "/Library/Homebrew/cmd/fetch.rb:163:in", diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 73ab5799c2..1752b03fb9 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -69,7 +69,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/racc-1.7.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parser-3.2.2.4/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/sorbet-runtime-0.5.11116/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-runtime-0.5.10461/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parlour-8.1.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/patchelf-1.4.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/plist-3.7.0/lib") @@ -107,9 +107,9 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov_json_formatter-0.1.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-0.22.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-cobertura-2.1.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-0.5.11116-universal-darwin-22/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-0.5.11116/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-and-runtime-0.5.11116/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-0.5.10461-universal-darwin-22/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-0.5.10461/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-and-runtime-0.5.10461/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/thor-1.3.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/spoom-1.1.11/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/universal-darwin-22/#{Gem.extension_api_version}/stackprof-0.2.25") From 57baeb850d77e993c980d1d4bc8e10a96e2dd81f Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Sun, 5 Nov 2023 08:56:19 -0800 Subject: [PATCH 8/8] Revert "bundle update sorbet-static-and-runtime" This reverts commit c889eb5c661c5c473e3e8fe1f9e4b2fe2fea4c23. --- Library/Homebrew/Gemfile.lock | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 705196b15d..26c03b34ab 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -134,14 +134,22 @@ GEM simplecov_json_formatter (0.1.4) simpleidn (0.2.1) unf (~> 0.1.4) - sorbet (0.5.11116) - sorbet-static (= 0.5.11116) - sorbet-runtime (0.5.11116) - sorbet-static (0.5.11116-universal-darwin) - sorbet-static (0.5.11116-x86_64-linux) - sorbet-static-and-runtime (0.5.11116) - sorbet (= 0.5.11116) - sorbet-runtime (= 0.5.11116) + sorbet (0.5.10461) + sorbet-static (= 0.5.10461) + sorbet-runtime (0.5.10461) + sorbet-static (0.5.10461-universal-darwin-14) + sorbet-static (0.5.10461-universal-darwin-15) + sorbet-static (0.5.10461-universal-darwin-16) + sorbet-static (0.5.10461-universal-darwin-17) + sorbet-static (0.5.10461-universal-darwin-18) + sorbet-static (0.5.10461-universal-darwin-19) + sorbet-static (0.5.10461-universal-darwin-20) + sorbet-static (0.5.10461-universal-darwin-21) + sorbet-static (0.5.10461-universal-darwin-22) + sorbet-static (0.5.10461-x86_64-linux) + sorbet-static-and-runtime (0.5.10461) + sorbet (= 0.5.10461) + sorbet-runtime (= 0.5.10461) spoom (1.1.11) sorbet (>= 0.5.9204) sorbet-runtime (>= 0.5.9204)