microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.26k stars 6.41k forks source link

[vcpkg] vcpkg does not handle invalid paths in PATH #8116

Closed Andyjk1406 closed 5 years ago

Andyjk1406 commented 5 years ago

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:

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!

MVoz commented 5 years ago

Check the variable %PATH%. User and System Remove non-existent links.

cmake.cmd: The filename, directory name, or volume label syntax is incorrect.

I had this when the variable was referring to a removable disk that was disabled

Andyjk1406 commented 5 years ago

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 - \cmake.cmd: The filename, directory name, or volume label syntax is incorrect.

Could there be a typo in a vcpkg file ? I'd expect it to be '.\cmake.cmd' not '\cmake.cmd' I also only seem to have 'cmake.exe' in my Program Files\Cmake\bin directory (not 'cmake.cmd')

MVoz commented 5 years ago

where cmake.cmd

where cmake.exe

where cmake*

? log

Andyjk1406 commented 5 years ago

C:\Repos\vcpkg>where cmake.cmd INFO: Could not find files for the given pattern(s).

C:\Repos\vcpkg>where cmake.exe C:\Program Files\CMake\bin\cmake.exe

C:\Repos\vcpkg>where cmake* C:\Program Files\CMake\bin\cmake-gui.exe C:\Program Files\CMake\bin\cmake.exe

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

MVoz commented 5 years ago

vcpkg install --debug liblzma:x64-windows

log

Andyjk1406 commented 5 years ago

C:\Repos\vcpkg>vcpkg install --debug liblzma:x64-windows [DEBUG] Using vcpkg-root: C:\Repos\vcpkg The following packages will be built and installed: liblzma[core]:x64-windows Starting package 1/1: liblzma:x64-windows Building package liblzma[core]:x64-windows... [DEBUG] Found path: C:\Program Files\CMake\bin\cmake.exe \cmake.cmd: The filename, directory name, or volume label syntax is incorrect.

[DEBUG] c:\repos\vcpkg\toolsrc\src\vcpkg\base\files.cpp(676) [DEBUG] Exiting after 63306 us (40717 us)

MVoz commented 5 years ago

echo %PATH%

?

https://github.com/microsoft/vcpkg/issues/5720#issuecomment-475353436

Andyjk1406 commented 5 years ago

C:\Repos\vcpkg>echo %PATH% C:\Program Files\ImageMagick-7.0.7-Q16;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp;C:\ProgramData\Miniconda2;C:\ProgramData\Miniconda2\Library\mingw-w64\bin;C:\ProgramData\Miniconda2\Library\usr\bin;C:\ProgramData\Miniconda2\Library\bin;C:\ProgramData\Miniconda2\Scripts;C:\Program Files (x86)\Python36-32\Scripts\;C:\Program Files (x86)\Python36-32\;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\Administrator\AppData\Local\Microsoft\WindowsApps;C:\Program Files\flann\bin;C:\TBB\tbb2018_20170919oss\bin\intel64\vc14;C:\Program Files\VTK\bin;C:\Program Files\Boost_Shared\lib;C:\Program Files\Nlopt\bin;C:\Program Files\PCL\bin;C:\Qt\Qt5.9.2\5.9.2\msvc2017_64\bin;C:\Builds\Opencv64\bin\Release;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\mingw-w64\i686-7.2.0-posix-dwarf-rt_v5-rev1\mingw32\bin;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:\ffmpeg-4.2-win64-static\bin;C:\Program Files\CMake\bin;C:\Users\andre\AppData\Local\Programs\Python\Python37\Scripts\;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\gradle-4.1\bin;C:\NVPACK\apache-ant-1.8.2\bin;C:\NVPACK\jdk1.8\bin;C:\NVPACK\android-ndk-r15c;C:\Users\andre\AppData\Local\Microsoft\WindowsApps;C:\Users\andre\AppData\Local\GitHubDesktop\bin;C:\Users\andre\AppData\Local\Microsoft\WindowsApps;

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 ?)

MVoz commented 5 years ago

Too long variable and yes, a lot of "junk" that might interfere with the assembly

Andyjk1406 commented 5 years ago

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] Using vcpkg-root: C:\Repos\vcpkg Your feedback is important to improve Vcpkg! Please take 3 minutes to complete our survey by running: vcpkg contact --survey The following packages will be built and installed: liblzma[core]:x64-windows Starting package 1/1: liblzma:x64-windows Building package liblzma[core]:x64-windows... [DEBUG] Found path: C:\Program Files\CMake\bin\cmake.exe \cmake.cmd: The filename, directory name, or volume label syntax is incorrect.

