Porblem with vcvars64.bat

382 views
Skip to first unread message

Matt Algorythm

unread,
Jul 8, 2015, 10:56:50 AM7/8/15
to jenkins...@googlegroups.com
Hello,

I'm trying to resolve an issue I have with Jenkins and CMake on Windows.

I've a slave Jenkins on a Windows 2012 and a master Jenkins on a Linux (Debian). All is working good on the Linux.

But when I'm trying to generate a NMake MakeFile on Windows, after a call of "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat", I've the following issue :

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.

lath...@gmail.com

unread,
Jul 8, 2015, 12:13:37 PM7/8/15
to jenkins...@googlegroups.com
Hello Matt,

I think I got the similar issue on windows 2008 server . Problem I got too is not able to find nmake 

This is what I have done and somehow resolved

In windows box, added the below  path to System PATH variable

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;

See if this helps..

Matt Algorythm

unread,
Jul 8, 2015, 1:37:36 PM7/8/15
to jenkins...@googlegroups.com
Ok, thanks for help.

I'll try that tomorrow.

Did you call the .bat also ?

Or you just call CMake after with -G"NMake Makefiles" ?

lath...@gmail.com

unread,
Jul 8, 2015, 2:31:44 PM7/8/15
to jenkins...@googlegroups.com
yes I do call vcvarsallbat file

Here is what I have in my buildbatch file

call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x64
set MSDEV_HOME=%VCINSTALLDIR%
set MSVCDir=%VCINSTALLDIR%
call nmake -f makefile.wntx64

I am just calling this buildbatch file in jenkins job...

Benoît Bleuzé

unread,
Feb 29, 2016, 9:18:27 AM2/29/16
to Jenkins Users
Hi, in case someone finds this post like I did when experiencing the same problem, here is my solution.

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:"=%

Reply all
Reply to author
Forward
0 new messages