This is an archive of the discontinued LLVM Phabricator instance.

Replace backslashes with forward slashes
Needs ReviewPublic

Authored by zturner on Feb 21 2017, 3:21 PM.

Details

Reviewers
kcc
gkistanova
Summary

CMake doesn't seem to like when paths have backslashes in them, so replacing them all with forward slashes.

Not sure if there's a better way to accomplish this. This is leading to failures such as here:

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/6620/steps/cmake_1/logs/stdio

Diff Detail

Event Timeline

zturner created this revision.Feb 21 2017, 3:21 PM

Actually this isn't going to work because %workdir isn't even evaluated yet. Galina, do you know how to get the working directory with forward slashes instead of backslashes?

gkistanova edited edge metadata.Feb 21 2017, 3:39 PM

Hi Zachary,

Unfortunately, this wouldn't work as you expect it to. The back slashes come from the %(workdir)s which gets rendered far away from this point.

The right fix should be in cmake to normalize the input paths by converting it with file(TO_CMAKE_PATH,...).

Anyway, it seems we were looking at the same problem at the same time. I have committed a workaround for this issue in https://reviews.llvm.org/rL295785. Hope that will let you go further with your builder.

Galina, do you know how to get the working directory with forward slashes instead of backslashes?

Currently we could get it either with mixed slashes (backslashes from rendering %(workdir)s), or all forward slashes.

Having paths with all forward slashes, you wouldn't be able to set some env vars, like PATH, for example, unless you want to go with a custom renderer in some cases.