Skip to content
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

cmd/desc: fix handling of --eval-all with formulae #16195

Merged

Conversation

apainintheneck
Copy link
Contributor

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Fixes #16188

This was caused by some refactoring of Formula.all a few months ago.

In this case, --eval-all was not propagated to the Formula.all command which caused a few different description related commands not to work.

Broken commands:

  • brew search --desc --eval-all TERM
  • brew desc --search --eval-all TERM
  • brew desc --descriptions --eval-all TERM

These commands will fail if the cache store has not already been built locally since this specific method call is only needed when building the cache store not accessing it. The cache store file can be found at:

"$(brew --cache)/descriptions.json"

Before:

$ brew desc --search --eval-all test
==> Formulae
Error: Calling Formula#all without --eval-all or HOMEBREW_EVAL_ALL is disabled! There is no replacement.
$ brew search --desc --eval-all test
==> Formulae
Error: Calling Formula#all without --eval-all or HOMEBREW_EVAL_ALL is disabled! There is no replacement.
$ brew desc --description --eval-all test
==> Formulae
Error: Calling Formula#all without --eval-all or HOMEBREW_EVAL_ALL is disabled! There is no replacement.

After these changes, the file should be created and the commands should work as expected.

This was caused by some refactoring of `Formula.all` a few months ago.

In this case, `eval-all` was not propagated to the Formula.all command
which caused a few different description related commands not to work.

Broken commands:
- `brew search --desc --eval-all TERM`
- `brew desc --search --eval-all TERM`
- `brew desc --descriptions --eval-all TERM`
@apainintheneck apainintheneck added the bug Reproducible Homebrew/brew bug label Nov 8, 2023
Copy link
Member

@Bo98 Bo98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@Bo98 Bo98 merged commit 12d491b into Homebrew:master Nov 8, 2023
28 checks passed
@github-actions github-actions bot added the outdated PR was locked due to age label Dec 9, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/brew bug outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

brew desc --eval-all --search SEARCHTERM fails with confusing message
2 participants