Homebrew-cask: brew cask list fails for some formula

Created on 5 Oct 2016  Â·  34Comments  Â·  Source: Homebrew/homebrew-cask

Done : pre bug report guide beforehand. Failure to do so might get your issue closed.

Description of issue

The command brew cask list <formula> fails with some casks, I believe this is related to pkg handling, as the issue is visible with formula java7 (java9-beta as well) but not firefox.

Output of brew cask list --verbose java7

~/opensource ○ ❯ brew cask list --verbose java7
Warning: Calling MacOS.release is deprecated!
Use MacOS.version instead.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/source/path_base.rb:71:in `block in load_cask'

Output of brew doctor

~/opensource ○ ❯ 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: Your Xcode (7.3) is outdated.
Please update to Xcode 8.0 (or delete it).
Xcode can be updated from the App Store.

Output of brew cask doctor

~/opensource ○ ❯ brew cask doctor
==> macOS Release:
10.11.6
==> 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.0.6-22-g47d57ca
Homebrew/homebrew-core (git revision c5f7f; last commit 2016-10-05)
==> 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:
0.60.0 (git revision f2d4; last commit 85 minutes ago)
==> Homebrew-Cask Install Location:
<NONE>
==> Homebrew-Cask Staging Location:
/usr/local/Caskroom
==> Homebrew-Cask Cached Downloads:
/Users/brice/Library/Caches/Homebrew/Cask
0 files, 0B
==> 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-fonts
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions
==> Homebrew-Cask Default Tap Cask Count:
3366
==> 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-darwin15
/Library/Ruby/Site/2.0.0/universal-darwin15
/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-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin15
/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-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15
==> 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="/Users/brice/.jenv/shims:/Users/brice/.cabal/bin:/usr/local/texlive/2012basic/bin/universal-darwin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/brice/.rvm/bin:/usr/local/Homebrew/Library/Homebrew/cask/cmd:/usr/local/Homebrew/Library/Homebrew/shims/scm"
==> Contents of $SHELL Environment Variable:
SHELL="/bin/zsh"
==> Contents of Locale Environment Variables:
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LC_CTYPE="UTF-8"
==> Running As Privileged User:
No

Most helpful comment

brew cask uninstall aegisub && brew cask reinstall aegisub

@keevee09, this won't do anything, because all casks are still using the license stanza as of now.

So... this is expected behaviour right?

Exactly.

All 34 comments

Looks like your versions repo is out of date. Try brew untap caskroom/versions && brew tap caskroom/versions.

Hi @vitorgalvao ,

I just did the command without success :

Output of brew untap caskroom/versions && brew tap caskroom/versions

/usr/local/Homebrew ± ❯ brew untap caskroom/versions && brew tap caskroom/versions
Untapping caskroom/versions... (277 files, 321.3K)
Untapped 0 formulae
==> Tapping caskroom/versions
Cloning into '/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions'...
remote: Counting objects: 259, done.
remote: Compressing objects: 100% (248/248), done.
remote: Total 259 (delta 51), reused 52 (delta 9), pack-reused 0
Receiving objects: 100% (259/259), 87.58 KiB | 0 bytes/s, done.
Resolving deltas: 100% (51/51), done.
Tapped 0 formulae (277 files, 321.3K)
/usr/local/Homebrew ± ❯ brew cask list java7
Warning: Calling MacOS.release is deprecated!
Use MacOS.version instead.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/source/path_base.rb:71:in `block in load_cask'

Looking at the commit in this repo, :

/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions ± ❯ git slog -1
* 246f8de - (grafted, HEAD -> master, origin/master, origin/HEAD) PULL_REQUEST_TEMPLATE.md: update to match main repo (2016-10-05 08:43:37 +0100) VĂ­tor GalvĂŁo

What’s the output of brew cask cat java7?

brew cask cat java7

