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

brew desc --eval-all --search SEARCHTERM fails with confusing message #16188

Closed
3 tasks done
jwodder opened this issue Nov 6, 2023 · 5 comments · Fixed by #16195
Closed
3 tasks done

brew desc --eval-all --search SEARCHTERM fails with confusing message #16188

jwodder opened this issue Nov 6, 2023 · 5 comments · Fixed by #16195
Labels
bug Reproducible Homebrew/brew bug help wanted We want help addressing this outdated PR was locked due to age

Comments

@jwodder
Copy link

jwodder commented Nov 6, 2023

brew doctor output

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:
  hdf5@1.8
  openssl@1.1

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

HOMEBREW_VERSION: 4.1.18
ORIGIN: https://github.com/Homebrew/brew
HEAD: bf8991f0d777fe8e33105f0cd7bf1e5993eed60a
Last commit: 8 days ago
Core tap JSON: 06 Nov 10:59 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_CLEANUP_MAX_AGE_DAYS: 1
HOMEBREW_EDITOR: /usr/local/bin/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 icelake
Clang: 15.0.0 build 1500
Git: 2.42.1 => /usr/local/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 14.0-x86_64
CLT: 15.0.0.0.1.1694021235
Xcode: N/A

What were you trying to do (and why)?

I was trying to search through all available formulae using brew desc --search. The error message I got told me to use --eval-all, so I did, but I still got an error unless I instead set HOMEBREW_EVAL_ALL=1. Interestingly, --eval-all does work when not using the --search option

What happened (include all command output)?

$ brew desc -s unicode
Usage: brew desc [options] formula|cask|text|/regex/ [...]

Display formula's name and one-line description. The cache is created on the
first search, making that search slower than subsequent ones.

  -s, --search                     Search both names and descriptions for
                                   text. If text is flanked by slashes, it
                                   is interpreted as a regular expression.
  -n, --name                       Search just names for text. If text is
                                   flanked by slashes, it is interpreted as a
                                   regular expression.
  -d, --description                Search just descriptions for text. If
                                   text is flanked by slashes, it is
                                   interpreted as a regular expression.
      --eval-all                   Evaluate all available formulae and casks,
                                   whether installed or not, to search their
                                   descriptions. Implied if HOMEBREW_EVAL_ALL
                                   is set.
      --formula, --formulae        Treat all named arguments as formulae.
      --cask, --casks              Treat all named arguments as casks.
      --debug                      Display any debugging information.
  -q, --quiet                      Make some output more quiet.
  -v, --verbose                    Make some output more verbose.
  -h, --help                       Show this message.

Error: Invalid usage: `brew desc` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!
[1]
$ brew desc --eval-all -s unicode
==> Formulae
Error: Calling Formula#all without --eval-all or HOMEBREW_EVAL_ALL is disabled! There is no replacement.
[1]
$ brew --eval-all desc -s unicode
Error: Unknown command: --eval-all
[1]
$ brew desc -s unicode --eval-all
==> Formulae
Error: Calling Formula#all without --eval-all or HOMEBREW_EVAL_ALL is disabled! There is no replacement.
[1]
$ brew desc --search unicode --eval-all
==> Formulae
Error: Calling Formula#all without --eval-all or HOMEBREW_EVAL_ALL is disabled! There is no replacement.
[1]
$ brew desc --eval-all just
just: Handy way to save and run project-specific commands
$ HOMEBREW_EVAL_ALL=1 brew desc -s unicode
==> Formulae
ansiweather: Weather in your terminal, with ANSI colors and Unicode symbols
chafa: Versatile and fast Unicode/ASCII/ANSI graphics renderer
chars: Command-line tool to display information about unicode characters
fribidi: Implementation of the Unicode BiDi algorithm
glktermw: Terminal-window Glk library with Unicode support
gucharmap: GNOME Character Map, based on the Unicode Character Database
icu4c: C/C++ and Java libraries for Unicode and globalization
libgrapheme: Unicode string library
libunibreak: Implementation of the Unicode line- and word-breaking algorithms
libuninameslist: Library of Unicode names and annotation data
libunistring: C string library for manipulating Unicode strings
mp3unicode: Command-line utility to convert mp3 tags between different encodings
rxvt-unicode: Rxvt fork with Unicode support
simdutf: Unicode conversion routines, fast
uni: Unicode database query tool for the command-line
uniutils: Manipulate and analyze Unicode text
unum: Interconvert numbers, Unicode, and HTML/XHTML entities
utf8proc: Clean C library for processing UTF-8 Unicode data
wordgrinder: Unicode-aware word processor that runs in a terminal

==> Casks

What did you expect to happen?

brew desc --eval-all -s unicode and other permutations (except brew --eval-all desc -s ..., I guess) should have succeeded.

Step-by-step reproduction instructions (by running brew commands)

See above.
@jwodder jwodder added the bug Reproducible Homebrew/brew bug label Nov 6, 2023
@MikeMcQuaid MikeMcQuaid added the help wanted We want help addressing this label Nov 6, 2023
@MikeMcQuaid
Copy link
Member

Thanks @jwodder for the issue.

I agree that all the --eval-all handling is a bit of a mess. I think ideally brew search (and anything else) should only need --eval-all when evaluating non-Homebrew organisation formulae and just default to core formulae by default.

If/when we're using the JSON API: it shouldn't be needed at all.

CC @Homebrew/maintainers and @Homebrew/security for any thoughts on how this should/should not be working to best balance security and usability.

@bevanjkay
Copy link
Member

Just noting that this does currently work only for casks if you also pass --cask, so there's some inconsistency in the handling.

@p-linnane
Copy link
Member

I agree that all the --eval-all handling is a bit of a mess. I think ideally brew search (and anything else) should only need --eval-all when evaluating non-Homebrew organisation formulae and just default to core formulae by default.

Strongly agree with this.

@MikeMcQuaid
Copy link
Member

Just noting that this does currently work only for casks if you also pass --cask, so there's some inconsistency in the handling.

@bevanjkay can you elaborate a bit more there, not sure I fully understand. Thanks ❤️

@bevanjkay
Copy link
Member

At present, if you run the command brew search --desc --eval-all test you will see the error above.

However if you also pass the --cask flag it will allow the search for casks only, without the error.

With --cask you cannot search --desc without --eval-all, but adding the --eval-all flag allows the search to succeed.

@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 help wanted We want help addressing this outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants