Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
40.23k stars 9.44k forks source link

Supplying `--fetch-HEAD` to `brew outdated` hides version details #17641

Closed yurikoles closed 1 week ago

yurikoles commented 1 week ago

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:
  python-packaging

Verification

brew config output

HOMEBREW_VERSION: 4.3.8-89-g8c4c731
ORIGIN: https://github.com/Homebrew/brew
HEAD: 8c4c7319fc6ba3a69b1ba65659b03d418ebbfb2f
Last commit: 22 hours ago
Core tap HEAD: 3201ad69823702da46386deebee3a5cd3940bed6
Core tap last commit: 32 minutes ago
Core tap JSON: 06 Jul 06:59 UTC
Core cask tap HEAD: c975d947a482b60516faf45688f179e4b2088351
Core cask tap last commit: 2 hours ago
Core cask tap JSON: 06 Jul 06:59 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: ["--no-quarantine"]
HOMEBREW_DEVELOPER: set
HOMEBREW_EDITOR: subl -w
HOMEBREW_FORCE_BREWED_CURL: set
HOMEBREW_FORCE_BREWED_GIT: set
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.3 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 16.0.0 build 1600
Git: 2.45.2 => /opt/homebrew/opt/git/bin/git
Curl: 8.8.0 => /opt/homebrew/opt/curl/bin/curl
macOS: 14.5-arm64
CLT: 16.0.0.0.1.1719078471
Xcode: 16.0 => /Applications/Xcode_16_beta_2.app/Contents/Developer
Rosetta 2: false

What were you trying to do (and why)?

List all outdated apps with corresponding versions, including HEAD.

What happened (include all command output)?

$ brew outdated             
hwloc (2.11.0) < 2.11.1
usb.ids (2024.03.18) < 2024.07.04
pixelflasher (6.8.0.4) != 7.0.0.0
$ brew outdated --fetch-HEAD
hwloc
usb.ids
pixelflasher

--verbose flag doesn't make any difference, as well as --formulae flag, which just skips casks.

What did you expect to happen?

brew outdated --fetch-HEAD should show upgrades with corresponding version changes, at least non-head ones.

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

You don't need to have any HEAD formula installed to see the difference between the following two commands, given you have at least one outdated app.

$ brew outdated
$ brew outdated --fetch-HEAD
issyl0 commented 1 week ago

🤔 I can't reproduce this:

$ brew outdated
deckset (2.0.25,2636) != 2.0.32,2687
font-anonymice-nerd-font (3.0.2) != 3.2.1
font-fira-code-nerd-font (3.0.2) != 3.2.1
font-monofur-nerd-font (3.0.2) != 3.2.1
$ brew outdated --fetch-HEAD
deckset (2.0.25,2636) != 2.0.32,2687
font-anonymice-nerd-font (3.0.2) != 3.2.1
font-fira-code-nerd-font (3.0.2) != 3.2.1
font-monofur-nerd-font (3.0.2) != 3.2.1
MikeMcQuaid commented 1 week ago

Closing until a maintainer can reproduce.

EricFromCanada commented 1 week ago

I'm seeing this on ~one~ two of my installations. Adding a ohai Context.current.inspect to cmd/outdated.rb's print_outdated shows that --fetch-HEAD is causing @quiet=true and other values to be nil, in both bash and zsh. Other machines are fine.

$ brew outdated --formula -v | head -n 5
==> #<Context::ContextStruct:0x00000001141b3e50 @debug=false, @quiet=false, @verbose=true>
autoconf (2.71) < 2.72
bdw-gc (8.0.6) < 8.2.6
boost (1.78.0_1) < 1.85.0
c-ares (1.18.1_1) < 1.32.1

$ brew outdated --formula -v --fetch-HEAD | head -n 5
==> #<Context::ContextStruct:0x000000010d854ab8 @debug=nil, @quiet=true, @verbose=nil>
autoconf
bdw-gc
boost
c-ares
EricFromCanada commented 1 week ago

It only occurs if any keg was installed using --HEAD and is up-to-date.

$ brew outdated --formula -v flac123
flac123 (HEAD-d969f2c_1) < 2.1.1
$ brew outdated --formula -v --fetch-HEAD flac123
flac123 (HEAD-d969f2c_1) < 2.1.1

$ brew outdated --formula -v flac123 libpng
flac123 (HEAD-d969f2c_1) < 2.1.1
$ brew outdated --formula -v --fetch-HEAD flac123 libpng
flac123