conan-clion-plugin icon indicating copy to clipboard operation
conan-clion-plugin copied to clipboard

Linux: tools.system.package_manager:mode install doesn't work

Open etodanik opened this issue 6 months ago • 3 comments

Conan complains a lot about not being able to install system packages on linux and asks to set tools.system.package_manager:mode from 'check' to 'install', however when that is done it fails to install anything because on Ubuntu apt install requires root (sudo).

etodanik avatar Feb 22 '24 10:02 etodanik

Hi @etodanik

Thanks for your report. This doesn't look like a bug. Conan will not inject sudo automatically to anything, unless the user explicitly says so. There are configurations to manage that too:

$ conan config list | grep package_manager
tools.system.package_manager:mode: Mode for package_manager tools: 'check', 'report', 'report-installed' or 'install'
tools.system.package_manager:sudo: Use 'sudo' when invoking the package manager tools in Linux (False by default)
tools.system.package_manager:sudo_askpass: Use the '-A' argument if using sudo in Linux to invoke the system package manager (False by default)
tools.system.package_manager:tool: Default package manager tool: 'apk', 'apt-get', 'yum', 'dnf', 'brew', 'pacman', 'choco', 'zypper', 'pkg' or 'pkgutil'

Seems like you want to activate tools.system.package_manager:sudo=True too

memsharded avatar Feb 22 '24 11:02 memsharded

If I do sudo = True it complains that there is no terminal. I do think it's a 'bug' insomuch that something like this should be anticipated (whole Linux userbase would suffer) and provided as a more coherent instruction / error.

Right now it looks like this plugin won't be able to install any packages because it doesn't run in an interactive terminal.

etodanik avatar Feb 22 '24 11:02 etodanik

If I do sudo = True it complains that there is no terminal.

Ok, that would be something I was not aware and need to be investigated. Pinging @czoido and @RubenRBS for feedback about this.

memsharded avatar Feb 22 '24 11:02 memsharded