/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions ± ❯ brew cask cat java7
cask 'java7' do
  version '1.7.0_80'
  sha256 '2b9deef240a7f07d08541da01bbd60cbf93bf713efd5997e586ba23ec4f5089e'

  url 'http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-macosx-x64.dmg',
      cookies: {
                 'oraclelicense' => 'accept-securebackup-cookie',
               }
  name 'Java Standard Edition Development Kit'
  homepage 'http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html'
  license :gratis

  pkg 'JDK 7 Update 80.pkg'

  postflight do
    system '/usr/bin/sudo', '-E', '--',
           '/usr/libexec/PlistBuddy', '-c', 'Add :JavaVM:JVMCapabilities: string BundledApp', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist"
    system '/usr/bin/sudo', '-E', '--',
           '/usr/libexec/PlistBuddy', '-c', 'Add :JavaVM:JVMCapabilities: string JNI',        "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist"
    system '/usr/bin/sudo', '-E', '--',
           '/usr/libexec/PlistBuddy', '-c', 'Add :JavaVM:JVMCapabilities: string WebStart',   "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist"
    system '/usr/bin/sudo', '-E', '--',
           '/usr/libexec/PlistBuddy', '-c', 'Add :JavaVM:JVMCapabilities: string Applets',    "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist"
    system '/usr/bin/sudo', '-E', '--',
           '/bin/mkdir', '-p', '--', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Home/bundle/Libraries"
    system '/usr/bin/sudo', '-E', '--',
           '/bin/ln', '-nsf', '--', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Home/jre/lib/server/libjvm.dylib", "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Home/bundle/Libraries/libserver.dylib"
    if MacOS.version <= :mavericks
      system '/usr/bin/sudo', '-E', '--',
             '/bin/rm', '-rf', '--', '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK'
      system '/usr/bin/sudo', '-E', '--',
             '/bin/ln', '-nsf', '--', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents", '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK'
    end
  end

  uninstall pkgutil: 'com.oracle.jdk7u80',
            delete:  [
                       MacOS.version <= :mavericks ? '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK' : '',
                     ].keep_if { |v| !v.empty? }

  zap       delete: [
                      '~/Library/Application Support/Oracle/Java',
                      '~/Library/Caches/com.oracle.java.Java-Updater',
                      '~/Library/Caches/net.java.openjdk.cmd',
                    ],
            rmdir:  '~/Library/Application Support/Oracle/'

  caveats <<-EOS.undent
    This Cask makes minor modifications to the JRE to prevent any packaged
    application issues.

    If your Java application still asks for JRE installation, you might need to
    reboot or logout/login.

    The JRE packaging bug is discussed here:

        https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361

    Installing this Cask means you have AGREED to the Oracle Binary Code License
    Agreement for Java SE at

        http://www.oracle.com/technetwork/java/javase/terms/license/index.html

    EOS
end

It looks like the same as the one in commit 2e56825ee6ad2d4987a12a439448e2690dde25bf which is the current version of master

What if you run brew cask list --verbose java7 now?

It's the same as with my bug report :

/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions ± ❯ brew cask list --verbose java7
Warning: Calling MacOS.release is deprecated!
Use MacOS.version instead.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/source/path_base.rb:71:in `block in load_cask'

@vitorgalvao: _I_ am _also_ seeing the following output when doing a vanilla brew cask list:

Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/dsl.rb:208:in `license'

Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/dsl.rb:208:in `license'

Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/dsl.rb:208:in `license'

Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/dsl.rb:208:in `license'

Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/dsl.rb:208:in `license'

Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/dsl.rb:208:in `license'

calibre             gimp                google-drive        mactex              sqlitebrowser       xquartz  

I also only started getting this result _today._ Any idea what's going on?

P. S.: I also got a similar warning when went to check whether I needed to update the first item on that list (Calibre) by running brew cask info calibre. Sounds like this might be a bit more serious than we thought


_P._ P. S: Upon further investigation undertaken in the course of my routine use of Homebrew Cask, I have found that similar messages also pop up for all of the other casks I have installed when I run brew cask info on them to check for new versions of the applications they manage (wish I could use brew cask outdated; brew cask upgrade, but that's out of scope for this issue and has been discussed before, at least in part.)

@vitorgalvao: Just a thought, but, since you implicated the Versions repo in this, where does Hbc::DSL#license live, Homebrew Cask or Homebrew Cask Versions? Seems like it would live in the former and maybe still be referenced in the latter, thus necessitating a new pull request to fix that in said latter repository, but none of the casks _I've_ been having trouble with so far are from there, so maybe it's the other way around
?

@RandomDSdevel Looks like you’ve enabled some homebrew developer flag or are otherwise using the latest git release instead of the tag released (which is what should happen). The change that would cause that is not yet tagged, it’s only on master.

@vitorgalvao: Agh, uck! Yeah, I made some contributions to Homebrew Core lately, and that made the brew command turn on the homebrew.devcmdrun option in the Git configuration of my local copy of the main brew repository since I was using brew audit, brew tests, and brew test to double-check my changes (I think at least _one_ of those is a devcmd; also, I _may_ not actually have had to have _run_ that last one, but, as evidenced by my setup's behavior and reinforced by my memory, I probably did it anyway 'cause I _might_ have gotten a _bit_ confused about whether it has to be run after changing anything other than Homebrew's actual _implementation_ and not one of its taps
need to update my local summary of the contribution docs to clarify that to myself. 😆!)

@bric3 Just recalled you’re likely in the same situation. I think that change wasn’t yet released as well.

@vitorgalvao, actually, the MacOS.release warning was already released. But this is only a warning, not an error (unless you have set HOMEBREW_DEVELOPER), so you can either ignore it, or you can reinstall the casks that are using the deprecated methods.

Hi, I don't think as I didn't check out master. I only used brew commands. I think cask command is now part of the brew repo right?
I'm on a mobile device right now but I will update the issue once I'm on my laptop

@reitermarkus: The warnings _we're_ getting aren't about MacOS.release, though; they're about Hbc::DSL#license. How, then, does the change to which you're referring, whatever commit or more to the main brew repo made it, relate to the problems both I and @bric3 are reporting here in this issue?

How, then, does the change to which you're referring, whatever commit or more to the main brew repo made it, relate to the problems both I and @bric3 are reporting here in this issue?

Well, @bric3 was only getting warnings about MacOS.release, which is already in a tagged release, while the one aboutHbc::DSL#license is not (yet).

Huh, _that's_ weird
; last I checked, _I_ wasn't getting _any_ warnings about MacOS.release, only Hbc::DSL#license! I'll let you know what I see when I next run an affected Homebrew Cask command.

Yup, still only getting warnings about Hbc::DSL#license. Strange
; I wonder why I'm only getting _that_ warning
?

The warnings about MacOS.release only appear if you have an older cask installed that is using it. All current casks are using MacOS.version, so of course you won't see any warnings about that.

I installed these casks quite some time ago, maybe 6months ago or even more, could that be the issue?

(Still on a mobile device)

Yep, this was changed about two months ago.

So, it's still not intuitive as to what is wrong here?

Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/dsl.rb:208:in `license'

