View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015487CMakeCMakepublic2015-04-01 12:212015-12-19 15:41
ReporterGregor Jasny 
Assigned ToGregor Jasny 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformAppleOSMac OS XOS Version10.10.2
Product VersionCMake 3.2.1 
Target VersionFixed in VersionCMake 3.3 
Summary0015487: Leading double slashes in path cause unparsable Xcode project
DescriptionIf the project source path start with a double slash the resulting Xcode project cannot be parsed by Xcode.

I got the double slash at the beginning because my build orchestration script tries to normalize the source path by calling "pwd -P".

So this:
$ pwd
/Volumes/Macintosh HD/Users/jasny/src/pathbug

was translated into

$ pwd -P
//Users/jasny/src/pathbug

and passed to cmake invocation.

Multiple slashes are discussed here:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11 [^]

A pathname consisting of a single slash shall resolve to the root directory of the process. A null pathname shall not be successfully resolved. A pathname that begins with two successive slashes may be interpreted in an implementation-defined manner, although more than two leading slashes shall be treated as a single slash.

I thought about adding a kind of normalization which replaces multiple slashes with one but I'm unsure if this should be done globally or just in the Xcode generator. I will also file a bug report with Apple.
Steps To Reproduceproject(Foo CXX)
add_library(foo STATIC foo.cpp)

cmake -GXcode //path/to/source

open Foo.xcodeproj

Result:
Project /Users/jasny/src/pathbug/build/Foo.xcodeproj cannot be opened because the project file cannot be parsed.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0038382)
Gregor Jasny (developer)
2015-04-01 12:48

Quoting the path like

469770D01ACC562F003570AC /* foo.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = foo.txt; path = "//tmp/foo.txt"; sourceTree = "<absolute>"; };

seems to do the trick. I will work on a patch.
(0038384)
Brad King (manager)
2015-04-01 13:21

Thanks. FYI, CMake interprets a leading double slash to mean that it is a network path of the form //machine/share.
(0038404)
Gregor Jasny (developer)
2015-04-04 16:21

Pushed a simple fix to xcode-quote-path topic.
(0038450)
Brad King (manager)
2015-04-06 10:19

Re 0015487:0038404: Thanks. That looks like the correct fix for this. Please merge to 'next' for testing.

 Issue History
Date Modified Username Field Change
2015-04-01 12:21 Gregor Jasny New Issue
2015-04-01 12:48 Gregor Jasny Note Added: 0038382
2015-04-01 13:21 Brad King Assigned To => Gregor Jasny
2015-04-01 13:21 Brad King Status new => assigned
2015-04-01 13:21 Brad King Note Added: 0038384
2015-04-04 16:21 Gregor Jasny Note Added: 0038404
2015-04-06 10:19 Brad King Note Added: 0038450
2015-12-19 15:41 Gregor Jasny Status assigned => resolved
2015-12-19 15:41 Gregor Jasny Fixed in Version => CMake 3.3
2015-12-19 15:41 Gregor Jasny Resolution open => fixed
2015-12-19 15:41 Gregor Jasny Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team