I can think of some hacky solutions, but perhaps requiring explicit quotes in the tests is sufficient for now, as the other solutions are probably not worth the effort.<br><br>So updating specific tests to quote %python seems reasonable for now.  Lgtm<br><div class="gmail_quote"><div dir="ltr">On Tue, Feb 20, 2018 at 2:37 PM Stella Stamenova via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">stella.stamenova added a comment.<br>
<br>
I agree that making a change to lit to pass the quoted path is the "correct" change, but it's a more disruptive change (see below) and since only a handful of tests invoke %python, I think we should change the tests to pass quotes instead. That said, I'm happy to make the change either way to conform to standards.<br>
<br>
Details:<br>
<br>
I did some reading through the lit code and %clang will actually work correctly. It looks like python is the only one that is explicitly set rather than using one of the helper functions which set the path correctly. The explicit call for python does not:<br>
<br>
  self.config.substitutions.append(('%python', sys.executable))<br>
<br>
(the code is here: llvm\utils\lit\lit\llvm\config.py)<br>
<br>
Changing this to something like:<br>
<br>
  python_path = r"'{}'".format(sys.executable)<br>
  self.config.substitutions.append(('%python', python_path))<br>
<br>
will fix the issues from the current change, however, there are tests that will start failing instead because they expect that the path does not have quotes around it. For example, there are two LLVM tests that start failing:<br>
<br>
  LLVM :: BugPoint/compile-custom.ll<br>
  LLVM :: BugPoint/unsymbolized.ll<br>
<br>
I suspect there may be other tests in clang/LLD/LLDB. Note that one of these tests (unsymbolized.ll) has a trivial fix of removing the quotes around %python, but compile-custom.ll does not because the command it's using is more complicated:<br>
<br>
  ; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext --compile-custom --compile-command="%python %/s.py arg1 arg2" --opt-command opt --output-prefix %t %s | FileCheck %s<br>
<br>
Since I've not run all of the possible lit tests yet, I am not sure whether any other failures will have non-trivial changes as well.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D43265" rel="noreferrer" target="_blank">https://reviews.llvm.org/D43265</a><br>
<br>
<br>
<br>
</blockquote></div>