We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When performing bazel build while --spawn_strategy=sandboxed the build fails.
bazel build
--spawn_strategy=sandboxed
➜ bazel-ios-swiftui-template git:(failing-build-with-macros-and-sandboxing) bazel build //app INFO: Analyzed target //app:app (0 packages loaded, 0 targets configured). ERROR: /Users/adincebic/developer/bazel-ios-swiftui-template/app/BUILD.bazel:16:14: Compiling Swift module //app:app.library failed: (Exit 1): worker failed: error executing SwiftCompile command (from target //app:app.library) bazel-out/darwin_arm64-opt-exec-ST-13d3ddad9198/bin/external/rules_swift~/tools/worker/worker swiftc ... (remaining 1 argument skipped) Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging sandbox-exec: sandbox_apply: Operation not permitted <unknown>:0: warning: compiler plugin not loaded: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server; failed to initialize app/source/ContentView.swift:15:1: error: external macro implementation type 'PreviewsMacros.SwiftUIView' could not be found for macro 'Preview(_:body:)' #Preview { ^ SwiftUI.Preview:2:41: note: 'Preview(_:body:)' declared here @freestanding(declaration) public macro Preview(_ name: String? = nil, body: @escaping @MainActor () -> any View) = #externalMacro(module: "PreviewsMacros", type: "SwiftUIView") ^ error: emit-module command failed with exit code 1 (use -v to see invocation) sandbox-exec: sandbox_apply: Operation not permitted <unknown>:0: warning: compiler plugin not loaded: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server; failed to initialize app/source/ContentView.swift:15:1: error: external macro implementation type 'PreviewsMacros.SwiftUIView' could not be found for macro 'Preview(_:body:)' #Preview { ^ SwiftUI.Preview:2:41: note: 'Preview(_:body:)' declared here @freestanding(declaration) public macro Preview(_ name: String? = nil, body: @escaping @MainActor () -> any View) = #externalMacro(module: "PreviewsMacros", type: "SwiftUIView") ^ error: fatalError Target //app:app failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 3.784s, Critical Path: 3.65s INFO: 2 processes: 2 internal. ERROR: Build did NOT complete successfully ➜ bazel-ios-swiftui-template git:(failing-build-with-macros-and-sandboxing)
Switching spawn_strategy to use worker makes it compile.
Here is a small project that demonstrates the problem: https://github.com/adincebic/bazel-ios-swiftui-template/tree/failing-build-with-macros-and-sandboxing
NOTE: I am using Xcode 15.3
The text was updated successfully, but these errors were encountered:
Disable Swift compiler sandboxing in Xcode 15.3+ to fix nested sandbo…
3e85693
…xing (#1206) This should solve #1202 and #1204 > There were issues with Swift compiler plugins (incl. macros) and nested sandboxes on macOS with Swift 5.9 that have been fixed with 5.10: > swift: [swiftlang/swift#70079](swiftlang/swift#70079) > swift-driver: [swiftlang/swift-driver#1493](swiftlang/swift-driver#1493) > swift-package-manager: [swiftlang/swift-package-manager#7167](swiftlang/swift-package-manager#7167) I am not sure whether this flag is required on Linux too. --------- Signed-off-by: Adin Cebic <cebic.ad@gmail.com> Co-authored-by: Brentley Jones <github@brentleyjones.com>
No branches or pull requests
When performing
bazel build
while--spawn_strategy=sandboxed
the build fails.Switching spawn_strategy to use worker makes it compile.
Here is a small project that demonstrates the problem: https://github.com/adincebic/bazel-ios-swiftui-template/tree/failing-build-with-macros-and-sandboxing
NOTE: I am using Xcode 15.3
The text was updated successfully, but these errors were encountered: