conan-io / cmake-conan

CMake wrapper for conan C and C++ package manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] conan_cmake_install fails to auto install aptly deps

Eric-Bwr opened this issue · comments

Environment details

  • Operating System+version: Ubuntu 20.04
  • Compiler+version: gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  • Conan version: 2.0.9
  • Python version: 3.8.10

Profile:

[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.version=9
os=Linux

[conf]
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True

Steps to reproduce

First of all, I want to be able to let conan2 auto install missing aptly deps.
So I added these to the conan2 profile so that it can install missing deps via sudo:

[conf]
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True

And just run the conan_cmake_instlall failes with:

xorg/system: RUN: sudo apt-get update
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

ERROR: xorg/system: Error in system_requirements() method, line 28
	apt.install(["libx11-dev", "libx11-xcb-dev", "libfontenc-dev", "libice-dev", "libsm-dev", "libxau-dev", "libxaw7-dev",
	ConanException: Command 'sudo apt-get update' failed
CMake Error at conan/conan.cmake:686 (message):
  Conan install failed='1'
Call Stack (most recent call first):
  GFX/CMakeLists.txt:14 (conan_cmake_install)

So I wonder, what did I miss? I will attach the CMakeLists.txt and the output log.

Logs

Output.txt
CMakeListss.txt

Hi @Eric-Bwr

This seems expected. You are using Conan 2.0, but the cmake-conan for Conan 1.X.

You need to use the new cmake-conan integration in this branch: https://github.com/conan-io/cmake-conan/tree/develop2 (it is linked also in the repo main readme) to work with Conan 2.0. It is based on the new CMake providers, so it can achieve also transparent integration, and it is being actively developed, so any feedback will be welcome.

Moving the ticket to that repo.

Ahhhh ok, thank you very much! Im closing this :)