Homebrew / brew

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

Wrong version shown in output from `brew upgrade` #11900

Closed stweil closed 2 years ago

stweil commented 3 years ago

brew config output

HOMEBREW_VERSION: 3.2.8-53-gd14fc2d
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: d14fc2db125c18832fe83c98fdeb54931dc48f03
Last commit: 22 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 28abde2abbe9051ebed0d10b72da33617832bebd
Core tap last commit: 5 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.LDBDJ7bTYo/org.xquartz:0
HOMEBREW_MAKE_JOBS: 4
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: quad-core 64-bit haswell
Clang: 12.0.5 build 1205
Git: 2.21.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.5.2-x86_64
CLT: 12.5.0.22.9
Xcode: N/A

brew doctor output

Your system is ready to brew.

What were you trying to do (and why)?

I run brew upgrade from time to time for obvious reasons.

What happened (include all command output)?

% brew upgrade
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from 54857c084 to d14fc2db1.
Updated 4 taps (homebrew/cask-versions, homebrew/core, homebrew/cask and homebrew/services).
==> New Formulae
cruft                         ghostunnel                    libaec                        pari-galdata                  pari-seadata                  reproc
eigenpy                       kn                            ots                           pari-galpol                   pari-seadata-big              spot
==> Updated Formulae
Updated 560 formulae.
==> New Casks
clay                                         leapp                                        open-video-downloader                        wing-personal
==> Updated Casks
Updated 355 casks.
==> Deleted Casks
brooklite             lektor                otter-browser         pomolectron           spectrum              uberconference        wingpersonal          youtube-dl-gui
dukto                 open-ecard            pastor                rubitrack-pro         trufont               utox                  wolfram-player

==> Homebrew was updated to version 3.2.8
The changelog can be found at:
  https://github.com/Homebrew/brew/releases/tag/3.2.8
==> Upgrading 7 outdated packages:
wget 1.21.1 -> 1.21.1_1
pango 1.48.8 -> 1.48.9
harfbuzz 2.8.2 -> 2.9.0
glib 2.68.3 -> 2.68.4
ktmpl 0.9.0 -> 0.9.1
eigen 3.3.9 -> 3.4.0
mercurial 5.8.1 -> 5.9
==> Upgrading wget
  1.21.1 -> 1.21.1_1 

==> Downloading https://ghcr.io/v2/homebrew/core/wget/manifests/1.21.1_1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:307217b813330eda365570d7540aa2da69c678b6c4b78000d24048614902eea8
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:307217b813330eda365570d7540aa2da69c678b6c4b78000d24048614902eea8?se=2021-08-22T14%3A10%3A00Z&sig
######################################################################## 100.0%
==> Pouring wget--1.21.1_1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/wget/1.21.1_1: 88 files, 4MB
Removing: /usr/local/Cellar/wget/1.21.1... (88 files, 4MB)
==> Upgrading pango
  1.48.8 -> 1.48.9 

==> Downloading https://ghcr.io/v2/homebrew/core/glib/manifests/2.68.4
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/glib/blobs/sha256:ad356cbc8651147276eff312f762a05fabe846d598886858d4960e6935795823
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:ad356cbc8651147276eff312f762a05fabe846d598886858d4960e6935795823?se=2021-08-22T14%3A10%3A00Z&sig
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/harfbuzz/manifests/2.9.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/harfbuzz/blobs/sha256:5641820f5fdab22faf48a0865dd9f325d27ccd34cbfd327efb43a8e9a0ee5c76
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:5641820f5fdab22faf48a0865dd9f325d27ccd34cbfd327efb43a8e9a0ee5c76?se=2021-08-22T14%3A10%3A00Z&sig
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pango/manifests/1.48.9
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pango/blobs/sha256:4d5de0435e7877931673af1047ce826d0caa762e055ba95ad4c93fd605eccf1b
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:4d5de0435e7877931673af1047ce826d0caa762e055ba95ad4c93fd605eccf1b?se=2021-08-22T14%3A10%3A00Z&sig
######################################################################## 100.0%
==> Installing dependencies for pango: glib and harfbuzz
==> Installing pango dependency: glib
==> Pouring glib--2.68.4.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/glib/2.68.4: 442 files, 21MB
==> Installing pango dependency: harfbuzz
==> Pouring harfbuzz--2.9.0.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/harfbuzz/2.9.0: 68 files, 7.2MB
==> Installing pango
==> Pouring pango--1.48.9.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/pango/1.48.9: 65 files, 3.0MB
Removing: /usr/local/Cellar/pango/1.48.8... (65 files, 3.0MB)
==> Upgrading harfbuzz
  2.9.0 -> 2.9.0 

