Page MenuHomePhabricator

Handle path slashes properly, when the binary is compiled in Windows and used in Linux and vice-versa
Needs ReviewPublic

Authored by deepak2427 on Jul 25 2014, 8:09 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Hi,

The slashes in the paths are not currently handled properly, especially when the binary is compiled in Windows and used in Linux and vice-versa. This is also a problem for source file mapping. The patch introduces a new function to handle strncmp for paths independently.

Diff Detail

Event Timeline

deepak2427 updated this revision to Diff 11879.Jul 25 2014, 8:09 AM
deepak2427 retitled this revision from to Handle path slashes properly, when the binary is compiled in Windows and used in Linux and vice-versa.
deepak2427 updated this object.
deepak2427 edited the test plan for this revision. (Show Details)
deepak2427 added a subscriber: Unknown Object (MLST).

I don't think this works. \ and / are only identical on Windows. On other
platforms \ is a character that can actually appear in a string.
Furthermore, this doesn't address the issue in FileSpec, which also has
issues dealing with Windows paths. Incidentally, I was already working on
a patch to address exactly this. I think the correct fix is to fix it in
FileSpec, and then update PathMappingList to use FileSpecs instead of
ConstStrings.

Yeah, updating the PathMappingList does seem more appropriate. We specifically had issues with interoperability handling paths between different operating systems. If your patch is ready, please put it up and we can test it out.

It's not ready yet, but I was hoping to have it ready by the end of the
day. I went down the wrong path yesterday so had to scrap it and start
over, but I think I'm on the right track now.