[PATCH] D30467: Use relative path to clang-cl

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 11:29:40 PST 2017


zturner created this revision.

This is an attempt to get the fix the issue breaking the sanitizer windows bots (http://lab.llvm.org:8011/builders/sanitizer-windows/).  I put a comment in explaining why I think this might work.

I'm not sure how else to fix it.  If we want to use backslashes it has to be 4 backslashes.  We could also use forward slashes.  But we don't have the value of `%(workdir)` on the master, so we can't know.  In one thread Galina suggested to use `file(TO_CMAKE_PATH)` but this would need to be done at the top level LLVM `CMakeLists.txt` file, which is a little scary, and furthermore CMake officially marks this method as "avoid" (reference: https://cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F)

That said, if

  file(TO_CMAKE_PATH "${CMAKE_CXX_COMPILER}" CMAKE_CXX_COMPILER)
  file(TO_CMAKE_PATH "${CMAKE_C_COMPILER}" CMAKE_C_COMPILER)

works and will not cause unforeseen problems, I'm open to trying it.  But this is beyond my CMake expertise.  +beanz and brad king who might be able to comment on the CMake method.


https://reviews.llvm.org/D30467

Files:
  zorg/buildbot/builders/SanitizerBuilderWindows.py


Index: zorg/buildbot/builders/SanitizerBuilderWindows.py
===================================================================
--- zorg/buildbot/builders/SanitizerBuilderWindows.py
+++ zorg/buildbot/builders/SanitizerBuilderWindows.py
@@ -141,8 +141,11 @@
                           extract_fn=extractSlaveEnvironment,
                           env=Property('slave_env')))
 
-    # Get absolute path to clang-cl.
-    clang_cl = "%(workdir)s/" + build_dir + "/bin/clang-cl"
+    # Use relative path to clang-cl.  We would just be basing it off of
+    # %(workdir) anyway, but %(workdir) will confuse the setting of
+    # CMAKE_CXX_COMPILER and CMAKE_C_COMPILER.  Since we're already inside of
+    # %(workdir) (by definition), a relative path should be fine.
+    clang_cl = build_dir + "/bin/clang-cl"
     f.addStep(ShellCommand(name='cmake',
                            command=[cmake, "-G", "Ninja", "../llvm",
                                "-DCMAKE_BUILD_TYPE="+config,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30467.90063.patch
Type: text/x-patch
Size: 979 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170228/05b7fe9a/attachment.bin>


More information about the llvm-commits mailing list