Removing: /usr/local/Cellar/harfbuzz/2.8.2... (68 files, 7.2MB)
==> Upgrading glib
  2.68.4 -> 2.68.4 

Removing: /usr/local/Cellar/glib/2.68.3... (442 files, 21MB)
==> Upgrading ktmpl
  0.9.0 -> 0.9.1 

==> Downloading https://ghcr.io/v2/homebrew/core/ktmpl/manifests/0.9.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ktmpl/blobs/sha256:0a0b3e7477b6ceb8c1b32ebb47572df7ab5b050ec1d625259cf1c92c03c02e23
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:0a0b3e7477b6ceb8c1b32ebb47572df7ab5b050ec1d625259cf1c92c03c02e23?se=2021-08-22T14%3A10%3A00Z&sig
######################################################################## 100.0%
==> Pouring ktmpl--0.9.1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/ktmpl/0.9.1: 7 files, 2.2MB
Removing: /usr/local/Cellar/ktmpl/0.9.0... (7 files, 2.2MB)
==> Upgrading eigen
  3.3.9 -> 3.4.0 

==> Downloading https://ghcr.io/v2/homebrew/core/eigen/manifests/3.4.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/eigen/blobs/sha256:87b2664bdc6ec98850643d1149ab53c57b9f6c228cabe23f724b0ff331492fca
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:87b2664bdc6ec98850643d1149ab53c57b9f6c228cabe23f724b0ff331492fca?se=2021-08-22T14%3A15%3A00Z&sig
######################################################################## 100.0%
==> Pouring eigen--3.4.0.all.bottle.tar.gz
🍺  /usr/local/Cellar/eigen/3.4.0: 546 files, 8.4MB
Removing: /usr/local/Cellar/eigen/3.3.9... (493 files, 6.6MB)
==> Upgrading mercurial
  5.8.1 -> 5.9 

==> Downloading https://ghcr.io/v2/homebrew/core/mercurial/manifests/5.9
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/mercurial/blobs/sha256:18fde097876d310db4a575f7b92b6817d65fb43772e9e81c2b059dd0036fba0d
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:18fde097876d310db4a575f7b92b6817d65fb43772e9e81c2b059dd0036fba0d?se=2021-08-22T14%3A15%3A00Z&sig
######################################################################## 100.0%
==> Pouring mercurial--5.9.big_sur.bottle.tar.gz
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/mercurial/5.9: 697 files, 11.5MB
Removing: /usr/local/Cellar/mercurial/5.8.1... (690 files, 11.3MB)
==> Casks with 'auto_updates true' or 'version :latest'
            will not be upgraded; pass `--greedy` to upgrade them.
