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 list sometimes returns 1 when all arguments are installed #17434

Closed
3 tasks done
cbandy opened this issue Jun 5, 2024 · 1 comment · Fixed by #17442
Closed
3 tasks done

brew list sometimes returns 1 when all arguments are installed #17434

cbandy opened this issue Jun 5, 2024 · 1 comment · Fixed by #17442
Assignees
Labels
bug Reproducible Homebrew/brew bug help wanted We want help addressing this outdated PR was locked due to age

Comments

@cbandy
Copy link

cbandy commented Jun 5, 2024

brew doctor output

Your system is ready to brew.

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.3.3
ORIGIN: https://github.com/Homebrew/brew
HEAD: e130e47f23b8b806096f9ec4f2c193213b8ec908
Last commit: 3 days ago
Core tap JSON: 05 Jun 19:59 UTC
Core cask tap JSON: 05 Jun 19:59 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: ["--appdir=~/Applications", "--require-sha"]
HOMEBREW_EDITOR: nvim
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 3.3.2 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.2/bin/ruby
CPU: dodeca-core 64-bit arm_lobos
Clang: 15.0.0 build 1500
Git: 2.45.2 => /opt/homebrew/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: N/A
Rosetta 2: false

What were you trying to do (and why)?

I was using brew list to see if I had some things installed.

What happened (include all command output)?

I noticed that listing two things printed what I expected, but the exit code indicated failure.

$ brew list dive rancher ; echo $?
/opt/homebrew/Cellar/dive/0.12.0/bin/dive
==> App
~/Applications/Rancher Desktop.app (631 files, 1.4GB)
1

Listing them separately returns successfully.

$ brew list ; echo $?
==> Formulae


==> Casks

0

$ brew list dive ; echo $?
/opt/homebrew/Cellar/dive/0.12.0/bin/dive
0

$ brew list rancher ; echo $?
==> App
~/Applications/Rancher Desktop.app (631 files, 1.4GB)
0

🤔 Strangely, redirecting the output also succeeds...

$ brew list dive rancher > /dev/null ; echo $?
0

What did you expect to happen?

I expected brew list dive rancher to return a success status/code when both dive and rancher are installed.

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

brew install dive rancher && brew list dive rancher ; echo $?
@cbandy cbandy added the bug Reproducible Homebrew/brew bug label Jun 5, 2024
@issyl0
Copy link
Member

issyl0 commented Jun 5, 2024

I can't reproduce this with two formulae, or for two casks, but I can reproduce it with a formula and a cask. 🤔

$ brew list ripgrep jq; echo $?
/opt/homebrew/Cellar/ripgrep/13.0.0/.crates.toml
/opt/homebrew/Cellar/ripgrep/13.0.0/.crates2.json
/opt/homebrew/Cellar/ripgrep/13.0.0/bin/rg
/opt/homebrew/Cellar/ripgrep/13.0.0/etc/bash_completion.d/rg.bash
/opt/homebrew/Cellar/ripgrep/13.0.0/share/fish/vendor_completions.d/rg.fish
/opt/homebrew/Cellar/ripgrep/13.0.0/share/man/man1/rg.1
/opt/homebrew/Cellar/ripgrep/13.0.0/share/zsh/site-functions/_rg
/opt/homebrew/Cellar/jq/1.7.1/bin/jq
/opt/homebrew/Cellar/jq/1.7.1/include/ (2 files)
/opt/homebrew/Cellar/jq/1.7.1/lib/libjq.1.dylib
/opt/homebrew/Cellar/jq/1.7.1/lib/pkgconfig/libjq.pc
/opt/homebrew/Cellar/jq/1.7.1/lib/ (2 other files)
/opt/homebrew/Cellar/jq/1.7.1/share/doc/ (4 files)
/opt/homebrew/Cellar/jq/1.7.1/share/man/man1/jq.1
0

$ brew list postman discord; echo $?
==> App
/Applications/Postman.app (56 files, 492.9MB)
==> App
/Applications/Discord.app (115 files, 374.9MB)
0

$ brew list jq postman; echo $?
/opt/homebrew/Cellar/jq/1.7.1/bin/jq
/opt/homebrew/Cellar/jq/1.7.1/include/ (2 files)
/opt/homebrew/Cellar/jq/1.7.1/lib/libjq.1.dylib
/opt/homebrew/Cellar/jq/1.7.1/lib/pkgconfig/libjq.pc
/opt/homebrew/Cellar/jq/1.7.1/lib/ (2 other files)
/opt/homebrew/Cellar/jq/1.7.1/share/doc/ (4 files)
/opt/homebrew/Cellar/jq/1.7.1/share/man/man1/jq.1
==> App
/Applications/Postman.app (56 files, 492.9MB)
1

@MikeMcQuaid MikeMcQuaid added the help wanted We want help addressing this label Jun 6, 2024
@MikeMcQuaid MikeMcQuaid self-assigned this Jun 6, 2024
MikeMcQuaid added a commit that referenced this issue Jun 6, 2024
Fix exit codes when providing formulae and casks.

Fixes #17434
@github-actions github-actions bot added the outdated PR was locked due to age label Jul 7, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 7, 2024
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.

3 participants