OSDN Git Service

[lit] Only return a found bash executable on Windows if it can understand Windows...
authorGreg Bedwell <greg_bedwell@sn.scee.net>
Tue, 23 Oct 2018 11:34:04 +0000 (11:34 +0000)
committerGreg Bedwell <greg_bedwell@sn.scee.net>
Tue, 23 Oct 2018 11:34:04 +0000 (11:34 +0000)
commitee6a84b4fee5ae1c731ce767d5cab19a161bf0e9
tree0e80a3d66a992067a3023c110fb12727bf0ae5ea
parent477d32c48ae3fcf618e72e286804c1b2b5bbecbe
[lit] Only return a found bash executable on Windows if it can understand Windows paths

Some versions of bash.exe, for example WSL's version expect paths in the form
/mnt/c/path/to/dir rather than c:\\path\\to\\dir so will cause failures
for any tests that require an external shell if used by lit.  If we're on
Windows and looking for an external shell, check that the found version
of bash is able to parse a native path before returning that version.

This patch also partially reverts the behaviour of r228221 by
restoring the warning if bash cannot be found.  This shouldn't pollute
the lit stderr anymore as we're now using internal shell by default on
Windows.  If someone is explicitly specifying to use an external shell, it's
probably worth alerting them to the fact that bash could not be found.

Differential Revision: https://reviews.llvm.org/D52831

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345019 91177308-0d34-0410-b5e6-96231b3b80d8
utils/lit/lit/LitConfig.py