==> Upgrading 1 outdated package:
libreoffice 7.1.5 -> 7.2.0
==> Upgrading libreoffice
==> Downloading https://download.documentfoundation.org/libreoffice/stable/7.2.0/mac/x86_64/LibreOffice_7.2.0_MacOS_x86-64.dmg
==> Downloading from https://tdf.jensgutermuth.de/libreoffice/stable/7.2.0/mac/x86_64/LibreOffice_7.2.0_MacOS_x86-64.dmg
######################################################################## 100.0%
==> Backing App 'LibreOffice.app' up to '/usr/local/Caskroom/libreoffice/7.1.5/LibreOffice.app'
==> Removing App '/Applications/LibreOffice.app'
==> Unlinking Binary '/usr/local/bin/regmerge'
==> Unlinking Binary '/usr/local/bin/regview'
==> Unlinking Binary '/usr/local/bin/senddoc'
==> Unlinking Binary '/usr/local/bin/ui-previewer'
==> Unlinking Binary '/usr/local/bin/uno'
==> Unlinking Binary '/usr/local/bin/unopkg'
==> Unlinking Binary '/usr/local/bin/uri-encode'
==> Unlinking Binary '/usr/local/bin/xpdfimport'
==> Unlinking Binary '/usr/local/bin/soffice'
==> Unlinking Binary '/usr/local/bin/unoinfo'
==> Unlinking Binary '/usr/local/bin/gengal'
==> Moving App 'LibreOffice.app' to '/Applications/LibreOffice.app'
==> Linking Binary 'regmerge' to '/usr/local/bin/regmerge'
==> Linking Binary 'regview' to '/usr/local/bin/regview'
==> Linking Binary 'senddoc' to '/usr/local/bin/senddoc'
==> Linking Binary 'ui-previewer' to '/usr/local/bin/ui-previewer'
==> Linking Binary 'uno' to '/usr/local/bin/uno'
==> Linking Binary 'unopkg' to '/usr/local/bin/unopkg'
==> Linking Binary 'uri-encode' to '/usr/local/bin/uri-encode'
==> Linking Binary 'xpdfimport' to '/usr/local/bin/xpdfimport'
==> Linking Binary 'soffice.wrapper.sh' to '/usr/local/bin/soffice'
==> Linking Binary 'unoinfo' to '/usr/local/bin/unoinfo'
==> Linking Binary 'gengal' to '/usr/local/bin/gengal'
==> Purging files for version 7.1.5 of Cask libreoffice
🍺  libreoffice was successfully upgraded!
==> Caveats
==> mercurial
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions

What did you expect to happen?

I expect correct log messages, but get for example

==> Upgrading harfbuzz
  2.9.0 -> 2.9.0 

instead of

==> Upgrading harfbuzz
  2.8.2 -> 2.9.0 

Many messages show the correct versions, but I observe wrong upgrade messages (always looking like x.y.z -> x.y.z, so claiming that there was no release change) since a long time on different Mac hosts (both Intel and M1).

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

Just run `brew upgrade`. That has a high probability that some messages show wrong versions.
stweil commented 3 years ago

As the upgrade works nevertheless, this is only a cosmetic problem (wrong version in log message). That's why I did not report it up to now.

Rylan12 commented 3 years ago

I was able to reproduce this:

  1. Check out https://github.com/Homebrew/homebrew-core/commit/0518e342b492856cd0493214f31401bd73b73b63
  2. brew install pango
  3. Switch to the master branch
  4. brew upgrade

In this situation, both pango and its dependency, harbuzz, are outdated and will be upgraded by brew upgrade.

I think it shows up differently because it's an outdated dependency. Here, the top-level formula we're trying to upgrade is pango but, of course, we'll upgrade harfbuzz too in the process. Somewhere we must be using the wrong version variable in the log message only in this particular case.

Interestingly, brew upgrade pango in step 4 doesn't seem to have the same problem. I think this is because the logging is different when there's only one top-level formula to upgrade. Running brew upgrade pango harfbuzz does show the issue. In other words, the issue seems to be present when an upgrade was requested for a formula either directly or with a catch-all brew upgrade and that formula is a dependency of another outdated formula that will also be upgraded.

MikeMcQuaid commented 3 years ago

@FnControlOption this is another one that I'm sure isn't related to your changes but if you were able to take a look we'd be super grateful ❤️