Homebrew / homebrew-cask

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

Uninstalling OBS leaves behind virtual camera #175497

Closed ShadowJonathan closed 4 months ago

ShadowJonathan commented 6 months ago

Verification

Description of issue

When uninstalling the obs cask, it leaves behind the "virtual camera" extension.

I've found a comment here which references this, but when uninstalling OBS via finder ("move to bin"), it correctly uninstalls the system extension.

Is it possible for homebrew to perform a similar function, or otherwise point the user to this fact?

Command that failed

brew uninstall --cask obs

Output of command with --verbose --debug

N/A

Output of brew doctor and brew config

$ 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 casks are deprecated or disabled.
You should find replacements for the following casks:
  arduino
  schildichat

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  mysql@5.7
  neofetch
  openssl@1.1
  python-charset-normalizer
  python-idna
  python-psutil
  python-requests
  python-urllib3
  python@3.8

Warning: You have the following deprecated, official taps tapped:
  Homebrew/homebrew-cask-versions
  Homebrew/homebrew-cask-fonts
Untap them with `brew untap`.

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  python-idna
  ipfs
  python-requests
  glib
  python-urllib3
  numpy
  hyfetch
  platformio
  uvicorn
  python-charset-normalizer

Warning: You have uncommitted modifications to Homebrew/homebrew-core.
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
  cd /opt/homebrew/Library/Taps/homebrew/homebrew-core && git stash -u && git clean -d -f

Uncommitted files:
   M Formula/p/python@3.7.rb

Warning: Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
  git -C $(brew --repo shadowjonathan/cask) checkout master

$ brew config
HOMEBREW_VERSION: 4.3.2-60-gc6368be
ORIGIN: https://github.com/Homebrew/brew
HEAD: c6368bea8a1e038e77d49ed13bba33c5bc2f8ce6
Last commit: 9 hours ago
Core tap HEAD: d904406925ed37ccce85afced22a079adc71b780
Core tap last commit: 3 months ago
Core tap JSON: 01 Jun 08:56 UTC
Core cask tap HEAD: 48d18e314b6e164935e59962443fec6cb8bfb3bc
Core cask tap last commit: 3 months ago
Core cask tap JSON: 01 Jun 08:56 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.MFcLn7quZx/org.xquartz:0
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.2 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.2/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.44.0 => /opt/homebrew/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.4
Rosetta 2: false

Output of brew tap

$ brew tap
alexanderwillner/tap
gromgit/fuse
homebrew/cask
homebrew/cask-fonts
homebrew/cask-versions
homebrew/core
homebrew/services
marcus-crane/tap
mistertea/et
shadowjonathan/cask
teamookla/speedtest
SMillerDev commented 5 months ago

Sounds like https://github.com/Homebrew/homebrew-cask/issues/170602

ShadowJonathan commented 5 months ago

That issue left out this specific request; I'd like to make an issue to find a way to ask the system to remove those system extensions, possibly by doing something similar to what Finder does, to uninstall it.

SMillerDev commented 5 months ago

Regarding the system extension, as far as I know this is a MacOS system-level limitation, and this would be the same case were you to remove the application the usual way (it is not a Homebrew-specific limitation).

So it doesn't seem like that's possible without changes in macOS

miccal commented 5 months ago

@ShadowJonathan can I confirm that you are referring to the system extension com.obsproject.obs-studio.mac-camera-extension as listed in the output of the command systemextensionsctl list?

If you are, can you please provide the output of the command systemextensionsctl list?

ShadowJonathan commented 5 months ago

@miccal i have already uninstalled it, but i can describe the output i had after doing brew uninstall, which listed the extension normally, persisted that across a reboot, with no mention of "will uninstall next reboot", which it did when i uninstalled OBS studio via finder

miccal commented 5 months ago

Thanks @ShadowJonathan. Did you remove it by running systemextensionsctl uninstall after disabling SIP?

ShadowJonathan commented 5 months ago

No, I did not and do not want to disable SIP.

This is why the only uninstall path being via Finder was very odd and unintuitive to me.

miccal commented 5 months ago

I am not sure what we can do here on the brew side.

My (limited) knowledge of system extensions comes from dealing with them via three apps: Little Snitch, OBS and Microsoft Defender.

Now, both Little Snitch and Microsoft Defender implement a proper deactivationRequest so that the system extension is removed more-or-less regardless of how the .app bundles are removed.

However, OBS does not implement a proper deactivationRequest, which means that the system extension is only removed if the .app bundle is manually removed by dragging it to the trash, which initiates the removal of the system extension.

Here is the problem: for reasons I do not understand (yet), removing the .app bundle via, say, an rm command from the Terminal, does not initiate the removal of the system extension.

So, until this issue is resolved by Apple:

|-> systemextensionsctl uninstall
At this time, this tool cannot be used if System Integrity Protection is enabled.
This limitation will be removed in the near future.
Please remember to re-enable System Integrity Protection!

I do not think we can do anything via brew.

(Note that systemextensionsctl uninstall has been this way since macOS 10.15 Catalina, released in 2019: I think Apple's definition of the "near future" is not quite the same as ours!)

ShadowJonathan commented 5 months ago

Are Little Snitch and Microsoft Defender installable and (completely) uninstallable via brew? System extensions and all?


Would it be useful for me to file a bug report with OBS Studio, and then link back to here? (To keep this issue open until that is resolved, so that there is a proper chain of dependencies.)

I think that this is a reasonable request for them, I have never even heard of that possibility (to uninstall via deactivationRequest), so it is possible OBS Studio doesn't as well, and if we request this, they might implement it, and OBS Studio would be properly (and neatly) completely uninstallable via brew.

(Though I'm unsure what extra things need to be added to it after they implement deactivationRequest)

Does this sound reasonable?

miccal commented 5 months ago

Are Little Snitch and Microsoft Defender installable and (completely) uninstallable via brew? System extensions and all?

Microsoft Defender: yes.

Little Snitch: unsure, as I have never uninstalled it (but brew update works fine).

Would it be useful for me to file a bug report with OBS Studio, and then link back to here? (To keep this issue open until that is resolved, so that there is a proper chain of dependencies.)

I think that this is a reasonable request for them, I have never even heard of that possibility (to uninstall via deactivationRequest), so it is possible OBS Studio doesn't as well, and if we request this, they might implement it, and OBS Studio would be properly (and neatly) completely uninstallable via brew.

(Though I'm unsure what extra things need to be added to it after they implement deactivationRequest)

Does this sound reasonable?

There is already an open issue about this over at the OBS GitHub page: https://github.com/obsproject/obs-studio/issues/9714.

ShadowJonathan commented 5 months ago

Thanks! I've mentioned this option there, there's a large chance they haven't heard of it :)

github-actions[bot] commented 4 months 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.

ShadowJonathan commented 4 months ago

No. https://nostalebots.xyz/

Also, this is tagged with "upstream", shouldn't "stale" not apply then?

bevanjkay commented 4 months ago

Upstream doesn't prevent stalebot, because it indicates that there isn't any course of action appropriate to move things forward within Homebrew, and the issue itself is not specific to Homebrew.

github-actions[bot] commented 4 months 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.

ShadowJonathan commented 4 months ago

I'll reopen this once a solution (or the likes) has been found in https://github.com/obsproject/obs-studio/issues/9714