C:\Jenkins\workspace\cmake_win_core-test>vcvars64.bat" \Java\jre1.8.0_45\bin"" ‚tait inattendu. C:\Jenkins\workspace\cmake_win_core-test> @set "PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\;C:\Program Files (x86)\Java\jre1.8.0_45\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\CMake\bin;C:\Python34;C:\Python34\Scripts;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64;C:\Program Files (x86)\Windows Grep;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files (x86)\CMake\bin;"C:\Program Files (x86)\Java\jre1.8.0_45\bin"" Build step 'Exécuter une ligne de commande batch Windows' marked build as failure Finished: FAILURE
And I don't understand why it's failed...
I've trying to SET the PATH to a new PATH but it's even worse. If someone have an idea ? Just to be clear, CMake and Windows batch works very fine in normal CLI.Thanks in advance for help.
I'll try that tomorrow.
Did you call the .bat also ?
Or you just call CMake after with -G"NMake Makefiles" ?
The problem comes from java web start that adds the path to the JRE in the environment that starts all jobs. It writes it as:
PATH="all_path_variables;"C:\Program Files (x86)\Java\jre1.8.0_45\bin""
Please note the extra quotes surrounding the last path. When the visual studio environment is set up by nmake, calling "vcvars64.bat", the batch script chokes on the first quote thinking it ends the variable, and then calls other programs : "(x86) \Java\jre1.8.0_45\bin" and falls on its sword. This is due to the "set" command being called from within an "if" statement in "vcvars64.bat"
My workaround is the following:
In your jenkins script, if you write a batch script (poor you, I know how much you are suffering), then before calling your build, replace the quotes in your path:
REM remove double quotes from the PATH variable, or nvcc calling vcvars64.bat chokes on them.
set PATH=%PATH:"=%