There have been several posts recently to do with SCM in Xcode 3 that
have helped me figure out a major problem with Xcode 3 when used with
large code bases.
(My definition of large in this case is somewhat arbitrary, but in my
case I would hazard a guess that our code base is a large as say that
of Microsoft Office or Adobe's Creative Suite.)
A couple of days ago, I posted the following:
***
* Perforce vs Xcode 3 => 100% cpu usage *
I have set up my Xcode 3.0 projects to use Perforce.
Now whenever I open such a project the cpu usage goes up to 100% and
stays there indefinitely.
In Xcode's Activity Viewer I get an entry as follows:
SCM Operation
1 operation pending
This cannot be cancelled.
***
Yesterday, David Dunham posted this:
***
* Project Root and SCM *
Our folder layout looks something like
games
library1
library2
game1
game2
...
game50
When we build one game, we obviously don't need to worry about the
source for the other 49.
When I set project root to "games" the SCM Results fills up with all
the games I'm not building. If I set project root to "game2" then
Xcode gives me no SCM access to library1 and library2.
Is there a way to have a clean SCM Results but still be able to check
all relevant files in and out?
***
Thanks to David's post I then revisited my problem with the 100% cpu
usage, as the overall hierarchy he uses is similar (but much smaller)
to ours (one top level folder with many sub-folders for different
projects/libraries etc)
It turns out that the pending SCM operation does actually finish if I
leave it long enough (about 40 mins), at which point Xcode stalls for
maybe two minutes and then eventually crashes. I see now what is
happening:
I too had set my Project Root to be the top level folder of our entire
repository. For some bizarre reason in Xcode 3, Apple decided that
instead of getting the SCM state of each file actually added to the
xcodeproj (as they do in Xcode 2.x), they would get the state of
EVERYTHING from Project Root down, even if not used by the current
project. As such, (in my case) it dutifully gathers up information on
about 50,000 files, runs out of memory and then crashes (Stack trace
at end of email)
So it seems the only way to avoid this is to be more granular about
where Project Root is. Then though we hit David's problem of not being
able to SCM any of the files in the various library folders etc. I
also imagine Project Root is used for other useful stuff (like maybe
finding or the Code Sense stuff?)
What is also annoyingly dumb, is that if multiple Xcode projects use
the same Project root, then Xcode does duplicate SCM operations for
each project that you open instead of realising that they must all
share the same SCM state. This really brings everything to a crawl for
the few brief minutes before it crashes:(
I don't know there is much Apple can do about this apart from
revisting how SCM operations get done, so in the meantime I will just
have to fine-tune the Project root in the 30 projects I use.
I should mention that in my case I am using Perforce, but I would
guess that any SCM system will cause the same problems in similar
circumstances.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden