[PATCH] D43265: [lit] Fix a problem with spaces in the python path by adding quotes around it

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 14:47:05 PST 2018


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.

So updating specific tests to quote %python seems reasonable for now. Lgtm
On Tue, Feb 20, 2018 at 2:37 PM Stella Stamenova via Phabricator <
reviews at reviews.llvm.org> wrote:

> stella.stamenova added a comment.
>
> 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.
>
> Details:
>
> 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:
>
>   self.config.substitutions.append(('%python', sys.executable))
>
> (the code is here: llvm\utils\lit\lit\llvm\config.py)
>
> Changing this to something like:
>
>   python_path = r"'{}'".format(sys.executable)
>   self.config.substitutions.append(('%python', python_path))
>
> 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:
>
>   LLVM :: BugPoint/compile-custom.ll
>   LLVM :: BugPoint/unsymbolized.ll
>
> 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:
>
>   ; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext
> --compile-custom --compile-command="%python %/s.py arg1 arg2" --opt-command
> opt --output-prefix %t %s | FileCheck %s
>
> 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.
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D43265
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180220/afb68e2b/attachment.html>


More information about the llvm-commits mailing list