"sandbox_apply_container: Operation not permitted" error with xcodebuild and Swift package dependencies #59
-
I noticed a recent regression with a formula I maintain (p00ya/tap/vivtool). I get an error from
In the system console, there'll be an entry like:
These errors indicate that a process that is already sandboxed is calling To figure out what was calling
So what's happening is that as part of building a swift package dependency, I think maintainers of formulae for actual Swift packages have been dealing with a similar issue by passing I think fixing this behaviour properly requires some intervention from Apple (I suspect something in the homebrew environment or shims is causing xcodebuild to run sandboxed, in which case it shouldn't be calling subprocesses with In the meantime, the most pragmatic solution I can find that I can perform as a formula maintainer is to do the same thing I did for debugging: create a Has anyone else encountered this / have a better solution? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 16 replies
-
Here's my workaround: I should also add that I suspect an upgrade from Xcode 11.x to Xcode 12 triggered the regression, though I haven't reverted back to Xcode 11.x to check that. It could also have been a macOS or homebrew upgrade. |
Beta Was this translation helpful? Give feedback.
-
I think this should really be a Apple bugreport. There is nothing homebrew can do short of disabling sandboxing, which isn't gonna happen. |
Beta Was this translation helpful? Give feedback.
-
Creating a shim for |
Beta Was this translation helpful? Give feedback.
-
@p00ya , @carlocab , I just ran into this issue trying to install https://github.com/samuelmeuli/tmignore via brew. What's the next step for this issue? Is there someone from the Homebrew team that has a contact in Apple to get some guidance from? Or is a shim the preferred option? And, if so, @p00ya do you have any availability to look into that - noting that this issue was raised over 6 months ago so you might have moved onto other things? |
Beta Was this translation helpful? Give feedback.
-
Okay I know I’m bumping an old thread, but it’s become relevant again. So for Xcode projects that use SPM there is the option For Xcode projects that are using plugins (e.g. macros) though, it’s a bit more complicated. I did not find an option to So now my question is: would it be possible to force the |
Beta Was this translation helpful? Give feedback.
-
Yes, probably. We already have a shim for Feel free to open a PR. |
Beta Was this translation helpful? Give feedback.
-
@carlocab @Frizlab I just found that we can just use So in my case, something like the following worked for a Xcode project which is using Swift macro and Swift packages 🎉 :
|
Beta Was this translation helpful? Give feedback.
@carlocab @Frizlab I just found that we can just use
OTHER_SWIFT_FLAGS
to pass-disable-sandbox
so that the nested sandbox from Swift macro will not be created.So in my case, something like the following worked for a Xcode project which is using Swift macro and Swift packages 🎉 :