sous-chefs / homebrew

Development repository for the homebrew cookbook
https://supermarket.chef.io/cookbooks/homebrew
Apache License 2.0
151 stars 136 forks source link

"brew cask list" no longer supported #145

Closed bcg62 closed 3 years ago

bcg62 commented 3 years ago

https://github.com/chef-cookbooks/homebrew/blob/master/resources/cask.rb#L63

/usr/local/bin/brew cask list
Error: Calling brew cask list is disabled! Use brew list [--cask] instead.

brew list --cask or brew list --cask $name works as expected

  * homebrew_cask[phantomjs] action install
    * homebrew_tap[homebrew/cask] action tap (up to date)

    ================================================================================
    Error executing action `install` on resource 'homebrew_cask[phantomjs]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of /usr/local/bin/brew cask list 2>/dev/null ----
    STDOUT:
    STDERR:
    ---- End output of /usr/local/bin/brew cask list 2>/dev/null ----
    Ran /usr/local/bin/brew cask list 2>/dev/null returned 1

    Resource Declaration:
    ---------------------
    # In /var/folders/cl/02xl4t9d747bw65yqssyl0_40000gp/T/cookbooks.0mnh7hCZ/site-cookbooks/workstation-wrapper/recipes/default.rb

     22: homebrew_cask 'phantomjs' do
     23:   options '--appdir=/Applications'
     24: end
     25:

    Compiled Resource:
    ------------------
    # Declared in /var/folders/cl/02xl4t9d747bw65yqssyl0_40000gp/T/cookbooks.0mnh7hCZ/site-cookbooks/workstation-wrapper/recipes/default.rb:22:in `from_file'

    homebrew_cask("phantomjs") do
      action [:install]
      default_guard_interpreter :default
      declared_type :homebrew_cask
      cookbook_name :"workstation-wrapper"
      recipe_name "authpoxy"
      options "--appdir=/Applications"
      cask_name "phantomjs"
      homebrew_owner_uid 502
      homebrew_owner_username "user"
      owner "user"
    end

    System Info:
    ------------
    chef_version=16.8.14
    platform=mac_os_x
    platform_version=10.15.7
    ruby=ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]
    program_name=/opt/cinc-workstation/bin/cinc-solo
    executable=/opt/cinc-workstation/bin/cinc-solo

Running handlers:
[2020-12-21T18:08:41-05:00] ERROR: Running exception handlers
Running handlers complete
[2020-12-21T18:08:41-05:00] ERROR: Exception handlers complete
Cinc Client failed. 30 resources updated in 02 minutes 09 seconds
[2020-12-21T18:08:41-05:00] FATAL: Stacktrace dumped to /var/chef/cache/cinc-stacktrace.out
[2020-12-21T18:08:41-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2020-12-21T18:08:41-05:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: homebrew_cask[phantomjs] (workstation-wrapper::default line 22) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/local/bin/brew cask list 2>/dev/null ----
STDOUT:
STDERR:
---- End output of /usr/local/bin/brew cask list 2>/dev/null ----
Ran /usr/local/bin/brew cask list 2>/dev/null returned 1
v-anshie commented 3 years ago

@bcg62 @tas50 It looks like we can change the homebrew_cask resource to use the brew install --cask <cask_name> instead of brew cask install. This also applies to any use of brew cask.

tas50 commented 3 years ago

This should be resolved in 5.1.1 which is up on Supermarket now. Thanks for reporting the problem