[DEBUG] c:\repos\vcpkg\toolsrc\src\vcpkg\base\files.cpp(676) [DEBUG] Exiting after 42207 us (27966 us)

C:\Repos\vcpkg>echo %PATH% C:\Program Files\CMake\bin;C:\Program Files\ImageMagick-7.0.7-Q16;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp;C:\ProgramData\Miniconda2;C:\ProgramData\Miniconda2\Library\mingw-w64\bin;C:\ProgramData\Miniconda2\Library\usr\bin;C:\ProgramData\Miniconda2\Library\bin;C:\ProgramData\Miniconda2\Scripts;C:\Program Files (x86)\Python36-32\Scripts\;C:\Program Files (x86)\Python36-32\;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\Administrator\AppData\Local\Microsoft\WindowsApps;C:\Program Files\flann\bin;C:\TBB\tbb2018_20170919oss\bin\intel64\vc14;C:\Program Files\VTK\bin;C:\Program Files\Boost_Shared\lib;C:\Program Files\Nlopt\bin;C:\Program Files\PCL\bin;C:\Qt\Qt5.9.2\5.9.2\msvc2017_64\bin;C:\Builds\Opencv64\bin\Release;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\mingw-w64\i686-7.2.0-posix-dwarf-rt_v5-rev1\mingw32\bin;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:\ffmpeg-4.2-win64-static\bin;C:\Users\andre\AppData\Local\Programs\Python\Python37\Scripts\;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\gradle-4.1\bin;C:\NVPACK\apache-ant-1.8.2\bin;C:\NVPACK\jdk1.8\bin;C:\NVPACK\android-ndk-r15c;C:\Users\andre\AppData\Local\Microsoft\WindowsApps;C:\Users\andre\AppData\Local\GitHubDesktop\bin;C:\Users\andre\AppData\Local\Microsoft\WindowsApps;

MVoz commented 5 years ago

Miniconda2 - Python36-32 ? delete mingw* - delete

MVoz commented 5 years ago

;C:\Program Files\flann\bin;C:\TBB\tbb2018_20170919oss\bin\intel64\vc14;C:\Program Files\VTK\bin;C:\Program Files\Boost_Shared\lib;C:\Program Files\Nlopt\bin;C:\Program Files\PCL\bin;C:\Qt\Qt5.9.2\5.9.2\msvc2017_64\bin;C:\Builds\Opencv64\bin\Release; delete

MVoz commented 5 years ago

echo %INCLUDE% ? echo %LIB% ?

Andyjk1406 commented 5 years ago

Cleaned up the path as you suggested....

C:\Repos\vcpkg>echo %path% C:\Program Files\CMake\bin;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\Administrator\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:\ffmpeg-4.2-win64-static\bin;C:\Users\andre\AppData\Local\Programs\Python\Python37\Scripts\;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\gradle-4.1\bin;C:\NVPACK\apache-ant-1.8.2\bin;C:\NVPACK\jdk1.8\bin;C:\NVPACK\android-ndk-r15c;C:\Users\andre\AppData\Local\Microsoft\WindowsApps;C:\Users\andre\AppData\Local\GitHubDesktop\bin;C:\Users\andre\AppData\Local\Microsoft\WindowsApps;

......Nothing in INCLUDE or LIB.....(Should there be?)

C:\Repos\vcpkg>echo %INCLUDE% %INCLUDE%

C:\Repos\vcpkg>echo %LIB% %LIB%

....Still fails....

C:\Repos\vcpkg>vcpkg install --debug liblzma:x64-windows [DEBUG] Using vcpkg-root: C:\Repos\vcpkg The following packages will be built and installed: liblzma[core]:x64-windows Starting package 1/1: liblzma:x64-windows Building package liblzma[core]:x64-windows... [DEBUG] Found path: C:\Program Files\CMake\bin\cmake.exe \cmake.cmd: The filename, directory name, or volume label syntax is incorrect.

[DEBUG] c:\repos\vcpkg\toolsrc\src\vcpkg\base\files.cpp(676) [DEBUG] Exiting after 79136 us (62471 us)

MVoz commented 5 years ago

C:\ffmpeg-4.2-win64-static\bin;C:\Users\andre\AppData\Local\Programs\Python\Python37\Scripts del

cool edit env util https://www.rapidee.com/en/about

