Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.72k stars 10.61k forks source link

brew bump - Error: no implicit conversion of nil into String #153446

Closed Najihel closed 8 months ago

Najihel commented 11 months ago

Verification

Description of issue

Hello,

I would like to create a PR for the outdated foxit-pdf-editor following https://github.com/Homebrew/homebrew-cask/blob/HEAD/CONTRIBUTING.md#updating-a-cask

The brew bump failed with Error: no implicit conversion of nil into String error.

Regards

Command that failed

brew bump --open-pr foxit-pdf-editor

Output of command with --verbose --debug

~ % brew bump --open-pr foxit-pdf-editor --verbose --debug
/usr/bin/env /opt/homebrew/opt/curl/bin/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.1.6-6-g5eaa9f9\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 13.5\)\ curl/8.1.2 --header Accept-Language:\ en --retry 3 --location --silent https://repology.org/api/v1/project/foxit-pdf-editor
Error: no implicit conversion of nil into String
Please report this issue:
  https://docs.brew.sh/Troubleshooting
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:84:in `initialize'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:84:in `Pathname'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:84:in `can_load?'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:175:in `can_load?'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:420:in `block in for'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:419:in `each'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:419:in `for'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:406:in `load'
/opt/homebrew/Library/Homebrew/dev-cmd/bump.rb:308:in `block (2 levels) in retrieve_versions_by_arch'
/opt/homebrew/Library/Homebrew/simulate_system.rb:29:in `with'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:157:in `call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:157:in `validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/_methods.rb:270:in `block in _on_method_added'
/opt/homebrew/Library/Homebrew/dev-cmd/bump.rb:300:in `block in retrieve_versions_by_arch'
/opt/homebrew/Library/Homebrew/dev-cmd/bump.rb:299:in `each'
/opt/homebrew/Library/Homebrew/dev-cmd/bump.rb:299:in `retrieve_versions_by_arch'
/opt/homebrew/Library/Homebrew/dev-cmd/bump.rb:394:in `retrieve_and_display_info_and_open_pr'
/opt/homebrew/Library/Homebrew/dev-cmd/bump.rb:145:in `block in handle_formula_and_casks'
/opt/homebrew/Library/Homebrew/dev-cmd/bump.rb:123:in `each'
/opt/homebrew/Library/Homebrew/dev-cmd/bump.rb:123:in `each_with_index'
/opt/homebrew/Library/Homebrew/dev-cmd/bump.rb:123:in `handle_formula_and_casks'
/opt/homebrew/Library/Homebrew/dev-cmd/bump.rb:93:in `block in bump'
/opt/homebrew/Library/Homebrew/extend/kernel.rb:499:in `with_env'
/opt/homebrew/Library/Homebrew/api.rb:188:in `with_no_api_env'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:157:in `call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:157:in `validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/_methods.rb:270:in `block in _on_method_added'
/opt/homebrew/Library/Homebrew/dev-cmd/bump.rb:65:in `bump'
/opt/homebrew/Library/Homebrew/brew.rb:94:in `<main>'
zsh: exit 1     brew bump --open-pr foxit-pdf-editor --verbose --debug

Output of brew doctor and brew config

~ % brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  hping
zsh: exit 1     brew doctor

~ % brew config
HOMEBREW_VERSION: 4.1.6-6-g5eaa9f9
ORIGIN: https://github.com/Homebrew/brew
HEAD: 5eaa9f995b445db71b38cc2bcafed6ec7e6ac4a0
Last commit: 10 hours ago
Core tap JSON: 22 Aug 09:00 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.hBqlQvx2N7/org.xquartz:0
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_blizzard_avalanche
Clang: 14.0.3 build 1403
Git: 2.42.0 => /opt/homebrew/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 13.5-arm64
CLT: 14.3.1.0.1.1683849156
Xcode: N/A
Rosetta 2: false

Output of brew tap

~ % brew tap
alexhallam/tidy-viewer
esolitos/ipa
homebrew/bundle
homebrew/cask-fonts
homebrew/cask-versions
homebrew/services
ilikejam/csshi
jakehilborn/jakehilborn
linux-noah/noah
muesli/tap
pgollangi/tap
teamookla/speedtest
thatmattlove/oui
theseal/ssh-askpass
vitorgalvao/tiny-scripts
wouterdebie/repo
caizixian commented 10 months ago

I had the same issue with running brew audit. After brew tap --force homebrew/Cask, it's fine.

github-actions[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

AlekSi commented 9 months ago

It is still a problem

bevanjkay commented 9 months ago

@AlekSi do you have developer mode turned on?

AlekSi commented 9 months ago

Commands like brew audit enable it automatically. Here is the full output of the same command as in #156758:

brew audit --cask --online elgato-stream-deck
Warning: audit is a developer command, so Homebrew's
developer mode has been automatically turned on.
To turn developer mode off, run:
  brew developer off

Error: no implicit conversion of nil into String
Please report this issue:
  https://docs.brew.sh/Troubleshooting
Warning: Removed Sorbet lines from backtrace!
Rerun with --verbose to see the original backtrace
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:85:in `initialize'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:85:in `Pathname'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:85:in `can_load?'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:176:in `can_load?'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:427:in `block in for'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:426:in `each'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:426:in `for'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:413:in `load'
/opt/homebrew/Library/Homebrew/dev-cmd/audit.rb:250:in `block (3 levels) in audit'
/opt/homebrew/Library/Homebrew/simulate_system.rb:29:in `with'
/opt/homebrew/Library/Homebrew/dev-cmd/audit.rb:246:in `block (2 levels) in audit'
/opt/homebrew/Library/Homebrew/dev-cmd/audit.rb:243:in `each'
/opt/homebrew/Library/Homebrew/dev-cmd/audit.rb:243:in `flat_map'
/opt/homebrew/Library/Homebrew/dev-cmd/audit.rb:243:in `block in audit'
/opt/homebrew/Library/Homebrew/dev-cmd/audit.rb:240:in `each'
/opt/homebrew/Library/Homebrew/dev-cmd/audit.rb:240:in `each_with_object'
/opt/homebrew/Library/Homebrew/dev-cmd/audit.rb:240:in `audit'
/opt/homebrew/Library/Homebrew/brew.rb:86:in `<main>'
bevanjkay commented 9 months ago

You will also need to have homebrew/homebrew-cask tapped so that the files can be sourced from the repository locally and not from the API.

AlekSi commented 9 months ago

That's good, but then, at least the PR checklist is not accurate. The error message probably could be improved, too. Otherwise, the occasional contributing to casks is rather confusing.

bevanjkay commented 9 months ago

Running the tap command is one of the first instructions in the Contributing documentation.

https://github.com/Homebrew/homebrew-cask/blob/master/CONTRIBUTING.md

AlekSi commented 9 months ago

tap command or word "tap" is not actually mentioned in this file at all.

Let me put it this way. This issue started with brew bump --open-pr foxit-pdf-editor command failing. Using the information about that command from CONTRIBUTING.md ("In most cases, it's very simple to update it…") and PR checklist, it not possible to create a simple drive-by PR that just bumps the version that would pass a PR checklist.

bevanjkay commented 9 months ago

Yes, perhaps it should start with the "Getting Set Up to Contribute" step.

github-actions[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.