llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.37k stars 12.15k forks source link

Lit fails some tests when `PATH` has quoted paths #26773

Open llvmbot opened 8 years ago

llvmbot commented 8 years ago
Bugzilla Link 26399
Version trunk
OS Windows NT
Attachments An example of the output in a failing condition
Reporter LLVM Bugzilla Contributor
CC @modocache,@pogo59

Extended Description

In TestRunner.py, _executeShCmd (at line 292) fails when PATH has quoted paths in it:

        if not executable:
            executable = lit.util.which(args[0], cmd_shenv.env['PATH'])
        if not executable:
            raise InternalShellError(j, '%r: command not found' % j.args[0])

...and well, the commands invoked are a bit problematic:

Command invoked:

env "PATH=C:\LLVM\build\tools\clang\test\Driver\Output;C:/LLVM/build/Debug/bin;C:/LLVM/build/Debug/bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;C:\Program Files (x86)\Windows Kits\10\bin\x86;;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\tools;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\ide;C:\Program Files (x86)\HTML Help Workshop;;C:\Program Files (x86)\MSBuild\14.0\bin\;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\;C:\WINDOWS\SysWow64;;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\NativeBinaries\x86;C:\Program Files (x86)\Python35-32\Scripts\;C:\Program Files (x86)\Python35-32\;C:\Fossil;C:\Tcl\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\CollabNet\Subversion Client;C:\Python34\;C:\Python27\;C:\Python34\Scripts;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files (x86)\PharosSystems\Core;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\gtk\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Universal Extractor;C:\Program Files (x86)\Universal Extractor\bin;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\chromium_workspace\depot_tools;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Windows Phone TShell\;C:\Program Files (x86)\CMake\bin;C:\Program Files\TortoiseHg\;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Python27\;C:\Python33\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;%JAVA_HOME%\bin;C:\Python33\Scripts;C:\Program Files (x86)\Nmap; C:\Windows\System32\wbin\;C:\wbin;"C:\Users\Alexander Riccio\AppData\Local\nasm";"  C:/LLVM/build/Debug/bin/clang.EXE  -target x86_64-scei-ps4  C:\LLVM\llvm\tools\clang\test\Driver\ps4-linker-win.c -### 2>&1    | C:/LLVM/build/Debug/bin\FileCheck.EXE --check-prefix=CHECK-PS4-LINKER C:\LLVM\llvm\tools\clang\test\Driver\ps4-linker-win.c

Output:

59>         Command 2: "Riccio\AppData\Local\nasm;" "C:/LLVM/build/Debug/bin/clang.EXE" "-target" "x86_64-scei-ps4" "C:\LLVM\llvm\tools\clang\test\Driver\ps4-linker-win.c" "-fuse-ld=gold" "-###"
59>         Command 2 Result: 127
59>         Command 2 Output:
59>
59>
59>         Command 2 Stderr:
59>         'Riccio\\AppData\\Local\\nasm;': command not found

...which causes a test to fail.

pogo59 commented 8 years ago

Is there some particular reason you want to put quotes in your definition of PATH? The Windows SET command doesn't require it, and I've learned (not from lit) that it's better not to have them in the PATH.

  set PATH=%PATH%;C:\Users\Alexander Riccio\AppData\Local\nasm

This works just fine.

llvmbot commented 8 years ago

Related bug:

https://llvm.org/bugs/show_bug.cgi?id=10612