[PATCH] D38115: [lit/Win] Check if a path was found before attempting to use it.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 19:14:15 PDT 2017


Interesting.  I think we can do better here by improving the diagnostics
and fallback handling, but it doesn't seem critical, so I can do it later.

On Wed, Sep 20, 2017 at 6:58 PM David Jones <dlj at google.com> wrote:

> This fixes the issue that I found... the programs were elsewhere on the
> system PATH... it just so happened that cmp.exe was somewhere other than
> the explicit lit tools directory. (It was installed by Chocolatey, but grep
> was from a gnuwin32 distribution, both of which are, in fact, in the system
> path.)
>
> On Wed, Sep 20, 2017 at 6:31 PM, Zachary Turner <zturner at google.com>
> wrote:
>
>> Does this actually fix the bots? I'm concerned they'll fail anyway as a
>> result of not finding the tools
>>
>> On Wed, Sep 20, 2017 at 6:27 PM David L. Jones via Phabricator <
>> reviews at reviews.llvm.org> wrote:
>>
>>> This revision was automatically updated to reflect the committed changes.
>>> Closed by commit rL313854: [lit/Win] Check if a path was found before
>>> attempting to use it. (authored by dlj).
>>>
>>> Repository:
>>>   rL LLVM
>>>
>>> https://reviews.llvm.org/D38115
>>>
>>> Files:
>>>   llvm/trunk/utils/lit/lit/llvm/config.py
>>>
>>>
>>> Index: llvm/trunk/utils/lit/lit/llvm/config.py
>>> ===================================================================
>>> --- llvm/trunk/utils/lit/lit/llvm/config.py
>>> +++ llvm/trunk/utils/lit/lit/llvm/config.py
>>> @@ -27,7 +27,8 @@
>>>              path = self.lit_config.getToolsPath(config.lit_tools_dir,
>>>                                             config.environment['PATH'],
>>>                                             ['cmp.exe', 'grep.exe',
>>> 'sed.exe'])
>>> -            self.with_environment('PATH', path, append_path=True)
>>> +            if path is not None:
>>> +                self.with_environment('PATH', path, append_path=True)
>>>              self.use_lit_shell = True
>>>
>>>          # Choose between lit's internal shell pipeline runner and a
>>> real shell.  If
>>>
>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170921/f2eed206/attachment.html>


More information about the llvm-commits mailing list