-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vcpkg] vcpkg does not handle invalid paths in PATH #8116
Comments
Check the variable %PATH%. User and System
I had this when the variable was referring to a removable disk that was disabled |
Thanks I double checked, and removed one old entry in Path that didn't exist. Restarted PC and tried again but I get the same error - Could there be a typo in a vcpkg file ? I'd expect it to be '.\cmake.cmd' not '\cmake.cmd' |
? log |
C:\Repos\vcpkg>where cmake.cmd C:\Repos\vcpkg>where cmake.exe C:\Repos\vcpkg>where cmake* So I don't seem to have a 'cmake.cmd' file - any idea where I get this from. I am on the latest cmake (just installed) and fully updated vcpkg |
log |
C:\Repos\vcpkg>vcpkg install --debug liblzma:x64-windows [DEBUG] c:\repos\vcpkg\toolsrc\src\vcpkg\base\files.cpp(676) |
? |
C:\Repos\vcpkg>echo %PATH% Pretty full, but Cmake is there, about 7 lines up on the left. Should I tray moving the cmake path to the start of %PATH% (like you suggested in the other thread issue ?) |
Too long variable |
Thanks. I have moved cmake to front of path and restarted..Same problem as shown below. I'll try and remove some of the other path variables to shorten the string C:\Repos\vcpkg>vcpkg install --debug liblzma:x64-windows [DEBUG] c:\repos\vcpkg\toolsrc\src\vcpkg\base\files.cpp(676) C:\Repos\vcpkg>echo %PATH% |
Miniconda2 - Python36-32 ? delete |
|
|
Cleaned up the path as you suggested.... C:\Repos\vcpkg>echo %path% ......Nothing in INCLUDE or LIB.....(Should there be?) C:\Repos\vcpkg>echo %INCLUDE% C:\Repos\vcpkg>echo %LIB% ....Still fails.... C:\Repos\vcpkg>vcpkg install --debug liblzma:x64-windows [DEBUG] c:\repos\vcpkg\toolsrc\src\vcpkg\base\files.cpp(676) |
cool edit env util |
Nice tool, thanks! It highlighted a couple of red, invalid, paths. All cleaned up now, this is what I get C:\Repos\vcpkg>echo %path% C:\Repos\vcpkg>vcpkg install --debug liblzma:x64-windows [DEBUG] c:\repos\vcpkg\toolsrc\src\vcpkg\base\files.cpp(676) |
@PhoebeHui |
@voskrese, I can't repro this issue with cmake 3.15.3, @Andyjk1406, what's PowerShell revision? For me, PS E:\vcpkg\src> $psversiontable Name Value PSVersion 5.1.18362.145 |
If I open powershell, and check, I get this PS C:\Repos\vcpkg> $psversiontable Name Value PSVersion 5.1.17763.592 So I think I have a good enough version. It certainly seems to be something to do with finding cmake.cmd (or the command string that is issued). Would completely deleting the whole vkpcg directory (plus all its subdirs) and starting again be sensible ? |
@Andyjk1406, please try to build with clean vcpkg source, btw, do you use PowerShell to install port, or other command? |
OK, I deleted the entire vcpkg folder and subdirs and started again as follows.
Then I did as follows to clone, build then try and install a package C:\Repos\vcpkg>git clone https://github.com/microsoft/vcpkg.git C:\Repos\vcpkg>dir Directory of C:\Repos\vcpkg 10/09/2019 12:08 .10/09/2019 12:08 .. 10/09/2019 12:09 vcpkg 0 File(s) 0 bytes 3 Dir(s) 71,288,164,352 bytes free C:\Repos\vcpkg>cd vcpkg C:\Repos\vcpkg\vcpkg>bootstrap-vcpkg.bat Building vcpkg.exe ... pch.cpp Building vcpkg.exe... done. even after a complete erase and rebuild, I get the same.... C:\Repos\vcpkg\vcpkg>vcpkg install --debug liblzma:x64-windows [DEBUG] c:\repos\vcpkg\vcpkg\toolsrc\src\vcpkg\base\files.cpp(676) |
@Andyjk1406 |
I've just tried uninstalling cmake 3.15.3 and installing 3.15.1 instead. No change, I still get the cmake error. I have also tried installing VS2019 alongside my VS2017 but no help there either. This is really strange. Can anyone suggest how to debug the error '\cmake.cmd: The filename, directory name, or volume label syntax is incorrect.' ? |
hmm... vcpkg env --debug --triplet x64-windows where cmake* ? log |
path to Auxiliary\Build\vcvars64.bat
? log ....\Common7\Tools\vsdevcmd\ext\cmake.bat .....\Common7\Tools\vsdevcmd>
|
First couple of bits.... C:\Repos\vcpkg\vcpkg>vcpkg env --debug --triplet x64-windows C:\Repos\vcpkg\vcpkg>where cmake* C:\Repos\vcpkg\vcpkg>set VSCMD_DEBUG=1 C:\Repos\vcpkg\vcpkg>"c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" ** Visual Studio 2017 Developer Command Prompt v15.9.15 [DEBUG:VsDevCmd.bat] calling "core\dotnet.bat" C:\Repos\vcpkg\vcpkg>"c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" ** Visual Studio 2017 Developer Command Prompt v15.9.15 [DEBUG:VsDevCmd.bat] calling "core\dotnet.bat" |
...and the second part looks similar to yours too C:\Repos\vcpkg\vcpkg>"c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd\ext\cmake.bat" C:\Repos\vcpkg\vcpkg>if "" NEQ "" goto :test C:\Repos\vcpkg\vcpkg>if "" NEQ "" goto :clean_env C:\Repos\vcpkg\vcpkg>if not exist "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin" goto :error_setting_path C:\Repos\vcpkg\vcpkg>if not exist "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja" goto :error_setting_path C:\Repos\vcpkg\vcpkg>set "PATH=c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin;C:\Windows\Microsoft.NET\Framework\v4.0.30319;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools\x64;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;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)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\andre\AppData\Local\Microsoft\WindowsApps;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\dotnet;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\doxygen\bin;C:\Program Files\Git LFS;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;c:\cuDNN\cuda\bin;C:\Program Files\CMake\bin;C:\Users\andre\AppData\Local\Programs\Python\Python37;C:\NVPACK\android-sdk-windows\extras\android\support;C:\NVPACK\android-sdk-windows\build-tools;C:\NVPACK\android-sdk-windows\platform-tools;C:\NVPACK\android-sdk-windows\tools;C:\NVPACK\apache-ant-1.8.2\bin;C:\NVPACK\android-ndk-r15c;C:\Users\andre\AppData\Local\GitHubDesktop\bin;;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja" C:\Repos\vcpkg\vcpkg>goto :end C:\Repos\vcpkg\vcpkg>exit /B 0 C:\Repos\vcpkg\vcpkg>c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd\tree /f C:\Repos\vcpkg\vcpkg>cd "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd" c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd>tree /f |
? |
c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd>dir "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Cmake\bin" Directory of c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Cmake\bin 15/07/2019 17:50 .15/07/2019 17:50 .. 15/07/2019 16:23 8,302,720 cmake.exe 15/07/2019 16:23 1,395,328 cmcldeps.exe 15/07/2019 16:23 8,517,248 cpack.exe 15/07/2019 16:23 9,295,480 ctest.exe 4 File(s) 27,510,776 bytes 2 Dir(s) 64,264,101,888 bytes free |
it looks all right, even I do not know what could be |
Thanks for trying ! Its a complete mystery! |
Are you trying to uninstall cmake? vcpkg will download one. |
env PATH Local\GitHubDesktop\bin;; <<--
delete env remove duplicates
|
Yes! This seems to have fixed it (well spotted on the duplicate paths). So worth noting that duplicate directories in path will cause vcpkg to fail. (Of course, they shouldn't be there in the first place....) Thanks! |
It's really strange, could you help double check which directory affect this? |
I presume it was either the double semi-colon that Voskrese spotted in PATH, or the dupplicates. I deleted both then ran vcpkg install and it worked. |
Double confirmed, when I add ';;' to PATH, this issue could repro. |
I was having the same issue and removing a lot of invalid paths from the PATH variable in both user and global fixed the issue of me. The error was
|
This fix has merged, please get vcpkg latest source and try again. |
Host Environment
To Reproduce
Steps to reproduce the behavior:
vcpkg install opencv[nonfree,contrib,cuda,dnn,eigen,ffmpeg,ipp,jasper,jpeg,opengl,openmp,png,qt,tbb,tiff,vtk]:x64-windows
Failure logs
The following packages will be built and installed:
opencv[contrib,core,cuda,dnn,eigen,ffmpeg,ipp,jasper,jpeg,nonfree,opengl,openmp,png,qt,tbb,tiff,vtk,webp]:x64-windows
Additional packages (*) will be modified to complete this operation.
Starting package 1/71: liblzma:x64-windows
Building package liblzma[core]:x64-windows...
\cmake.cmd: The filename, directory name, or volume label syntax is incorrect.
Additional context
but cmake (version 3.15.3) is there (and in the PATH at C:\Program Files\Cmake\bin)
C:\Repos\vcpkg>cmake
Usage
cmake [options]
cmake [options]
cmake [options] -S -B
Specify a source directory to (re-)generate a build system for it in the
current working directory. Specify an existing build directory to
re-generate its build system.
Run 'cmake --help' for more information.
So vcpkg cannot seem to build anything - how do I point it to cmake ?
Thanks!
The text was updated successfully, but these errors were encountered: