We also see this issue, interestingly when Xcode cloud shows the call to run the generated script, the surrounding sandbox-exec does seem to say that writing to this directory should be allowed, yet it still fails:
Swift/ErrorType.swift:200: Fatal error: Error raised at top level: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “String+TransactionsAccessors.swift” in the folder “StringsGeneratorPlugin”." UserInfo={NSURL=file:///Volumes/workspace/DerivedData/SourcePackages/plugins/SampleApp.output/SampleApp/StringsGeneratorPlugin/String+TransactionsAccessors.swift, NSUserStringVariant=Folder, NSUnderlyingError=0x600003104330 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
then in the call to sandbox-exec
/Volumes/workspace/DerivedData/Build/Intermediates.noindex/SampleApp.build/Debug-iphonesimulator/SampleApp.build/Script-7981050304838536995.sh: line 17: 12085 Illegal instruction: 4 /usr/bin/sandbox-exec -p "(version 1)
(deny default)
(import \"system.sb\")
(allow file-read*)
(allow process*)
(allow file-write*
(subpath \"/private/tmp\")
(subpath \"/private/var/folders/22/cm0mxjnn4zg5l2rs2l3b51qr0000gn/T\")
)
(deny file-write*
(subpath \"/Volumes/workspace/repository/SampleApp\")
)
(allow file-write*
(subpath \"/Volumes/workspace/DerivedData/SourcePackages/plugins/SampleApp.output/SampleApp/StringsGeneratorPlugin\")
)