Hi!
I am building a c++ solution (FreeCAD) using MSVC2017 in Windows with clcache.
This works just fine when I do a pull request.
However, when I merge the pull request into master, the build will fail.
** Problem description**
Inside my travis.yml I have this code:
if [ "${TRAVIS_OS_NAME}" == "windows" ]; then
cmd.exe /C 'C:\Users\travis\build\FreeCAD\FreeCAD\.travis\build.bat'
...
else
...
fi
build.bat contains this script:
echo on
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64
MSBuild.exe FreeCAD_Trunk.sln /p:CLToolExe=clcache.exe /p:TrackFileAccess=false /p:CLToolPath=C:\Users\travis\build\FreeCAD\FreeCAD /m:2 /nologo /verbosity:minimal /p:Configuration=Release /p:Platform=x64
When I push to my personal branch and do a pull request, this code works just fine (I cancelled the script after msbuild.exe starts building):
https://travis-ci.org/FreeCAD/FreeCAD/jobs/527367887
After merging the PR to master:
https://travis-ci.org/FreeCAD/FreeCAD/jobs/527373677
MSBuild does not start building, it hangs within the batch file between the sourcing of the environment variables and the execution of msbuild.exe with error
C:\Users\travis\build\FreeCAD\FreeCAD\build>call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated
Before using the batch file, I was using this one liner inside travis.yml instead of the call to the batch file:
cmd.exe /C '"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64 && MSBuild.exe FreeCAD_Trunk.sln /p:CLToolExe=clcache.exe /p:TrackFileAccess=false /p:CLToolPath=C:\Users\travis\build\FreeCAD\FreeCAD /m:2 /nologo /verbosity:minimal /p:Configuration=Release /p:Platform=x64'
The behaviour was the same. Working perfectly when in a PR. Failing in master.
I cannot understand what is different during the PR build and the master build. I have read that some variables are not available during PR for security reasons, but I do not follow what may be happening.
I would appreciate any help.
Regards,
abdullah
Full Configuration:
Travis:
https://travis-ci.org/FreeCAD/FreeCAD/jobs/527373677/config
Source (batch file):