Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conflicts_with not respected in casks #9288

Closed
3 tasks done
gromgit opened this issue Nov 25, 2020 · 2 comments
Closed
3 tasks done

conflicts_with not respected in casks #9288

gromgit opened this issue Nov 25, 2020 · 2 comments
Labels
outdated PR was locked due to age

Comments

@gromgit
Copy link
Member

gromgit commented Nov 25, 2020

Bug report

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew config and brew doctor and included their output with your issue?

What you were trying to do (and why)

I was helping to resolve Homebrew/discussions#171, so I installed first the wireshark formula, then the wireshark cask. Since the Cask spec includes:

  conflicts_with cask:    "wireshark-chmodbpf",
                 formula: "wireshark"

I was expecting the cask install to fail before even downloading anything.

What happened (include command output)

brew install homebrew/cask/wireshark proceeded with the install, stopping only on a "file already exists" error that was the reason for the declared conflict.

Command output
$ brew install wireshark
Warning: Treating wireshark as a formula. For the cask, use homebrew/cask/wireshark
==> Downloading https://homebrew.bintray.com/bottles/wireshark-3.4.0.catalina.bottle.tar.gz
Already downloaded: /Users/aho/Library/Caches/Homebrew/downloads/7939f3f10cde5ab652896f342fa50d88b472524d9eff045272ab3d96e1acea47--wireshark-3.4.0.catalina.bottle.tar.gz
==> Pouring wireshark-3.4.0.catalina.bottle.tar.gz
==> Caveats
This formula only installs the command-line utilities by default.

Install Wireshark.app with Homebrew Cask:
brew cask install wireshark

If your list of available capture interfaces is empty
(default macOS behavior), install ChmodBPF:
brew cask install wireshark-chmodbpf
==> Summary
🍺 /usr/local/Cellar/wireshark/3.4.0: 1,185 files, 96.4MB

$ brew install homebrew/cask/wireshark
==> Downloading https://2.na.dl.wireshark.org/osx/Wireshark%203.4.0%20Intel%2064.dmg
Already downloaded: /Users/aho/Library/Caches/Homebrew/downloads/c3260c2994713030315f29798ee15b2a037ae5e4f2895ad9dbbe62d4f9319d57--Wireshark 3.4.0 Intel 64.dmg
==> Installing Cask wireshark
==> Running installer for wireshark; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:
installer: Package name is Add Wireshark to the system PATH
installer: Upgrading at base path /
installer: The upgrade was successful.
==> Running installer for wireshark; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
installer: Package name is ChmodBPF
installer: Upgrading at base path /
installer: The upgrade was successful.
==> Moving App 'Wireshark.app' to '/Applications/Wireshark.app'.
==> Backing App 'Wireshark.app' up to '/usr/local/Caskroom/wireshark/3.4.0/Wireshark.app'.
==> Removing App '/Applications/Wireshark.app'.
==> Purging files for version 3.4.0 of Cask wireshark
Error: It seems there is already a Binary at '/usr/local/bin/editcap'.

What you expected to happen

The install should not have proceeded at all. Also, brew info homebrew/cask/wireshark should include a Conflicts with: section naming both conflicts described above. Instead, it seems brew sees no conflicts at all:

$ brew info homebrew/cask/wireshark
wireshark: 3.4.0 (auto_updates)
https://www.wireshark.org/
Not installed
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/wireshark.rb
==> Name
Wireshark
==> Description
Network protocol analyzer
==> Artifacts
Add Wireshark to the system path.pkg (Pkg)
Install ChmodBPF.pkg (Pkg)
Wireshark.app (App)
/Applications/Wireshark.app/Contents/MacOS/editcap (Binary)
/Applications/Wireshark.app/Contents/MacOS/idl2wrs (Binary)
/Applications/Wireshark.app/Contents/MacOS/mergecap (Binary)
/Applications/Wireshark.app/Contents/MacOS/mmdbresolve (Binary)
/Applications/Wireshark.app/Contents/MacOS/randpkt (Binary)
/Applications/Wireshark.app/Contents/MacOS/reordercap (Binary)
/Applications/Wireshark.app/Contents/MacOS/sharkd (Binary)
/Applications/Wireshark.app/Contents/MacOS/text2pcap (Binary)
/Applications/Wireshark.app/Contents/MacOS/tshark (Binary)
/Applications/Wireshark.app/Contents/MacOS/extcap/androiddump (Binary)
/Applications/Wireshark.app/Contents/MacOS/extcap/ciscodump (Binary)
/Applications/Wireshark.app/Contents/MacOS/extcap/randpktdump (Binary)
/Applications/Wireshark.app/Contents/MacOS/extcap/sshdump (Binary)
/Applications/Wireshark.app/Contents/MacOS/extcap/udpdump (Binary)
/Applications/Wireshark.app/Contents/MacOS/rawshark (Binary)
/Applications/Wireshark.app/Contents/MacOS/capinfos (Binary)
/Applications/Wireshark.app/Contents/MacOS/captype (Binary)
/Applications/Wireshark.app/Contents/MacOS/dftest (Binary)
/Applications/Wireshark.app/Contents/MacOS/dumpcap (Binary)

This seems to be a general failure to process conflicts_with stanzas in casks; I replicated this failure with macvim formula/cask combos, for instance, and brew info homebrew/cask/macvim is also missing any conflict warnings.

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

brew install wireshark
brew install homebrew/cask/wireshark

Output of brew config and brew doctor commands

$ brew config
HOMEBREW_VERSION: 2.5.11-208-gda2d80c
ORIGIN: https://github.com/Homebrew/brew
HEAD: da2d80cdcb75ca7de4543571c22e92fa652f1c1f
Last commit: 77 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: f5d47797391d9c1c040f33aefbbcd70a362f9883
Core tap last commit: 28 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: vim
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 4
HOMEBREW_NO_AUTO_UPDATE: set
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 build 1200
Git: 2.29.2 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.6.0_51-b11-457
macOS: 10.15.6-x86_64
CLT: 12.2.0.0.1.1604628099
Xcode: N/A
XQuartz: 2.7.11 => /opt/X11

$ 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 or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  encfs
  ext2fuse
  ntfs-3g
  sshfs

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/libpgtcl.h

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  moreutils
  gcc@8
  bash-completion@2
  gcc@7
@reitermarkus
Copy link
Member

It's not implemented, see Homebrew/homebrew-cask#12822.

@MikeMcQuaid
Copy link
Member

Closing in favour of Homebrew/homebrew-cask#12822

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 26, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

4 participants