Xcode Cloud not downloading git-lfs images automatically

The documentation states that Xcode Cloud comes with support for git lfs (https://developer.apple.com/documentation/xcode/source-code-management-setup) but when I run my unit tests in Xcode Cloud, which have many images which are stored in git lfs, the tests all fail because they don't have the images.

How do I get Xcode Cloud to fetch git lfs images?

Thanks

As it turns out, Xcode Cloud is not having any trouble fetching the images. The issue was that Xcode Cloud builds the tests on one machine and then passes the test bundle onto another machine which doesn't have access to the repo, so it doesn't have any of the images. Needed to use symlinks and Xcode Cloud build scripts to fix it.

Yeah, that matches my understanding. We call this out in Configuring your Xcode Cloud workflow’s actions, which says:

Xcode Cloud performs each action separately in a temporary build environment. As a result, an action’s artifacts might not be available to other actions. For example, a test action’s test result bundle isn’t available to other actions.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Would it be possible to elaborate on this?

I have tried setting up Xcode cloud builds, and on my first attempt the build failed because some of the larger libraries were not present in the repo's remote. ("no such file" error). These libraries were symlinks locally, but navigating to them inside the repository and examining them, they merely showed the local path on my machine where the library was located.

To remedy this, I tried using git lfs. Now the large libraries are stored within the repo via lfs. I can clone the project to my local machine without any issues.

However, when triggering a cloud build, I'm getting the error in the attached image. The library file mentioned is one of the files stored via git lfs, and the clone operation seems to be unable to obtain it.

The error happens during the "fetch source code" phase of the build, and since the documentation on writing custom build scripts only mentions post-clone scripts at the earliest, I'm assuming that custom scripts won't help me here. So I think the issue must be different from the one the OP had.

How can I make Xcode properly clone the files in question?

Xcode Cloud not downloading git-lfs images automatically
 
 
Q