[cmake-developers] [CMake 0013935]: CMake generates corrupt Xcode project files due to illegal reuse of target dependencies

Mantis Bug Tracker mantis at public.kitware.com
Tue Feb 19 13:03:10 EST 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13935 
====================================================================== 
Reported By:                Rick Ballard
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13935
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2013-02-19 13:03 EST
Last Modified:              2013-02-19 13:03 EST
====================================================================== 
Summary:                    CMake generates corrupt Xcode project files due to
illegal reuse of target dependencies
Description: 
CMake generates corrupt Xcode project files which will cause Xcode to crash in
certain circumstances.

In an Xcode project file, every time a target depends on another target there
should be a unique PBXTargetDependency object in the project file representing
that dependency. Even if multiple targets depend on the same other target, they
should each have their own instance of a PBXTargetDependency representing that
relationship to the other target. Unfortunately, CMake reuses a
PBXTargetDependency object when multiple targets depend on the same other
target. This will cause Xcode to crash if the user tries to delete that target
dependency in Xcode's target editor UI. It may cause other problems as well,
though I haven't looked into it enough to know.

Please fix CMake so that it generates a unique PBXTargetDependency in the
project file for every instance of a target dependency.

Steps to Reproduce: 
1. Install cmake from
http://www.cmake.org/files/v2.8/cmake-2.8.10.2-Darwin64-universal.dmg
2. Download and unzip the attached sample folder that is attached.
3. Create a folder named xcodebuild inside the sample folder
4. Open a terminal and do "cd sample/xcodebuild"
5. Run the command "cmake -G Xcode .."

At this point if you inspect the text of the generated Xcode project named
"HELLO", you will see that there are PBXTargetDependency objects in this file
that are referenced by multiple targets. This is a bug; each PBXTargetDependency
is allowed to be owned by one and only one target.

To demonstrate a crash in Xcode that this causes:

6. Open the Xcode project named HELLO that is created inside the xcodebuild
folder
7. Select the Hello target, choose "Build Phases"
8. Open "Target Dependency" build phase
9. Select "ZERO_CHECK (HELLO)" dependency
10. Click "-" to remove the selected dependency
11. Wait for Xcode to crash.

Additional Information: 
Apple has received a lot of crash reports from users hitting this crash. While
it is a bug that corrupt project files cause Xcode to crash instead of
displaying an error, we'd appreciate it if CMake would generate correct project
files.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-02-19 13:03 Rick Ballard   New Issue                                    
2013-02-19 13:03 Rick Ballard   File Added: sample.zip                       
======================================================================




More information about the cmake-developers mailing list