Xcode Cloud is not able to access swift-gen generated file

Hi,

I am using swiftgen as a prebuild command plugin in one of my internal swift packages to generate a swift file for Translations. When using Xcode cloud to build the project, it is giving me the error, Can not find Translations in scope. It seems Xcode cloud is not able to access the generated file (The file gets generated in context.pluginWorkDirectory in prebuild command plugin and is available in my project when build locally). Has anyone faced a similar issue? Is there any thing I can do to make it work in Xcode Cloud?

I am experiencing a same issue.

We are experiencing the same issue, with error messages:

Build input files cannot be found: ‘/Volumes/workspace/repository/Sources/HeyBaby/Resources/Generated/Images.swift’, ‘/Volumes/workspace/repository/Sources/HeyBaby/Resources/Generated/Strings.swift’, ‘/Volumes/workspace/repository/Sources/HeyBaby/Resources/Generated/Fonts.swift’, ‘/Volumes/workspace/repository/Sources/HeyBaby/Resources/Generated/Colors.swift’

Has anyone found a solution?

adding ci_scripts/ci_pre_xcodebuild.sh script with extra steps solved the issue

Can you explain which steps you added to the script?

I'm also experiencing the issue, when digging into the logs a bit further I noticed that the file I generate in the build command is failing to be generated. This doesn't happen locally or when building in Github Actions - so seems specific to Xcode Cloud? I wonder if it is to due with the write permissions of the pluginWorkDirectory being different in Xcode Cloud or because of where DerivedData is located...

Any suggestions on what steps I could add to the pre_xcodebuild.sh script would be really helpful!

Xcode Cloud is not able to access swift-gen generated file
 
 
Q