You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using SwiftGen plugin in few places as SPM plugin, one of which is creation of static accessors for Localizable.Strings.
SwiftGen is defined as Package dependency in other SwiftPackage (which uses it for codegen). Below is simplified definition of this Package (skipping other products/targets):
Using SwiftGen as SPM plugin with Xcode 15 ends with error:
Showing All Errors Only
Prepare packages
/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/5w/m87hs1f951z3974j7m46h05h0000gn/T\")
)
(deny file-write*
(subpath \"/Users/tomaszlizer/Workspace/Repositories/IOS-Style-Kit\")
)
(allow file-write*
(subpath \"/Users/tomaszlizer/Library/Developer/Xcode/DerivedData/IOS-Style-Kit-ejtosxfgrvjkqcfebfywljbtlqmo/SourcePackages/plugins/ios-style-kit.output/AssetKit/SwiftGenPlugin\")
)
" /Users/tomaszlizer/Library/Developer/Xcode/DerivedData/IOS-Style-Kit-ejtosxfgrvjkqcfebfywljbtlqmo/SourcePackages/artifacts/swiftgenplugin/swiftgen/swiftgen.artifactbundle/swiftgen/bin/swiftgen config run --verbose --config /Users/tomaszlizer/Workspace/Repositories/IOS-Style-Kit/Sources/AssetKit/swiftgen.yml
Error: You don’t have permission to save the file “StringsGenerated.swift” in the folder “Generated”.
Executing configuration file /Users/tomaszlizer/Workspace/Repositories/IOS-Style-Kit/Sources/AssetKit/swiftgen.yml
$ swiftgen strings --templateName structured-swift5 --param publicAccess --param lookupFunction=stringLookup --output Resources/Generated/StringsGenerated.swift Resources/Localized/en.lproj
$ swiftgen xcassets --templateName swift5 --param publicAccess --param bundle=Bundle.module --output Resources/Generated/AssetsGenerated.swift Resources/Assets.xcassets
Not writing the file as content is unchanged
Plug-in ended with non-zero exit code: 1)
Build stopped 19/09/2023, 12:40 0.3 seconds
Plugin works as expected with Xcode 14.3.1 with same codebase. This seems to be change in security policy in Xcode 15 but cannot find any setting / documentation allowing to override denial of write access to package directory.
[EDIT]:
Strangely plugin works for Xcode 14.3.1 yet it also shows similar deny write message compile time...
I have solved that in the end.
Plugin can work seamlessly with Xcode 15 but cannot write to package directory, it can however write to build dir which will create sources used by compiler (somewhere in the build folder).
So one con is that there won't be actual file checked in the repository, pros is that no-one ever will be able to edit it manually 😅
Hi all 👋
I am using SwiftGen plugin in few places as SPM plugin, one of which is creation of static accessors for
Localizable.Strings
.SwiftGen is defined as Package dependency in other SwiftPackage (which uses it for codegen). Below is simplified definition of this Package (skipping other products/targets):
Using SwiftGen as SPM plugin with Xcode 15 ends with error:
Plugin works as expected with Xcode 14.3.1 with same codebase. This seems to be change in security policy in Xcode 15 but cannot find any setting / documentation allowing to override denial of write access to package directory.
[EDIT]:
Strangely plugin works for Xcode 14.3.1 yet it also shows similar deny write message compile time...
SwiftGen config:
The text was updated successfully, but these errors were encountered: