azure-sdk-for-c icon indicating copy to clipboard operation
azure-sdk-for-c copied to clipboard

CMake with Ninja Generator fails for [ubuntu 20] with [ninja version 1.10]

Open CIPop opened this issue 3 years ago • 2 comments

Describe the bug CMake generation on Linux fails when Ninja is used as a generator.

Exception or Stack Trace

 Generating done
 CMake Error:
   Running

    '/usr/bin/ninja' '-C' '/home/crispop/c/build' '-t' 'cleandead'

   failed with:

    ninja: warning: phony target 'sdk/src/azure/core/az_core_cov' names itself as an input; ignoring [-w phonycycle=warn]

   ninja: warning: phony target 'sdk/src/azure/core/az_core_cov_html' names
   itself as an input; ignoring [-w phonycycle=warn]

   ninja: error: build.ninja:287: multiple rules generate
   sdk/src/azure/core/az_core_cov [-w dupbuild=err]




 CMake Error:
   Running

    '/usr/bin/ninja' '-C' '/home/crispop/c/build' '-t' 'recompact'

   failed with:

    ninja: warning: phony target 'sdk/src/azure/core/az_core_cov' names itself as an input; ignoring [-w phonycycle=warn]

   ninja: warning: phony target 'sdk/src/azure/core/az_core_cov_html' names
   itself as an input; ignoring [-w phonycycle=warn]

   ninja: error: build.ninja:287: multiple rules generate
   sdk/src/azure/core/az_core_cov [-w dupbuild=err]

To Reproduce

mkdir build
cd build
cmake -G Ninja ..
ccmake ..

Select a Debug build with all options ON:

 CMAKE_BUILD_TYPE                 Debug
 CMAKE_INSTALL_PREFIX             /usr/local
 LOGGING                          ON
 PRECONDITIONS                    ON
 TRANSPORT_CURL                   ON
 TRANSPORT_PAHO                   ON
 UNIT_TESTING                     ON
 UNIT_TESTING_MOCKS               ON
 VCPKG_APPLOCAL_DEPS              ON
 VCPKG_TARGET_TRIPLET             x64-linux
 WARNINGS_AS_ERRORS               ON

Press C twice. Press G to generate.

Code Snippet Add the code snippet that causes the issue.

Unknown

Expected behavior

VSCode CMake extension defaults to Ninja in latest builds (at least for me). I expect VSCode + CMake extension to work without many alterations.

Screenshots If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: Ubuntu 20.04 (either VM or WSLv2)
  • IDE: VSCode latest on Windows remoting into WSLv2 or Ubuntu.
  • Version of the Library used: latest main

Additional context Add any other context about the problem here.

Information Checklist Please make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [X] Bug Description Added
  • [X] Repro Steps Added
  • [X] Setup information Added

CIPop avatar Nov 10 '21 19:11 CIPop

This is due to Ninja version 1.10 Using Ninja version 1.8.2, the issue is just a warning but there's no error. Here's the 1.8.2 Ninja install link: https://github.com/ninja-build/ninja/releases/tag/v1.8.2

Quick workaround for now is to downgrade from version 1.10 to 1.8

On ubuntu 18, version 1.8 comes out of the box. (apt-get). So no issue here. On ubuntu 20, version 1.10 comes out of the box (apt-get). Workaround is to downgrade version to 1.8

I will leave issue open to fix for ubuntu 20 with ninja version 1.10

vhvb1989 avatar Jan 04 '22 20:01 vhvb1989

I've downgraded to 1.8.2 and that solved my issue! Thanks @vhvb1989 !

CIPop avatar Jan 05 '22 00:01 CIPop

Hi @CIPop, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

github-actions[bot] avatar Mar 15 '24 18:03 github-actions[bot]