Closed jpsim closed 8 months ago
Also noteworthy is that something changed between BranchSDK's 3.1.0 and 3.3.0 releases, because this issue doesn't happen with 3.1.0.
.package(url: "https://github.com/BranchMetrics/ios-branch-sdk-spm", exact: "3.1.0"),
@cgrindel your suggestion doesn't set the default value: https://bazel.build/reference/command-line-reference#flag--spawn_strategy
I think it should be--spawn_strategy=remote,worker,sandboxed,local
instead.
Indeed, --spawn_strategy=remote,worker,sandboxed,local
fixes things in both the repro case above and in my real project.
Thanks @brentleyjones!
I think it should be--spawn_strategy=remote,worker,sandboxed,local instead.
Cool. I will update the doc.
We might want to suggest --strategy_regexp as a way to target the problematic targets. In this case I think it would be --strategy_regexp=Compiling Sources/BranchSDK/.*=sandboxed
(it matches on the description of the action, which is something like Compiling Sources/BranchSDK/BNCContentDiscoveryManager.m
).
Thanks Brentley and Chuck!
This is a bit of a tricky one. If I have BranchSDK and Swift macros in my iOS app, everything works fine on the command line, but break in one way or another in rules_xcodeproj.
Here's some sample changes applied to the Lottie iOS example in this repo as a repro case:
Everything builds fine with
bazel build //LottieExample:iosapp
.However, with Xcode and rules_xcodeproj, I get errors like this:
Similarly, I get the same errors if I build from the command with
bazel build --spawn_strategy=standalone //LottieExample:iosapp
.If I follow the instructions in the FAQ to enable sandboxing to work around this, then the BranchSDK module builds but Swift macros break because they violate the sandbox:
So any way I slice it, I can't get both BranchSDK and Swift macros to be buildable in Xcode.
It's possible that some of this becomes fixable (in rules_swift?) in Swift 5.10 which will include this change: https://github.com/apple/swift/pull/70079
But it seems like the right fix would be to get packages like BranchSDK (and Firebase I imagine) buildable with sandboxing disabled.