Homebrew / brew

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

`brew upgrade` Not Updating Casks #1946

Closed SeanSith closed 7 years ago

SeanSith commented 7 years ago

When looking to install newer versions of Casks, running brew upgrade then brew cask info [cask] shows an older version of the cask until brew cask update is run.

Please follow the general troubleshooting steps first:

Bug reports:

Having immediately run a brew upgrade just prior, an attempt to identify and install a newer cask shows the older version until brew cask update is run. While I don't have the option to provide output to this effect, a brew update fails to update casks in the same way.

$ brew upgrade
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
artifactory                ldc                        rakudo-star
bazel                      libressl                   riak
bit                        logstash                   ruby-build
certbot                    mediaconch                 saldl
conan                      mercurial ✔                skinny
docker-compose             minimesos                  tika
docker-compose-completion  mpd                        vim ✔
filebeat                   nginx                      vnu
grails                     node                       wallpaper
ipmitool                   node-build                 wpcli-completion ✔
jenkins                    nodeenv                    yarn
jsonnet                    oath-toolkit               you-get
knot                       portaudio                  youtube-dl
kobalt                     qt5

==> Upgrading 16 outdated packages, with result:
awscli 1.11.44, vitorgalvao/tiny-scripts/cask-repair 0.30.1, homebrew/php/composer 1.3.2, gd 2.2.4_1, go 1.7.5, imagemagick 7.0.4-6, libevent 2.1.8, libtiff 4.0.7_2, mercurial 4.1, openssl 1.0.2k, openssl@1.1 1.1.0d, redis 3.2.7, tmux 2.3_3, vim 8.0.0295, webp 0.6.0, wpcli-completion 1.1.0

... upgrades of above packages removed for some level of brevity ...

$ brew cask info chefdk
chefdk: 1.1.16-1
https://downloads.chef.io/chefdk/
/usr/local/Caskroom/chefdk/1.1.16-1 (2 files, 65.2M)
From: https://github.com/caskroom/homebrew-cask/blob/master/Casks/chefdk.rb
==> Names
Chef Development Kit
ChefDK
==> Artifacts
chefdk-1.1.16-1.pkg (pkg)

