Skip to content
New issue

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

[5.10][Macros] Add option to disable sandbox for exectuable plugins #70079

Merged

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Nov 28, 2023

Cherry-pick #70046 into release/5.10

  • Explanation: Add a frontend option -disable-sandbox to disable sandboxing when invoking subprocess. Since sandbox(7) in macOS doesn't support nested sandbox, compilations used to fail when the parent build process is sandboxed.
  • Scope: Executable macro plugin
  • Risk: Low. The change is localized, and straightforward
  • Testing: Added regression test cases
  • Issues: rdar://118419424
  • Reviewer: Doug Gregor (@DougGregor)

`-disable-sandbox` to disable sandboxing when invoking subprocess from
from the frontend. Since `sandbox(7)` in macOS doesn't support nested
sandbox, complation used to fail when the parent build process is sandboxed.

(cherry picked from commit 0c9f099)

 Conflicts:
	lib/Frontend/ArgsToFrontendOptionsConverter.cpp
@rintaro rintaro requested a review from a team as a code owner November 28, 2023 22:48
@rintaro
Copy link
Member Author

rintaro commented Nov 28, 2023

@swift-ci Please test

@rintaro rintaro merged commit 2bb09a5 into swiftlang:release/5.10 Nov 29, 2023
5 checks passed
keith pushed a commit to bazelbuild/rules_swift that referenced this pull request May 22, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants