jwbargsten / defbro

Change the default browser in macOS (Catalina, Big Sur).
https://bargsten.org/wissen/publish-swift-app-via-homebrew/
MIT License
41 stars 3 forks source link

Why is Swift sandbox disabled? #2

Closed rix1 closed 3 years ago

rix1 commented 3 years ago

I noticed this package builds with --disable-sandbox flag.

Not 100% familiar with Swift, but is this flag strictly necessary for the script to run? Felt like an unnecessary security risk, so I unfortunately uninstalled defbro right after installing.

Can you elaborate on why you need it? :) Looks like a really useful tool for someone who changes (default) browser frequently 🙌

image

jwbargsten commented 3 years ago

I checked and played around a bit. As far as I can see, swift projects not using --disable-sandbox in combination with homebrew won't compile. I tried it myself and I'm running into weird permission issues. A quick check on official homebrew repos (e.g. core) showed that, to my understanding, all swift projects are build with --disable-sandbox. So yeah, I guess it is a "take it or leave it"-situation.

Of course, if you find a way to make it work without --disable-sandbox, patches are welcome :)

rix1 commented 3 years ago

Thanks for your reply! 🙌