$ brew cask update
Warning: Calling `brew cask update` is deprecated and will be disabled on 2017-07-01!
Use `brew update` instead.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:111:in `run_command'

==> Updated 3 taps (caskroom/cask, caskroom/drivers, caskroom/versions).

$ brew cask info chefdk
chefdk: 1.2.20-1
https://downloads.chef.io/chefdk/
/usr/local/Caskroom/chefdk/1.1.16-1 (2 files, 65.2M)
From: https://github.com/caskroom/homebrew-cask/blob/master/Casks/chefdk.rb
==> Names
Chef Development Kit
ChefDK
==> Artifacts
chefdk-1.2.20-1.pkg (pkg)

brew doctor:

$ brew doctor
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 and just ignore them. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Users/ssmith/.pyenv/shims/python-config
  /Users/ssmith/.pyenv/shims/python2-config
  /Users/ssmith/.pyenv/shims/python2.7-config
  /Users/ssmith/.pyenv/shims/python3-config
  /Users/ssmith/.pyenv/shims/python3.5-config
  /Users/ssmith/.pyenv/shims/python3.5m-config

brew config:

$ brew config
HOMEBREW_VERSION: 1.1.9
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 664d0c67d5947605c914c4c56ebcfaa80cb6eca0
Last commit: 3 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9f9a3222a276e27ad229bcd6be9a5d69b8862037
Core tap last commit: 11 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
GCC-4.2: build 5666
Clang: 8.0 build 800
Git: 2.11.0 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /Users/ssmith/.pyenv/shims/python => /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /Users/ssmith/.rbenv/shims/ruby => /Users/ssmith/.rbenv/versions/2.4.0/bin/ruby
Java: 1.8.0_112, 1.8.0_92, 1.8.0_77, 1.8.0_74, 1.8.0_72, 1.8.0_66, 1.8.0_60, 1.8.0_51, 1.8.0_45, 1.8.0_40, 1.8.0_31, 1.8.0_25, 1.8.0_20
macOS: 10.12.3-x86_64
Xcode: 8.2.1
CLT: 8.2.0.0.1.1480973914
X11: 2.7.11 => /opt/X11
SeanSith commented 7 years ago

Because I forgot. Sorry. brew cask doctor:

$ brew cask doctor
==> macOS Release:
10.12.3
==> Hardware Architecture:
intel-64
==> Ruby Version:
2.0.0-p648
==> Ruby Path:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
==> Homebrew Version:
Homebrew 1.1.9
Homebrew/homebrew-core (git revision 9f9a3; last commit 2017-02-02)
==> Homebrew Executable Path:
/usr/local/bin/brew
==> Homebrew Cellar Path:
/usr/local/Cellar
==> Homebrew Repository Path:
/usr/local/Homebrew
==> Homebrew Origin:
https://github.com/Homebrew/brew.git
==> Homebrew-Cask Version:
Homebrew-Cask 1.1.9
caskroom/homebrew-cask (git revision e7646; last commit 2017-02-02)
==> Homebrew-Cask Install Location:
<NONE>
==> Homebrew-Cask Staging Location:
/usr/local/Caskroom
==> Homebrew-Cask Cached Downloads:
/Users/ssmith/Library/Caches/Homebrew/Cask
13 files, 429.1M (warning: run "brew cask cleanup")
==> Homebrew-Cask Default Tap Path:
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask
==> Homebrew-Cask Alternate Cask Taps:
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-drivers
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-eid
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-fonts
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions
==> Homebrew-Cask Default Tap Cask Count:
3530
==> Contents of $LOAD_PATH:
/usr/local/Homebrew/Library/Homebrew/cask/lib
/usr/local/Homebrew/Library/Homebrew
/Library/Ruby/Site/2.0.0
/Library/Ruby/Site/2.0.0/x86_64-darwin16
/Library/Ruby/Site/2.0.0/universal-darwin16
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/x86_64-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/x86_64-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16
==> Contents of $RUBYLIB Environment Variable:
<NONE>
==> Contents of $RUBYOPT Environment Variable:
<NONE>
==> Contents of $RUBYPATH Environment Variable:
<NONE>
==> Contents of $RBENV_VERSION Environment Variable:
<NONE>
==> Contents of $CHRUBY_VERSION Environment Variable:
<NONE>
==> Contents of $GEM_HOME Environment Variable:
<NONE>
==> Contents of $GEM_PATH Environment Variable:
<NONE>
==> Contents of $BUNDLE_PATH Environment Variable:
<NONE>
==> Contents of $PATH Environment Variable:
PATH="~/.bin:/Users/ssmith/.pyenv/shims:/Users/ssmith/.pyenv/bin:/Users/ssmith/.nvm/versions/node/v6.9.4/bin:~/.pear/bin:/opt/chefdk/bin:/Users/ssmith/.rbenv/shims:/Users/ssmith/.rbenv/bin:/Users/ssmith/.composer/vendor/bin:/usr/local/opt/php56/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/MacGPG2/bin:/usr/local/opt/go/libexec/bin:/usr/local/Homebrew/Library/Taps/homebrew/homebrew-boneyard/cmd:/usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle/cmd:/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/cmd:/usr/local/Homebrew/Library/Homebrew/cask/cmd:/usr/local/Homebrew/Library/Homebrew/shims/scm"
==> Contents of $SHELL Environment Variable:
SHELL="/bin/bash"
==> Contents of Locale Environment Variables:
LANG="en_US.UTF-8"
vitorgalvao commented 7 years ago

brew cask update is deprecated and simply an alias for brew update, as the message tells you.

I see nothing wrong, here. Your brew cask update states clearly ==> Updated 3 taps (caskroom/cask, caskroom/drivers, caskroom/versions). Since chefdk was updated recently, this simply looks like it was updated between your info and your following update.

Unless you can reproduce with other casks, I don’t see anything out of the ordinary.

SeanSith commented 7 years ago

All of these steps were accomplished within about 2 minutes approximately 15 hours after https://github.com/caskroom/homebrew-cask/pull/29678 was merged. I don't see how this isn't a problem in some fashion.

vitorgalvao commented 7 years ago

@SeanSith But it may also have been a weird one-time occurrence due to something on your setup/connection/machine.

Like I said, can you reproduce this reliably? Because I can’t reproduce it at all. brew cask update has always been an alias to brew update.

SeanSith commented 7 years ago

To my recollection, yes (it finally got to the point where I decided to file an issue). I'll note one when the next Cask gets merged in github.com/caskroom/homebrew-cask.

vitorgalvao commented 7 years ago

@SeanSith Thank you, please do. But please use brew update instead of brew cask update, next time.

SeanSith commented 7 years ago

I did use brew upgrade as a starting point, which has the effect of brew update does it not?

vitorgalvao commented 7 years ago

Yes, I mean in that intermediary step where you used brew cask update, use brew update instead. By your report it seems like the second time you called it, the update was forced again to something it hadn’t done, so it’s just to check.

MikeMcQuaid commented 7 years ago

Note the brew upgrade does not necessarily update tapped Cask repositories for speed reasons. Run brew update to ensure you're up-to-date.

vitorgalvao commented 7 years ago

Note the brew upgrade does not necessarily update tapped Cask repositories for speed reasons.

I thought the automatic updates that now occur by default (unless given HOMEBREW_NO_AUTO_UPDATE=1) ran the exact same thing as brew update. So you’re saying it does not, and updates only a subset of repos?

If that’s the case, there’s the mystery solved right there.

MikeMcQuaid commented 7 years ago

So you’re saying it does not, and updates only a subset of repos?

Yep, only repos with formulae.

vitorgalvao commented 7 years ago

@MikeMcQuaid Thank you for the clarification.

@SeanSith So it’s expected behaviour, just not for the reason I initially thought.

SeanSith commented 7 years ago

@vitorgalvao @MikeMcQuaid Ok. I can follow that. Any chance we'd consider changing that behavior? I would imagine that new users might not have the brew update && brew upgrade workflow in their fingers. I certainly dropped it whenever brew upgrade started (sort of) doing both.

Any chance the analytics shows the average amount of time it takes to update the most frequently used/default taps?

MikeMcQuaid commented 7 years ago

Any chance we'd consider changing that behavior?

Yeh, I'll consider it if we see a few more confused reports like this.

Any chance the analytics shows the average amount of time it takes to update the most frequently used/default taps?

Sadly it does not.

vitorgalvao commented 7 years ago

One more confused user.

waldyrious commented 7 years ago

Even if the non-update of casks is kept, maybe the auto-update message could point out what it hasn't updated. Something like this:

$ brew install foo
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from b38c52f9 to 30a2f270.
Updated 2 taps (homebrew/core, homebrew/science).
Note: Casks and external taps are not automatically updated. Do do so, run:
  brew update
(...)