Index: utils/lit/lit/LitConfig.py =================================================================== --- utils/lit/lit/LitConfig.py +++ utils/lit/lit/LitConfig.py @@ -120,6 +120,17 @@ if self.bashPath is None: self.bashPath = '' + # Check whether the found version of bash is able to cope with paths in + # the host path format. If not, don't return it as it can't be used to + # run scripts. For example, WSL's bash.exe requires '/mnt/c/foo' rather + # than 'C:\\foo' or 'C:/foo'. + if self.isWindows and self.bashPath: + command = [self.bashPath, '-c', + '[[ -f "%s" ]]' % self.bashPath.replace('\\', '\\\\')] + _, _, exitCode = lit.util.executeCommand(command) + if exitCode: + self.bashPath = '' + return self.bashPath def getToolsPath(self, dir, paths, tools):