Andyjk1406 commented 5 years ago

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:\Program Files\CMake\bin;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:\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:\Repos\vcpkg>vcpkg install --debug liblzma:x64-windows [DEBUG] Using vcpkg-root: C:\Repos\vcpkg The following packages will be built and installed: liblzma[core]:x64-windows Starting package 1/1: liblzma:x64-windows Building package liblzma[core]:x64-windows... [DEBUG] Found path: C:\Program Files\CMake\bin\cmake.exe \cmake.cmd: The filename, directory name, or volume label syntax is incorrect.

[DEBUG] c:\repos\vcpkg\toolsrc\src\vcpkg\base\files.cpp(676) [DEBUG] Exiting after 104759 us (79214 us)

MVoz commented 5 years ago

@PhoebeHui What else could be?? bug VCPKG?

PhoebeHui commented 5 years ago

@Voskrese, I can't repro this issue with cmake 3.15.3, @Andyjk1406, what's PowerShell revision? VCPKG requires powershell revision 5.0 for some feature.

For me, PS E:\vcpkg\src> $psversiontable

Name Value


PSVersion 5.1.18362.145 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.18362.145 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

Andyjk1406 commented 5 years ago

If I open powershell, and check, I get this

PS C:\Repos\vcpkg> $psversiontable

Name Value


PSVersion 5.1.17763.592 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.17763.592 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

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 ?

PhoebeHui commented 5 years ago

@Andyjk1406, please try to build with clean vcpkg source, btw, do you use PowerShell to install port, or other command?

Andyjk1406 commented 5 years ago

OK, I deleted the entire vcpkg folder and subdirs and started again as follows.

1) Create new empty dir (C:\repos\vcpkg) 2) Navigate here in a Windows cmd prompt (Admin rights)

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 Cloning into 'vcpkg'... remote: Enumerating objects: 18, done. remote: Counting objects: 100% (18/18), done. remote: Compressing objects: 100% (16/16), done. remote: Total 66262 (delta 6), reused 9 (delta 2), pack-reused 66244 Receiving objects: 100% (66262/66262), 16.87 MiB | 8.15 MiB/s, done. Resolving deltas: 100% (41609/41609), done. Checking out files: 100% (4011/4011), done.

C:\Repos\vcpkg>dir Volume in drive C is Blade Volume Serial Number is 423A-4597

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 archives.cpp checks.cpp chrono.cpp cofffilereader.cpp downloads.cpp enums.cpp files.cpp hash.cpp machinetype.cpp strings.cpp stringview.cpp system.cpp system.print.cpp binaryparagraph.cpp build.cpp commands.autocomplete.cpp commands.buildexternal.cpp commands.cache.cpp commands.ci.cpp commands.contact.cpp commands.cpp commands.create.cpp commands.dependinfo.cpp commands.edit.cpp commands.env.cpp commands.exportifw.cpp commands.import.cpp commands.integrate.cpp commands.list.cpp commands.owns.cpp commands.porthistory.cpp commands.portsdiff.cpp commands.search.cpp commands.upgrade.cpp commands.version.cpp commands.xvsinstances.cpp dependencies.cpp export.cpp globalstate.cpp help.cpp input.cpp install.cpp logicexpression.cpp metrics.cpp packagespec.cpp packagespecparseresult.cpp paragraphparseresult.cpp paragraphs.cpp parse.cpp postbuildlint.buildtype.cpp postbuildlint.cpp remove.cpp sourceparagraph.cpp statusparagraph.cpp statusparagraphs.cpp tools.cpp triplet.cpp update.cpp userconfig.cpp vcpkgcmdarguments.cpp vcpkglib.cpp vcpkgpaths.cpp versiont.cpp visualstudio.cpp vcpkglib.vcxproj -> C:\Repos\vcpkg\vcpkg\toolsrc\msbuild.x86.release\vcpkglib.lib vcpkg.cpp Generating code All 18001 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. Finished generating code vcpkg.vcxproj -> C:\Repos\vcpkg\vcpkg\toolsrc\msbuild.x86.release\vcpkg.exe vcpkgmetricsuploader.cpp Generating code All 6007 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. Finished generating code vcpkgmetricsuploader.vcxproj -> C:\Repos\vcpkg\vcpkg\toolsrc\msbuild.x86.release\vcpkgmetricsuploader.exe

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] Using vcpkg-root: C:\Repos\vcpkg\vcpkg The following packages will be built and installed: liblzma[core]:x64-windows Starting package 1/1: liblzma:x64-windows Building package liblzma[core]:x64-windows... [DEBUG] Found path: C:\Program Files\CMake\bin\cmake.exe \cmake.cmd: The filename, directory name, or volume label syntax is incorrect.

