I configured a CMAKE based build, via vsagent on windows, that was running great until very recently. It started failing with the following error:
Updated with debug output
============================================================================== Task : CMake Description : Build with the CMake cross-platform build system Version : 1.0.25 Author : Microsoft Corporation
Help : More Information
agent.workFolder=C:\vsagent_work loading inputs and endpoints loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION loading INPUT_CMAKEARGS loading INPUT_CWD loaded 5 check path : C:\vsagent_work_tasks\CMake_7d831c3c-3c68-459a-a5c9-bde6e659596c\1.0.25\task.json set resource file to: C:\vsagent_work_tasks\CMake_7d831c3c-3c68-459a-a5c9-bde6e659596c\1.0.25\task.json system.culture=en-US Absolute path for pathSegments: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86/cmake = C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86\cmake Absolute path for pathSegments: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCPackages/cmake = C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCPackages\cmake Absolute path for pathSegments: C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.1/cmake = C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.1\cmake Absolute path for pathSegments: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow/cmake = C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\cmake Absolute path for pathSegments: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer/cmake = C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\cmake Absolute path for pathSegments: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\Roslyn/cmake = C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\Roslyn\cmake Absolute path for pathSegments: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Performance Tools/cmake = C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Performance Tools\cmake Absolute path for pathSegments: C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools/cmake = C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\cmake Absolute path for pathSegments: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools/cmake = C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\cmake Absolute path for pathSegments: C:\Program Files (x86)\Windows Kits\10\bin\x86/cmake = C:\Program Files (x86)\Windows Kits\10\bin\x86\cmake Absolute path for pathSegments: C:\Program Files (x86)\Windows Kits\10\bin\10.0.14393.0\x86/cmake = C:\Program Files (x86)\Windows Kits\10\bin\10.0.14393.0\x86\cmake Absolute path for pathSegments: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin/cmake = C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\cmake Absolute path for pathSegments: C:\Windows\Microsoft.NET\Framework\v4.0.30319/cmake = C:\Windows\Microsoft.NET\Framework\v4.0.30319\cmake Absolute path for pathSegments: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE/cmake = C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\cmake Absolute path for pathSegments: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools/cmake = C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\cmake Absolute path for pathSegments: C:\vsagent\externals\git\cmd/cmake = C:\vsagent\externals\git\cmd\cmake Absolute path for pathSegments: C:\WINDOWS\system32/cmake = C:\WINDOWS\system32\cmake Absolute path for pathSegments: C:\WINDOWS/cmake = C:\WINDOWS\cmake Absolute path for pathSegments: C:\WINDOWS\System32\Wbem/cmake = C:\WINDOWS\System32\Wbem\cmake Absolute path for pathSegments: C:\WINDOWS\System32\WindowsPowerShell\v1.0/cmake = C:\WINDOWS\System32\WindowsPowerShell\v1.0\cmake Absolute path for pathSegments: C:\ProgramData\chocolatey\bin/cmake = C:\ProgramData\chocolatey\bin\cmake Absolute path for pathSegments: C:\Program Files\Git\cmd/cmake = C:\Program Files\Git\cmd\cmake Absolute path for pathSegments: C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit/cmake = C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\cmake Absolute path for pathSegments: C:\Program Files\Microsoft SQL Server\130\Tools\Binn/cmake = C:\Program Files\Microsoft SQL Server\130\Tools\Binn\cmake Absolute path for pathSegments: C:\Program Files\dotnet/cmake = C:\Program Files\dotnet\cmake Absolute path for pathSegments: C:\tools\go\bin/cmake = C:\tools\go\bin\cmake Absolute path for pathSegments: c:\vsagent\scripts/cmake = c:\vsagent\scripts\cmake Absolute path for pathSegments: "C:\Program Files\CMake\bin"/cmake = C:\vsagent_work\1\s\"C:\Program Files\CMake\bin"\cmake Absolute path for pathSegments: C:\WINDOWS\ServiceProfiles\NetworkService\AppData\Local\Microsoft\WindowsApps/cmake = C:\WINDOWS\ServiceProfiles\NetworkService\AppData\Local\Microsoft\WindowsApps\cmake Absolute path for pathSegments: C:\vsagent\bin/cmake = C:\vsagent\bin\cmake Absolute path for pathSegments: C:\vsagent\bin/cmake = C:\vsagent\bin\cmake Absolute path for pathSegments: cmake = C:\vsagent_work\1\s\cmake check path : C:\vsagent_work\1\s\cmake cmake=C:\vsagent_work\1\s\cmake cwd=C:\vsagent_work\1\s\build testing directory 'C:\vsagent_work\1\s\build' testing directory 'C:\vsagent_work\1\s' mkdir 'C:\vsagent_work\1\s\build' cmakeArgs=.. -DCMAKE_TOOLCHAIN_FILE=C:\src\misc\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 15 2017 Win64" C:\vsagent_work\1\s\cmake arg: .. -DCMAKE_TOOLCHAIN_FILE=C:\src\misc\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 15 2017 Win64" exec tool: C:\vsagent_work\1\s\cmake Arguments: .. -DCMAKE_TOOLCHAIN_FILE=C:\src\misc\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -G Visual Studio 15 2017 Win64 C:\vsagent_work\1\s\cmake .. -DCMAKE_TOOLCHAIN_FILE=C:\src\misc\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -G Visual Studio 15 2017 Win64 C:\vsagent_work\1\s\cmake failed. spawn C:\vsagent_work\1\s\cmake ENOENT Processed: ##vso[task.issue type=error;]C:\vsagent_work\1\s\cmake failed. spawn C:\vsagent_work\1\s\cmake ENOENT task result: Failed CMake failed with error: C:\vsagent_work\1\s\cmake failed. spawn C:\vsagent_work\1\s\cmake ENOENT Processed: ##vso[task.issue type=error;]CMake failed with error: C:\vsagent_work\1\s\cmake failed. spawn C:\vsagent_work\1\s\cmake ENOENT Processed: ##vso[task.complete result=Failed;]CMake failed with error: C:\vsagent_work\1\s\cmake failed. spawn C:\vsagent_work\1\s\cmake ENOENT rc:-4058 success:false
The problem is that it is trying to run:
[command]C:\vsagent_work\6\s\cmake
The last build that worked was running a different command:
[command]c:\program files\cmake\bin\cmake.exe
Both builds were running vsagent version 2.114.0. Both builds were running CMAKE Task version 1.0.25. There were no build configuration changes between these two builds. Perhaps an OS update was installed, but I can't find anything in the update history.
It turns out that before the build failures cmake was not in the system PATH. It was in the user PATH of the user that installed vsagent. I added the cmake directory to the system PATH after the failures started, but that did not make any difference. The current PATH listed in the capabilities for the build agent is:
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\tools\go\bin;c:\vsagent\scripts;"C:\Program Files\CMake\bin";C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\WindowsApps;C:\vsagent\bin
As a last data point, we do have a cmake directory at the root of our repo, so c:\vsagent_work\6\s\cmake is a directory on disk.
Does anyone have any idea what might have changed or any ideas on how to diagnose the issue? Why isn't vsagent using cmake from the system PATH?
Update: I've reinstalled the agent and it is now at version 2.120.1