Azure-pipelines-tasks: CMake task now parses arguments on command line

Created on 2 Jun 2020  路  11Comments  路  Source: microsoft/azure-pipelines-tasks

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug

Enter Task Name: CMakeV1

Environment

  • Server - Azure Pipelines
  • Agent - Private (Ubuntu 18.04 and Windows 10)

Issue Description

The change from 1.166.1 to 1.170.1 has caused issues with the CMake task in our Windows and Linux pipelines. In particular, I believe the change to #12880 changes the behavior of CMake arguments that previous didn't have to be quoted. For example, in our pipeline below cmake -DLLVM_ENABLE_PROJECTS=clang;lld;lldb is now causing problems because bash is interpreting the ';'. This can be fixed using quotes, but on Windows the solution is less obvious to me. I wanted to confirm this was the intended behavior of the change and if so figure out what the new Windows arguments should look like. See Windows error log below.

Error logs

On Linux:

Starting: CMake LLVM
==============================================================================
Task         : CMake
Description  : Build with the CMake cross-platform build system
Version      : 1.170.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/cmake
==============================================================================
/usr/bin/cmake /vstsdrive/_work/7/s/llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_INSTALL_PREFIX=/vstsdrive/_work/7/a/LLVMToolchain -DLLVM_ENABLE_PROJECTS=clang;lld;lldb ...
-- The C compiler identification is Clang 9.0.0
...
/bin/sh: 1: lld: not found
...
host: illegal option -- L
Usage: host [-aCdilrTvVw] [-c class] [-N ndots] [-t type] [-W time]
...
##[error]The process '/usr/bin/cmake' failed with exit code 1
##[error]CMake failed with error: The process '/usr/bin/cmake' failed with exit code 1
Finishing: CMake LLVM

On Windows:

Starting: CMake LLVM for VS 2017
==============================================================================
Task         : CMake
Description  : Build with the CMake cross-platform build system
Version      : 1.170.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/cmake
==============================================================================
"C:\Program Files\CMake\bin\cmake.exe" e:\agent\_work\7\s/llvm "-DPYTHON_HOME=C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64" -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 15 2017 Win64" -Thost=x64 -DCMAKE_INSTALL_PREFIX=e:\agent\_work\7\a/LLVMToolchain -DLLVM_ENABLE_PROJECTS=clang;lld;lldb ...
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

##[error]The process 'C:\Program Files\CMake\bin\cmake.exe' failed with exit code 1
##[error]CMake failed with error: The process 'C:\Program Files\CMake\bin\cmake.exe' failed with exit code 1
Finishing: CMake LLVM for VS 2017
ABTT P1 bug

Most helpful comment

@NathanielMcVicar @gilbertw @danieljurek Yes, this fix should be rolled out by tomorrow.

All 11 comments

Yes, this bug is affecting our team too (VS Code C++ extension).

I'm not using ';' on Windows but I still have the same issue.

Starting: CMake
==============================================================================
Task         : CMake
Description  : Build with the CMake cross-platform build system
Version      : 1.170.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/cmake
==============================================================================
"C:\Program Files\CMake\bin\cmake.exe" -A x64 -DCMAKE_HOST_SYSTEM_NAME=Windows -DX64_FILES=ON d:\a\1\s
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

##[error]The process 'C:\Program Files\CMake\bin\cmake.exe' failed with exit code 1
##[error]CMake failed with error: The process 'C:\Program Files\CMake\bin\cmake.exe' failed with exit code 1
Finishing: CMake

This impacts Windows agents validating the Azure Embedded C SDK and Azure C++ SDK.

@anatolybolshakov can we prioritize taking a look at this please? It might be due to a recent change that was made to the task

@anatolybolshakov can we prioritize taking a look at this please? It might be due to a recent change that was made to the task

Yes sure, this seems to be a regression, @egor-bryzgalov is working on fix for this issue

@anatolybolshakov Do hotfixes roll out to ADO users more quickly? I'm trying to get a sense of what our team should do in the meantime, and I see that from the breaking change being merged to it appearing on our pipelines was about 3 weeks. Thanks!

@egor-bryzgalov @anatolybolshakov Can we get an ETA? This is blocking our CI/CD pipelines.
cc @danieljurek

@NathanielMcVicar @gilbertw @danieljurek Yes, this fix should be rolled out by tomorrow.

This fix should be rolled out if somebody could confirm that they are unblocked

The issue appears resolved for us. Thanks everyone!

Please feel free to reopen this issue if it's still reproduced.

Was this page helpful?
0 / 5 - 0 ratings