VS2015 x64 Native Tools Command Prompt

Ben Crowhurst's Avatar

Ben Crowhurst

22 Nov, 2016 03:52 AM

I've lost several hours attempting to figure this out and I'm still at a complete loss. I can confirm my project builds on Windows C++ compilers on Intel and AMD architectures and has done for many years without fault. What I can't seem to discover is how to start the desired command prompt from within AppVeyor?

Attempts:

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 store
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" amd64

I've trawled google for many hours and I'm still at a complete loss, not to mention all the builds and configurations I've attempted. Any help would be greatly appreciated.

  1. 1 Posted by Ben Crowhurst on 22 Nov, 2016 05:23 AM

    Ben Crowhurst's Avatar

    From what I can gather AppVeyor refuses to acknowledge the vcvarsall.bat environmental setup.

    If you attempt to create the environment the whole setup craps itself.
    ...
    set LIB=...;%LIB%
    set UseEnv=true
    ...

    Well after 35 odd build attempts and a 7 hour day, I need a drink!

  2. Support Staff 2 Posted by Ilya Finkelshte... on 22 Nov, 2016 10:45 PM

    Ilya Finkelshteyn's Avatar

    Hi Ben, hope you feel well after yesterday :)

    Could you please provide me steps how to do a simple problem repro? Am I understand correctly, that you managed to execute vcvarsall.bat amd64 without errors. But after it some environment variables are not changed as expected?

    Thank you,
    Ilya.

  3. 3 Posted by Ben Crowhurst on 22 Nov, 2016 10:53 PM

    Ben Crowhurst's Avatar

    Build steps on Windows are as follows:

    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

    git clone --recursive https://github.com/corvusoft/restbed.git

    cd restbed\dependency\openssl
    perl Configure VC-WIN64A
    ms\do_win64a
    nmake -f ms\ntdll.mak
    nmake -f ms\ntdll.mak test
    set PATH=restbed\dependency\openssl\out32dll;%PATH%

    mkdir restbed/build
    cd restbed/build
    cmake -G "Visual Studio 14 2015 Win64" -DBUILD_EXAMPLES=YES -DBUILD_TESTS=YES ..
    cmake --build . --target ALL_BUILD --config Release
    ctest

    The errors I see from AppVeyor have all been expressed locally when the Native Tools environment is not setup correctly. That is to state, unless I open the the command prompt via

    %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" amd64

    The build will not succeed. Either failing when building OpenSSL or when linking the OpenSSL dependency with the primary project; depending on the attempted AppVeyor setup.

  4. Support Staff 4 Posted by Ilya Finkelshte... on 24 Nov, 2016 11:45 PM

    Ilya Finkelshteyn's Avatar

    Yeah I see, I cloned your repo and made a lot of attempts to build using YAML you provided originally, with different modifications. But the only success I got when I connected to build worker with RDP and followed stamps manually from command prompt started as %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" amd64.

    There is some difference between command line where you run "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 and new command line started this way. Will look more later.

    --ilya.

  5. 5 Posted by Ben Crowhurst on 05 Dec, 2016 09:16 PM

    Ben Crowhurst's Avatar

    ilya,

    Is this a lost cause? Really not looking forward to keeping Jenkins :/

    Regards,
    Ben Crowhurst

  6. Support Staff 6 Posted by Ilya Finkelshte... on 05 Dec, 2016 09:20 PM

    Ilya Finkelshteyn's Avatar

    Sorry, let us do another investigation push and update in one day.

  7. 7 Posted by Ben Crowhurst on 05 Dec, 2016 09:22 PM

    Ben Crowhurst's Avatar

    Sounds good, thanks.

  8. Support Staff 8 Posted by Ilya Finkelshte... on 06 Dec, 2016 09:28 PM

    Ilya Finkelshteyn's Avatar

    Hi Ben, we are still debugging. Meanwhile is it possible to make a smaller repro of this issue? Each attempt to verify next theory takes too long now...

    --ilya.

  9. 9 Posted by Ben Crowhurst on 06 Dec, 2016 09:55 PM

    Ben Crowhurst's Avatar

    ilya,

    I've disabled all the tests and removed all but one example. Still required to build OpenSSL but has helped to bring the build time down. You can find the updated repo here https://ci.appveyor.com/project/ben-crowhurst/restbed-abebc

  10. 10 Posted by Ben Crowhurst on 28 Dec, 2016 09:24 PM

    Ben Crowhurst's Avatar

    Any traction here? Looking to determine our options for rolling out across the company early next year.

  11. 11 Posted by Maik Riechert on 24 Apr, 2017 09:28 PM

    Maik Riechert's Avatar

    Try to do it like that:

    • call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

    Alternatively:
    - %COMSPEC% /E:ON /V:ON /K "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

    One of those should work.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac