tulsi icon indicating copy to clipboard operation
tulsi copied to clipboard

Using Xcode 12 Beta to open large project is very slow or even stuck.

Open xiemotongye opened this issue 4 years ago • 9 comments

Our project is a large project(more than 14000 source files). We are using Bazel to organize our project and use Tulsi to generate our xcodeproj file. It is very slow when we use Xcode 12 Beta6 to open our xcodeproj file every time(more than 10 minutes), sometimes it even get stuck.

xiemotongye avatar Aug 26 '20 11:08 xiemotongye

I thought this is an Xcode 12 regression. I’ve filed a radar about it.

thii avatar Aug 26 '20 12:08 thii

The workaround is to generate a focused project, by editing your .tulsigen's sourceFilters to only include what you want to see in the generated project.

thii avatar Aug 27 '20 13:08 thii

Yeah, we've noticed the same thing internally. Will confirm this is still an issue with the Xcode 12 GM, planning to add new CLI options to help with this focus style of project generation.

DavidGoldman avatar Sep 15 '20 21:09 DavidGoldman

Another workaround (if you are prepared to lose all code completion) is to temporarily disable Xcode indexing: defaults write com.apple.dt.Xcode IDEIndexDisable -bool true and restart Xcode.

ali-fareed avatar Sep 15 '20 21:09 ali-fareed

The root cause of the problem is too many (indexer) targets outside of the active scheme, spindump:

432  __76-[IDESourceKitIndexableProxy productHeadersInWorkspace:withCompletionBlock:]_block_invoke + 63 (IDEFoundation + 5046289) [0x10a84e011]
                                  432  -[Xcode3Target productHeadersInWorkspace:withCompletionBlock:] + 291 (DevToolsCore + 2605117) [0x1261ae03d]
                                    432  -[Xcode3Target _buildParametersForIndexingInWorkspace:] + 230 (DevToolsCore + 2594188) [0x1261ab58c]
                                      430  -[IDEWorkspace(IndexingBuildParameters) ideIndex_buildParametersForIndexingBlueprint:synthesizedMacroOverrides:] + 122 (IDEFoundation + 5124174) [0x10a86104e]
                                        430  -[IDEWorkspace(IndexingBuildParameters) ideIndex_runDestinationForIndexingWithScheme:] + 303 (IDEFoundation + 5125952) [0x10a861740]
                                          430  -[IDERunDestination isValidRunDestinationForScheme:schemeTask:schemeCommand:executionEnvironment:overridingTestingSpecifiers:runDestinationManager:error:] + 118 (IDEFoundation + 3065322) [0x10a66a5ea]

I tried attaching the indexer targets to the app schemes, which ended up fixing this issue but then building fails (just spins forever).

We've filed a radar for this: FB8286145

DavidGoldman avatar Sep 15 '20 21:09 DavidGoldman

Testing this with the Xcode 12 GM right now, initial checks indicate it might be fixed

DavidGoldman avatar Sep 16 '20 16:09 DavidGoldman

Seems to be improved but not fixed, some of our larger projects can take a couple minutes before the files/folders show up

DavidGoldman avatar Sep 16 '20 19:09 DavidGoldman

Filed new issue against Xcode 12 (GM) as FB8705312, improved but still not back to Xcode 11 speeds for large projects

DavidGoldman avatar Sep 17 '20 16:09 DavidGoldman

Xcode13 have same question

nanshanyi avatar Nov 29 '21 11:11 nanshanyi

Thanks for submitting this issue but this tool is being deprecated. Please checkout rules_xcodeproj for a more complete and maintained Xcode integration.

keith avatar Feb 15 '23 17:02 keith