From b9784f4d8af9f6a612748267b4d58a9ea8c14936 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Sun, 17 May 2026 01:01:20 +0000 Subject: [PATCH 1/2] sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sorbet.yml) workflow. --- Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi | 3 --- 1 file changed, 3 deletions(-) diff --git a/Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi b/Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi index 86f9a88dae98a..5e2f38940e4a1 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi @@ -10,9 +10,6 @@ module Cask sig { returns(String) } def appdir; end - sig { returns(String) } - def appimagedir; end - sig { returns(String) } def audio_unit_plugindir; end From 39ee3285ab6ab0da9dfbff01dd076efea382b0d4 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sun, 17 May 2026 15:12:20 +0100 Subject: [PATCH 2/2] tapioca/compilers/cask/config: Add Linux-only `Cask::Config` keys too - The DSL compiler iterates over `Cask::Config.defaults` to emit accessor methods. On macOS that map omits `appimagedir` because it lives in the Linux-only `OS::Linux::Cask::Config::ClassMethods::DEFAULT_DIRS` (moved there in 48ac0fb503). Running `brew tc --update` on macOS therefore deleted `def appimagedir; end` from the RBI, which then broke Sorbet's view of `cask/artifact/appimage.rb`. - Maintain a small list of Linux-only dir names in the compiler and merge them into the key set so the generated RBI is OS-independent. Trying to retrieve these dynamically failed on macOS because the Linux-only defaults are inaccessible. Co-Authored-By: Copilot (CLI, agent mode, model Claude Opus 3.7) --- Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi | 3 +++ .../Homebrew/sorbet/tapioca/compilers/cask/config.rb | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi b/Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi index 5e2f38940e4a1..86f9a88dae98a 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi @@ -10,6 +10,9 @@ module Cask sig { returns(String) } def appdir; end + sig { returns(String) } + def appimagedir; end + sig { returns(String) } def audio_unit_plugindir; end diff --git a/Library/Homebrew/sorbet/tapioca/compilers/cask/config.rb b/Library/Homebrew/sorbet/tapioca/compilers/cask/config.rb index 8886c150c5baf..0571cb4220e19 100644 --- a/Library/Homebrew/sorbet/tapioca/compilers/cask/config.rb +++ b/Library/Homebrew/sorbet/tapioca/compilers/cask/config.rb @@ -9,14 +9,21 @@ module Compilers class CaskConfig < Tapioca::Dsl::Compiler ConstantType = type_member { { fixed: T::Module[T.anything] } } + # Dirs defined in `OS::Linux::Cask::Config::ClassMethods::DEFAULT_DIRS` + # that aren't visible to `Cask::Config.defaults` when this compiler is + # run on macOS, but still need accessor methods generated in the RBI. + LINUX_ONLY_DIRS = T.let([:appimagedir].freeze, T::Array[Symbol]) + sig { override.returns(T::Enumerable[T::Module[T.anything]]) } def self.gather_constants = [Cask::Config] sig { override.void } def decorate + keys = Cask::Config.defaults.keys | LINUX_ONLY_DIRS + root.create_module("Cask") do |mod| mod.create_class("Config") do |klass| - Cask::Config.defaults.each do |key, value| + keys.each do |key| return_type = if key == :languages # :languages is a `LazyObject`, so it lazily evaluates to an # array of strings when a method is called on it. @@ -24,7 +31,7 @@ def decorate elsif key.end_with?("?") "T::Boolean" else - value.class.to_s + "String" end klass.create_method(key.to_s, return_type:, class_method: false)