Now when I quit Xcode I get this warning:
Warning
The project "Foo.xcodeproj" is read only and cannot be saved.
Your changes will be lost when you close it. You may need to
SCM edit the project file to gain writability.
Close and Lose Changes Don't Close
After searching the online help, I came across this "expert" setting:
defaults write com.apple.Xcode PBXDontWarnIfProjectSaveFails YES
I've tried this but it doesn't seem to help. I've submitted this as a bug to Apple.
Furthermore, for some of our developers, they turn on SCM in the project (select project > Get Info > General: SCM System: Perforce; Enable SCM: Yes). These settings stay in effect until they quit Xcode, at which point they get the above warning. When next opened, the project settings are not retained. (Note that the Perforce settings like P4PORT, P4CLIENT, etc., are, however, retained.)
Note that when I initially added the project.pbxproj file to the Perforce depot, these settings were in effect!
So I'm seeing several issues:
- Xcode may not be properly dividing project settings that are per-user (like whether to use SCM) vs. for all users (like files in project, build settings, etc.).
- Alternately, when Xcode needs to write new settings to the johndoe.pbxuser file, perhaps it gives up if it sees that project.pbxproj is write-locked.
- When a user wants to modify the project in a way that affects all users, they should be given the SCM Edit prompt.
- PBXDontWarnIfProjectSaveFails doesn't seem to actually work.
So my question for this forum is two-fold: what exactly do you think the bug is here (if any)? And how do other Perforce users deal with this issue?
(Note that I've read archived messages on this list about adding all the johndoe.pbxuser files to the depot, but that "solution" doesn't look tenable to me.)