This started out of the blue - I tend to do upgrades every day or two (worked fine until today) I am not doing any development work. I don't have any brews or casks called dsl or hbc. I assume that they might be dependencies of something else, but not obvious how to determine what.

I have the same problem, how to fix the bug?

Error: Calling Hbc::DSL#license is deprecated!
There is no replacement.

No brew dev work

$ git config --get homebrew.devcmdrun

$ git describe --tags
1.0.6-61-gf71e4a7

@CrCs2O4, do you have HOMEBREW_DEVELOPER set? Otherwise this should only result in a Warning, not an Error.

I am also receiving the Hbc::DSL#license warning.
When I run:

$ brew cask list

I get 35 Hbc Warnings; I have 35 casks installed.
I have run:

$ brew cask uninstall aegisub && brew cask reinstall aegisub

but

$ brew cask info aegisub

Still gives me the Hbc::DSL#license warning:

Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/dsl.rb:208:in `license'

I have also run:

$ brew uninstall --force brew-cask; brew untap phinze/cask; brew untap caskroom/cask; brew update; brew cleanup; brew cask cleanup

and:

$ cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update

but are still experiencing the warnings.

@reitermarkus thanks for pointing this out! I cloned my dotfiles from MikeMcQuaid, and there were HOMEBREW_DEVELOPER=1

Now I can live with Warnings not Errors 😃

So... this is expected behaviour right? We just wait for every cask to be relicensed to conform.
I can live with that, not pretty but not broken.

brew cask uninstall aegisub && brew cask reinstall aegisub

@keevee09, this won't do anything, because all casks are still using the license stanza as of now.

So... this is expected behaviour right?

Exactly.

But what about this one

/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions ± ❯ brew cask list --verbose java7
Warning: Calling MacOS.release is deprecated!
Use MacOS.version instead.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/source/path_base.rb:71:in `block in load_cask'

Should I reinstall the casks? Also is the last line an error? (Not familiar with ruby)

@Brice Dutheil The last line is pointing to the file (path_base.rb) where
the warning occurred.
It is not an error, just a warning.

On 9 October 2016 at 23:44, Brice Dutheil [email protected] wrote:

But what about this one

/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions ± ❯ brew cask list --verbose java7
Warning: Calling MacOS.release is deprecated!
Use MacOS.version instead.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/source/path_base.rb:71:in `block in load_cask'

Should I reinstall the casks? Also is the last line an error? (Not
familiar with ruby)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/caskroom/homebrew-cask/issues/25214#issuecomment-252479070,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AClPq4-6RfgNIKj3qpxnzxjs01RDfGnlks5qyMWJgaJpZM4KOnY4
.

@RandomDSdevel @pquodling @keevee09 @CrCs2O4 The Hbc::DSL#license warning has been removed for now: https://github.com/Homebrew/brew/pull/1241. brew update and you shouldn't see it anymore.

Is it fixed? i have fresh brew update && brew upgrade and i get errors while brew cask list:

Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:21:in `block in load'

Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:17:in `block in load'

Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:20:in `block in load'

@kwladyka Your problem is related to old casks you have installed. Simplest way to get rid of it is to brew cask reinstall $(brew cask list). That’ll essentially reinstall/upgrade all casks you have installed.

you may also do something like

for cask in $(grep --ignore-case --files-with-matches --recursive --include \*.rb license $(brew --prefix)/Caskroom); do
  brew cask reinstall "${cask}"
done

@vitorgalvao thank you for answer. I did both and still have this issue. I will ignore it in that case i guess.

brew cleanup helped

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CoolTomatos picture CoolTomatos  Â·  3Comments

akashlevy picture akashlevy  Â·  3Comments

florianletsch picture florianletsch  Â·  3Comments

jrwiegand picture jrwiegand  Â·  3Comments

seanreed1111 picture seanreed1111  Â·  3Comments