[DEBUG] c:\repos\vcpkg\vcpkg\toolsrc\src\vcpkg\base\files.cpp(676) [DEBUG] Exiting after 25244 us (12452 us)

MVoz commented 5 years ago

@Andyjk1406 If you downgrade the version to 3.15.1 ? I feel they changed something in version 3.15.2

Andyjk1406 commented 5 years ago

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.' ?

MVoz commented 5 years ago

hmm...

vcpkg env --debug --triplet x64-windows

where cmake*

? log

MVoz commented 5 years ago
  1. set VSCMD_DEBUG=1
1 : basic debug logging
2 : detailed debug logging
3 : trace level logging. Redirection of output to a file when using this level is recommended.

path to Auxiliary\Build\vcvars64.bat

  1. call "C:\Program Files (x86)\Microsoft Visual Studio\...\...\...\VC\Auxiliary\Build\vcvars64.bat" or call "C:\Program Files (x86)\Microsoft Visual Studio\...\...\...Common7\Tools\VsDevCmd.bat"

? log

....\Common7\Tools\vsdevcmd\ext\cmake.bat

.....\Common7\Tools\vsdevcmd> tree /f

├───core
│       dotnet.bat
│       msbuild.bat
│       parse_cmd.bat
│       vsdevcmd_end.bat
│       vsdevcmd_start.bat
│       winsdk.bat
│
└───ext
    │   cmake.bat
    │   fsharp.bat
    │   html_help.bat
    │   netfxsdk.bat
    │   perf_tools.bat
    │   roslyn.bat
    │   team_explorer.bat
    │   testwindow.bat
    │   typescript.bat
    │   vcvars.bat
    │   vssdk.bat
    │
    └───vcvars
            vcvars140.bat
Andyjk1406 commented 5 years ago

First couple of bits....

C:\Repos\vcpkg\vcpkg>vcpkg env --debug --triplet x64-windows [DEBUG] Using vcpkg-root: C:\Repos\vcpkg\vcpkg [DEBUG] Found path: C:\Program Files\CMake\bin\cmake.exe \cmake.cmd: The filename, directory name, or volume label syntax is incorrect. [DEBUG] c:\repos\vcpkg\vcpkg\toolsrc\src\vcpkg\base\files.cpp(676) [DEBUG] Exiting after 24215 us (12561 us)

C:\Repos\vcpkg\vcpkg>where cmake* C:\Program Files\CMake\bin\cmake-gui.exe C:\Program Files\CMake\bin\cmake.exe

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" [DEBUG:vcvarsall.bat] init with arguments 'x64' [DEBUG:vcvarsall.bat] Command line parse completed with values: [DEBUG:vcvarsall.bat] VCVARSALL_TARGET_ARCH='x64' [DEBUG:vcvarsall.bat] VCVARSALL_HOST_ARCH='x64' [DEBUG:vcvarsall.bat] VCVARSALL_WINSDK='' [DEBUG:vcvarsall.bat] __VCVARSALL_STORE='' [DEBUG:vcvarsall.bat] VCVARSALL_HELP='' [DEBUG:vcvarsall.bat] __VCVARSALL_PARSE_ERROR='0' [DEBUG:VsDevCmd] Writing pre-initialization environment to C:\Users\andre\AppData\Local\Temp\dd_vsdevcmd15_preinit_env.log [DEBUG:core\vsdevcmd_start] initializing with arguments '' [DEBUG:core\parse_cmd.bat] initializaing with arguments '' [DEBUG:VsDevCmd.bat] Found version "15.9.15"


Visual Studio 2017 Developer Command Prompt v15.9.15 Copyright (c) 2017 Microsoft Corporation


