question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CMake task now parses arguments on command line

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
anatolybolshakovcommented, Jun 3, 2020

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

2reactions
NathanielMcVicarcommented, Jun 4, 2020

The issue appears resolved for us. Thanks everyone!

Read more comments on GitHub >

github_iconTop Results From Across the Web

CMake 3.25.1 Documentation
The cmake executable is the command-line interface of the cross-platform buildsystem generator CMake. The above Synopsis lists various actions the tool can ...
Read more >
cmake doesn't correctly parse whitespace in command line ...
Apparently cmake splits the generator name at the whitespace and interprets it as multiple arguments. I've tried multiple combinations of ...
Read more >
Add a means of finishing command line arguments processing
Right now, cmake will run the list file (e.g. a script) as soon as it has read its name, and the list file...
Read more >
CMake, Visual Studio, and the Command Line - dmerej.info
CMake works by parsing code in CMakeLists.txt files, and then generating code that will be used by an other program that would perform...
Read more >
Building CMake projects — qiBuild 3.11.18 documentation
We parse the command line arguments using this parser, and we now have a argparse.NameSpace object we can pass to qibuild.configure.do .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found