XCode bot takes so long to integrate

867 Views Asked by At

I build CI server and use Xcode bot to build my project. I have one question that why the bot take so long to integrate (over 30 minutes). It seems like Xcode bot has to check out all source code to build for each integration. Even my normal build from scratch after cleaning project only takes about 15 minutes. The second integration is just faster than the first time a little bit. I wonder what happens when Xcode bot is integrating. Is it check out new source code for each integration or just update the old source? why it takes so much time?

1

There are 1 best solutions below

0
On

I had a similar issue. It turned out that the directory name source code was checked out got corrupted on the CI server. I created the Xcode Bot from a project located in MyProject - iOS directory, this information was conveyed to the bot which did not handle spaces properly.

If you look at the log you will see the directory name got escaped into MyProject%20-%20iOS and then again into MyProject%2520-%2520iOS.

Mar  2 10:56:01  [3230] <Info>: Will attempt to update checkout cache for bot
Mar  2 10:56:01  [3230] <Info>: Xcode Source Control Blueprint was valid.
Mar  2 10:56:01  [3230] <Info>: About to update/checkout:
    https://[email protected]/MyProject Branch: develop into MyProject%20-%20iOS/ 
Mar  2 10:56:01  [3230] <Warning>: Could not load cached workspace: Error Domain=XCSIntegrationService Code=2 "The repositories have changed since the last integration. Falling back to a clean checkout." UserInfo={NSLocalizedDescription=The repositories have changed since the last integration. Falling back to a clean checkout.}
Mar  2 10:56:01  [3230] <Warning>: An error occurred updating existing checkout: Error Domain=XCSIntegrationService Code=2 "The repositories have changed since the last integration. Falling back to a clean checkout." UserInfo={NSLocalizedDescription=The repositories have changed since the last integration. Falling back to a clean checkout.}
Mar  2 11:04:31  [3230] <Info>: 0.40% Compressing objects: 4% done
Mar  2 11:10:26  [3230] <Info>: Counting objects: 69562, done.
Mar  2 11:10:26  [3230] <Info>: 13.57% Receiving objects: 1,7 MB done
[...cut...]
Mar  2 11:35:45  [3230] <Info>: Completed checkout of:
    https://[email protected]/MyProject Branch: develop (@24cec9eca484405f7d2819f3652e34f67853b6fe) into MyProject%2520-%2520iOS/ 

To fix the problem I had to delete the bot, change repository directory name from MyProject - iOS to MyProject and create the bot from scratch.