[DEBUG:VsDevCmd.bat] calling "core\dotnet.bat" [DEBUG:core\dotnet.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "core\msbuild.bat" [DEBUG:core\msbuild.bat] initializing... [DEBUG:core\msbuild.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "core\winsdk.bat" [DEBUG:winsdk.bat] initializing... [DEBUG:core\winsdk.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\cmake.bat" [DEBUG:ext\cmake.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\html_help.bat" [DEBUG:ext\html_help.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\netfxsdk.bat" [DEBUG:ext\netfxsdk.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\perf_tools.bat" [DEBUG:ext\perf_tools.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\roslyn.bat" [DEBUG:ext\roslyn.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\team_explorer.bat" [DEBUG:ext\team_explorer.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\testwindow.bat" [DEBUG:ext\testwindow.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\typescript.bat" [DEBUG:ext\typescript.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\vcvars.bat" [DEBUG:ext\vcvars.bat] init:COMPLETE [DEBUG:core\vsdevcmd_end] initializing with arguments '' [DEBUG:VsDevCmd] Writing post-execution environment to C:\Users\andre\AppData\Local\Temp\dd_vsdevcmd15_env.log [vcvarsall.bat] Environment initialized for: 'x64'

C:\Repos\vcpkg\vcpkg>"c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" [DEBUG:VsDevCmd] Writing pre-initialization environment to C:\Users\andre\AppData\Local\Temp\dd_vsdevcmd15_preinit_env.log [DEBUG:core\vsdevcmd_start] initializing with arguments '' [DEBUG:core\parse_cmd.bat] initializaing with arguments '' [DEBUG:VsDevCmd.bat] Found version "15.9.15"


Visual Studio 2017 Developer Command Prompt v15.9.15 Copyright (c) 2017 Microsoft Corporation


[DEBUG:VsDevCmd.bat] calling "core\dotnet.bat" [DEBUG:core\dotnet.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "core\msbuild.bat" [DEBUG:core\msbuild.bat] initializing... [DEBUG:core\msbuild.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "core\winsdk.bat" [DEBUG:winsdk.bat] initializing... [DEBUG:core\winsdk.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\cmake.bat" [DEBUG:ext\cmake.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\html_help.bat" [DEBUG:ext\html_help.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\netfxsdk.bat" [DEBUG:ext\netfxsdk.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\perf_tools.bat" [DEBUG:ext\perf_tools.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\roslyn.bat" [DEBUG:ext\roslyn.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\team_explorer.bat" [DEBUG:ext\team_explorer.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\testwindow.bat" [DEBUG:ext\testwindow.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\typescript.bat" [DEBUG:ext\typescript.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\vcvars.bat" [DEBUG:vcvars.bat] VCToolsVersion = "14.16.27023" [DEBUG:ext\vcvars.bat] init:COMPLETE [DEBUG:core\vsdevcmd_end] initializing with arguments '' [DEBUG:VsDevCmd] Writing post-execution environment to C:\Users\andre\AppData\Local\Temp\dd_vsdevcmd15_env.log

Andyjk1406 commented 5 years ago

...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:\Program' is not recognized as an internal or external command, operable program or batch file.

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 Folder PATH listing for volume Blade Volume serial number is 423A-4597 C:. ├───core │ dotnet.bat │ msbuild.bat │ parse_cmd.bat │ vsdevcmd_end.bat │ vsdevcmd_start.bat │ winsdk.bat │ └───ext │ cmake.bat │ html_help.bat │ netfxsdk.bat │ perf_tools.bat │ roslyn.bat │ team_explorer.bat │ testwindow.bat │ typescript.bat │ vcvars.bat │ └───vcvars vcvars140.bat

MVoz commented 5 years ago

dir "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Cmake\bin"

?

Andyjk1406 commented 5 years ago

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" Volume in drive C is Blade Volume Serial Number is 423A-4597

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

MVoz commented 5 years ago

it looks all right, even I do not know what could be

Andyjk1406 commented 5 years ago

Thanks for trying ! Its a complete mystery!

PhoebeHui commented 5 years ago

Are you trying to uninstall cmake? vcpkg will download one.

MVoz commented 5 years ago

env PATH ;;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"

Local\GitHubDesktop\bin;; <<--

;; <<-- delete

delete env C:\Users\andre\AppData\Local\Programs\Python\Python37 C:\Users\andre\AppData\Local\GitHubDesktop\bin

remove duplicates

C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0
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
Andyjk1406 commented 5 years ago

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!

PhoebeHui commented 5 years ago

It's really strange, could you help double check which directory affect this?

Andyjk1406 commented 5 years ago

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. Maybe parsing the string in the files.cpp gets confused with the double semi-colon ?

PhoebeHui commented 5 years ago

Double confirmed, when I add ';;' to PATH, this issue could repro.

codewing commented 5 years ago

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

\cmake.cmd: The filename, directory name, or volume label syntax is incorrect.

PhoebeHui commented 5 years ago

This fix has merged, please get vcpkg latest source and try again.