-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix disableSandboxForPluginCommands
#5855
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
Conversation
This was broken in #5846 which accidentally used the default value instead of passing along the global option. rdar://101681661
@swift-ci please smoke test |
@swift-ci please test package compatibility |
@@ -263,6 +263,7 @@ extension SwiftCommand { | |||
additionalFileRules: FileRuleDescription.swiftpmFileTypes, | |||
pluginScriptRunner: swiftTool.getPluginScriptRunner(), | |||
pluginWorkDirectory: try swiftTool.getActiveWorkspace().location.pluginWorkingDirectory, | |||
disableSandboxForPluginCommands: swiftTool.options.security.shouldDisableSandbox, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we missing a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's complicated™️
We have a test that's been added in #4283, but it didn't trigger here for two reasons:
- We are running neither macOS 12 nor installing the concurrency compatibility libs on Swift CI, which leads to plugin tests being skipped on macOS and the sandboxing tests are macOS-only (rdar://100780895)
- Build commands generated by plugins are running in a sandbox that currently has blanket approval for
/private/tmp
which also happens to be where we're placing test examples during test execution, so the sandbox is more open than normally during tests. Sandbox for manifests and plugins should provide a unique path specified byTMPDIR
instead of allowing/tmp
#4307 aims to address that by giving individual plugins unique temporary directories
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I have rebased that Sandbox TMPDIR
PR and revived it.
This reverts commit 256c682.
This was broken in #5846 which accidentally used the default value instead of passing along the global option.
rdar://101681661