Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.96k stars 10.73k forks source link

Installing mkvtoolnix cask with pre-existing mkvtoolnix formulae as a dependency #189175

Open 101Dude opened 1 month ago

101Dude commented 1 month ago

Verification

Description of issue

I am not allowed to install the cask. There is a single conflict between mkvtoolnix cask and mkvtoolnix formulae. It seems that --adopt --force and --overwrite are not doing what I expect them to do when it comes to duplicate files located at /usr/local/share/man/man1/.

the error: Error: It seems there is already a Manpage at '/usr/local/share/man/man1/mkvextract.1'.

mkvtoolnix formulae are required for pre-installed formulae and I need the GUI of mkvtoolnix as well.

Are there brew commands that allow me to install both without conflict?

thank you

Command that failed

brew install -d --verbose --no-binaries --adopt --cask mkvtoolnix

Output of command with --verbose --debug

14:00:43.017 iMac191 /usr/local/Caskroom 4.2s 
brew install -d --verbose --no-binaries --adopt --cask  mkvtoolnix
/usr/local/Homebrew/Library/Homebrew/brew.rb (Cask::CaskLoader::FromAPILoader): loading mkvtoolnix
==> Cask::Installer#install
==> Printing caveats
==> Cask::Installer#fetch
==> Checking cask has checksum
==> Downloading https://mkvtoolnix.download/macos/MKVToolNix-88.0.dmg
/usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.1-62-g6f17b06\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.0.1\)\ curl/8.7.1 --header Accept-Language:\ en --retry 3 -V
/usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.1-62-g6f17b06\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.0.1\)\ curl/8.7.1 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://mkvtoolnix.download/macos/MKVToolNix-88.0.dmg
Already downloaded: /Users/john/Library/Caches/Homebrew/downloads/d51055e56a4c3467d8205fdcad8877d9fd3911d812c7ee15c1d04c462c5d54b2--MKVToolNix-88.0.dmg
==> Checking quarantine support
/usr/bin/env /usr/bin/xattr -h
/usr/bin/env /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -target x86_64-apple-macosx15 /usr/local/Homebrew/Library/Homebrew/cask/utils/quarantine.swift
==> Quarantine is available.
==> Verifying Gatekeeper status of /Users/john/Library/Caches/Homebrew/downloads/d51055e56a4c3467d8205fdcad8877d9fd3911d812c7ee15c1d04c462c5d54b2--MKVToolNix-88.0.dmg
/usr/bin/env /usr/bin/xattr -p com.apple.quarantine /Users/john/Library/Caches/Homebrew/downloads/d51055e56a4c3467d8205fdcad8877d9fd3911d812c7ee15c1d04c462c5d54b2--MKVToolNix-88.0.dmg
==> /Users/john/Library/Caches/Homebrew/downloads/d51055e56a4c3467d8205fdcad8877d9fd3911d812c7ee15c1d04c462c5d54b2--MKVToolNix-88.0.dmg is not quarantined
==> Verifying checksum for 'd51055e56a4c3467d8205fdcad8877d9fd3911d812c7ee15c1d04c462c5d54b2--MKVToolNix-88.0.dmg'
/usr/bin/env hdiutil imageinfo -format /Users/john/Library/Caches/Homebrew/downloads/d51055e56a4c3467d8205fdcad8877d9fd3911d812c7ee15c1d04c462c5d54b2--MKVToolNix-88.0.dmg
==> Installing Cask mkvtoolnix
Warning: macOS's Gatekeeper has been disabled for this Cask
==> Cask::Installer#stage
==> Extracting primary container
==> Using container class UnpackStrategy::Dmg for /Users/john/Library/Caches/Homebrew/downloads/d51055e56a4c3467d8205fdcad8877d9fd3911d812c7ee15c1d04c462c5d54b2--MKVToolNix-88.0.dmg
/usr/bin/env hdiutil attach -plist -nobrowse -readonly -mountrandom /private/tmp/homebrew-dmg20241020-90752-2m872a /Users/john/Library/Caches/Homebrew/downloads/d51055e56a4c3467d8205fdcad8877d9fd3911d812c7ee15c1d04c462c5d54b2--MKVToolNix-88.0.dmg
/usr/bin/env find . -print0
/usr/bin/env mkbom -s -i /private/tmp/20241020-90752-ngd52c.list -- /private/tmp/20241020-90752-tebnu0.bom
/usr/bin/env ditto --bom /private/tmp/20241020-90752-tebnu0.bom -- /private/tmp/homebrew-dmg20241020-90752-2m872a/dmg.kdNtVE /private/tmp/homebrew-unpack-20241020-90752-m8qj1e
/usr/bin/env diskutil info -plist /private/tmp/homebrew-dmg20241020-90752-2m872a/dmg.kdNtVE
/usr/bin/env diskutil eject /private/tmp/homebrew-dmg20241020-90752-2m872a/dmg.kdNtVE
/usr/bin/env cp -al /private/tmp/homebrew-unpack-20241020-90752-m8qj1e/COPYING.txt /private/tmp/homebrew-unpack-20241020-90752-m8qj1e/NEWS.txt /private/tmp/homebrew-unpack-20241020-90752-m8qj1e/README.macOS.txt /private/tmp/homebrew-unpack-20241020-90752-m8qj1e/README.txt /private/tmp/homebrew-unpack-20241020-90752-m8qj1e/MKVToolNix-88.0.app /usr/local/Caskroom/mkvtoolnix/88.0
==> Creating metadata directory: /usr/local/Caskroom/mkvtoolnix/.metadata/88.0/20241020190117.310
==> Creating metadata subdirectory: /usr/local/Caskroom/mkvtoolnix/.metadata/88.0/20241020190117.310/Casks
==> Installing artifacts
==> Installing artifact of class Cask::Artifact::App
==> Moving App 'MKVToolNix-88.0.app' to '/Applications/MKVToolNix-88.0.app'
==> Installing artifact of class Cask::Artifact::Binary
==> Installing artifact of class Cask::Artifact::Binary
==> Installing artifact of class Cask::Artifact::Binary
==> Installing artifact of class Cask::Artifact::Binary
==> Installing artifact of class Cask::Artifact::Manpage
==> Reverting installation of artifact of class Cask::Artifact::App
==> Backing App 'MKVToolNix-88.0.app' up to '/usr/local/Caskroom/mkvtoolnix/88.0/MKVToolNix-88.0.app'
/usr/bin/env /bin/cp -pR /Applications/MKVToolNix-88.0.app /usr/local/Caskroom/mkvtoolnix/88.0/MKVToolNix-88.0.app
==> Removing App '/Applications/MKVToolNix-88.0.app'
==> Purging files for version 88.0 of Cask mkvtoolnix
Error: It seems there is already a Manpage at '/usr/local/share/man/man1/mkvextract.1'.
/usr/local/Homebrew/Library/Homebrew/cask/artifact/symlinked.rb:60:in `link'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/symlinked.rb:21:in `install_phase'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:255:in `block in install_artifacts'
/usr/local/Homebrew/Library/Homebrew/cask/artifact_set.rb:10:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/artifact_set.rb:10:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:248:in `install_artifacts'
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11608/lib/types/private/methods/call_validation.rb:270:in `bind_call'
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11608/lib/types/private/methods/call_validation.rb:270:in `validate_call'
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11608/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:115:in `install'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:245:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:234:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:234:in `run'
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11608/lib/types/private/methods/call_validation.rb:270:in `bind_call'
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11608/lib/types/private/methods/call_validation.rb:270:in `validate_call'
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11608/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
/usr/local/Homebrew/Library/Homebrew/brew.rb:94:in `<main>'

Output of brew doctor and brew config

brew doctor && brew config
Your system is ready to brew.
HOMEBREW_VERSION: 4.4.1-62-g6f17b06
ORIGIN: https://github.com/Homebrew/brew
HEAD: 6f17b0644771e0a1d7c15ac72471dae2ef87314a
Last commit: 2 days ago
Core tap JSON: 20 Oct 18:20 UTC
Core cask tap HEAD: 59f7694fba039e065f894c924b882f95d1bb3a35
Core cask tap last commit: 3 hours ago
Core cask tap JSON: 20 Oct 18:58 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: ["--greedy", "--require-sha", "--no-quarantine", "--appdir=/Applications", "--fontdir=/Library/Fonts", "--qlplugindir=/Library/QuickLook", "--internet_plugindir=/Library/Internet Plug-Ins", "--prefpanedir=/Library/PreferencePanes/", "--servicedir=/Library/Services"]
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.RUJlFzOAoR/org.xquartz:0
HOMEBREW_EDITOR: nano
HOMEBREW_MAKE_JOBS: 16
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.5 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.5/bin/ruby
CPU: 16-core 64-bit kabylake
Clang: 16.0.0 build 1600
Git: 2.47.0 => /usr/local/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.0.1-x86_64
CLT: 16.0.0.0.1.1724870825
Xcode: 16.0

Output of brew tap

brew tap
homebrew/bundle
homebrew/cask
homebrew/services
homebrew/test-bot
martido/graph
srishanbhattarai/nepcal
teamookla/speedtest
daeho-ro commented 1 month ago

https://github.com/Homebrew/homebrew-cask/blob/3d7baabd646db75211562b7cb709050200e478ed/Casks/m/mkvtoolnix.rb#L35-L39

Cask also install binaries and so you may need cask only not formula.

101Dude commented 1 month ago

Thanks. Yes I am aware but there are other formulas that require the mkvtoolnix binaries and will install them because of dependencies.

This is why I use --no-binaries flag when installing the cask. But that is not enough because of the man page.

daeho-ro commented 1 month ago

I got it. There should be something like --no-manuals or custom cask. Hm...

101Dude commented 1 month ago

I got it. There should be something like --no-manuals or custom cask. Hm...

I thought the other flags would override but they have no effect. I had high hopes for --adopt and --overwrite

101Dude commented 1 month ago

I got it. There should be something like --no-manuals or custom cask. Hm...

Is there a way to modify homebrew-cask/Casks/m/mkvtoolnix.rb locally to remove the manpage before installing? I've never done that before.

yunhao-jiang commented 4 weeks ago

Just curious is it just me or is this app unsigned? It's keep giving me this while I try to open it. How does this app escapes from the brew audit which checks the signature? screenshot

101Dude commented 4 weeks ago

It is unsigned. You will have to go to Security and allow it or you can use the --no-quarantine flag:

brew install --no-quarantine appname

In general if you have an issue you should create one OR ask in discussions.... not piggyback your question on someone else's issue. Especially since it has nothing to do with my issue. :)

yunhao-jiang commented 4 weeks ago

Yeah I'm trying to solve your issue but it seems this app violates the Acceptable Casks.

101Dude commented 4 weeks ago

Oh, thank you. You make a good point... I had no idea that was even a thing.

May be it get's special consideration? It does say that it conflicts with mkvtoolnix formulae in the .rb.

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

101Dude commented 6 days ago

This means that none of the cask flags are designed to do what we expected?