Skip to content

Fix type mismatch in brew info #20139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
Merged

Fix type mismatch in brew info #20139

merged 1 commit into from
Jun 17, 2025

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Jun 17, 2025

Follow-up to #20130

Fixes the following issue:

$ brew info hello
==> hello: stable 2.12.2 (bottled)
Program providing model for GNU coding standards and practices
https://www.gnu.org/software/hello/
Not installed
Error: Parameter 'path': Expected type String, got type Pathname with value #<Pathname:Formula/h/hello.rb>
Caller: /opt/homebrew/Library/Homebrew/cmd/info.rb:269
Definition: /opt/homebrew/Library/Homebrew/cmd/info.rb:118 (Homebrew::Cmd::Info#github_remote_path)
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/configuration.rb:296:in 'T::Configuration.call_validation_error_handler_default'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/configuration.rb:303:in 'T::Configuration.call_validation_error_handler'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb:322:in 'T::Private::Methods::CallValidation.report_error'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb:230:in 'block in T::Private::Methods::CallValidation.validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/signature.rb:213:in 'T::Private::Methods::Signature#each_args_value_type'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb:227:in 'T::Private::Methods::CallValidation.validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/_methods.rb:277:in 'block in Homebrew::Cmd::Info#_on_method_added'
/opt/homebrew/Library/Homebrew/cmd/info.rb:269:in 'Homebrew::Cmd::Info#github_info'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/_methods.rb:277:in 'block in Homebrew::Cmd::Info#_on_method_added'
/opt/homebrew/Library/Homebrew/cmd/info.rb:337:in 'Homebrew::Cmd::Info#info_formula'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/_methods.rb:277:in 'block in Homebrew::Cmd::Info#_on_method_added'
/opt/homebrew/Library/Homebrew/cmd/info.rb:166:in 'block in Homebrew::Cmd::Info#print_info'
/opt/homebrew/Library/Homebrew/cmd/info.rb:161:in 'Array#each'
/opt/homebrew/Library/Homebrew/cmd/info.rb:161:in 'Enumerable#each_with_index'
/opt/homebrew/Library/Homebrew/cmd/info.rb:161:in 'Homebrew::Cmd::Info#print_info'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/_methods.rb:277:in 'block in Homebrew::Cmd::Info#_on_method_added'
/opt/homebrew/Library/Homebrew/cmd/info.rb:113:in 'Homebrew::Cmd::Info#run'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/_methods.rb:277:in 'block in Homebrew::Cmd::Info#_on_method_added'
/opt/homebrew/Library/Homebrew/brew.rb:95:in '<main>'
Please report this issue:
  https://docs.brew.sh/Troubleshooting

Since the value of path is now a Pathname, it needs to be explicitly converted to a String to satisfy the signature of github_remote_path

@Rylan12 Rylan12 enabled auto-merge June 17, 2025 21:01
@Rylan12 Rylan12 added this pull request to the merge queue Jun 17, 2025
Merged via the queue into master with commit aeed5eb Jun 17, 2025
52 of 53 checks passed
@Rylan12 Rylan12 deleted the fix-type-mismatch-brew-info branch June 17, 2025 22:04
@MikeMcQuaid
Copy link
Member

Whoops, my bad! Thanks for quick fix here @Rylan12!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants